diff --git a/demo/tt.json b/demo/tt.json
index b32f6a6b..70136429 100644
--- a/demo/tt.json
+++ b/demo/tt.json
@@ -1,2177 +1,3106 @@
{
- "openapi": "3.0.0",
- "info": {
- "version": "0.0.5",
- "title": "TamTam Bot API",
- "license": {
- "name": "Apache 2.0"
- },
- "description": "# About\n Bot API allows bots to interact with TamTam. Methods are called by sending HTTPS requests to botapi.tamtam.chat domain.\n Bots are third-party applications that use TamTam features. A bot can legitimately take part in a conversation. It can be achieved through HTTP requests to the TamTam Bot API.\n## Features\nTamTam bots of the current version are able to:\n- Communicate with users and respond to requests\n- Recommend users complete actions via programmed buttons\n- Request personal data from users (name, short reference, phone number)\n- more ?\n\nWe'll keep working on expanding bot capabilities in the future.\n## Examples\nBots can be used for following purposes:\n- Providing support, answering frequently asked questions\n- Sending typical information\n- Voting\n- Likes/dislikes\n- Following external links\n- Forwarding a user to a chat/channel\n## @PrimeBot\nWe are beta testing bots in TamTam now. To become a beta tester, please, contact us on **https://tt.me/support** or team@tamtam.chat. We'll give you an access to PrimeBot, all TamTam bots creator. It will help you choose an unique short name for a bot and fill in its full name and description. With PrimeBot you can create bots as well as edit and delete them and browse information on bots you have created.\n#### [PrimeBot](https://tt.me/primebot) commands:\n`/start` — start a dialog with a bot
\n`/create` — create a bot, assign the unique short name to it (from 4 to 64 characters)
\n`/set_name [name]` — assign a short or full name to the bot (up to 200 characters)
\n`/set_description [description]` — enter the description for the bot profile (up to 400 characters)
\n`/set_picture [URL]` — enter the URL of bot's picture
\n`/delete [username]` — delete the bot
\n`/list` — show the list of all bots
\n`/get_token` — obtain a token for a bot
\n`/revoke` — request a new token
\n`/help` — help
\n## Authentification\nA token is given to you by PrimeBot after you have created a bot. You can request additional tokens by sending a /token command to PrimeBot.\nIf [Terms and Conditions of TamTam usage](https://team.tamtam.chat/en/terms/) have been violated, the TamTam administration may withdraw tokens by aborting user sessions.\nIf your token has been compromised, you can request a new one by sending a /revoke command to **[PrimeBot](https://tt.me/primebot)**.\nIn all subsequent requests to the Bot API, you must pass the received token as an access_token parameter to the HTTP request.\n## HTTP verbs\n`GET` — getting resources, parameters are transmitted via URL
\n`POST` — creation of resources (for example, sending new messages)
\n`PUT` — editing resources
\n`DELETE` — deleting resources
\n## HTTP response codes\n`200` — successful operation
\n`400` — invalid request
\n`401` — authentication error
\n`404` — resource not found
\n`405` — method not allowed
\n`429` — the number of requests is exceeded
\n`503` — service unavailable
\n## Resources format\nFor content requests (PUT and POST) and responses, the API uses the JSON format.\nAll strings are UTF-8 encoded.\nDate/time fields are represented as the number of milliseconds that have elapsed since 00:00 January 1, 1970 in the long format. To get it, you can simply multiply the UNIX timestamp by 1000. All date / time fields have a UTC timezone.\n## Error responses\nIn case of an error, the API returns a response with the corresponding HTTP code and JSON with the following fields:\n
\n`error` - the string with the error key
\n`message` - a string describing the error \nFor example:\n```bash\n> http https://botapi.tamtam.chat/chats?access_token={EXAMPLE_TOKEN}\nHTTP / 1.1 403 Forbidden\nCache-Control: no-cache\nConnection: Keep-Alive\nContent-Length: 57\nContent-Type: application / json; charset = utf-8\nSet-Cookie: web_ui_lang = ru; Path = /; Domain = .tamtam.chat; Expires = 2019-03-24T11: 45: 36.500Z\n{\n \"error\": \"verify.token\",\n \"message\": \"Invalid access_token\"\n}\n```\n## Recieving Notifications\nTamTam Bot API supports 2 options of receiving notifications on new dialog events for bots:\n- Push notifications via WebHook. You'll have to use the /subscribe method;\n- Notifications upon request via long polling\nAll data can be received via long polling by default after creating the bot. To receive data via WebHook, you'll have to subscribe explicitly (/subscribe method).\nBoth methods cannot be used simultaneously.\n## Message buttons\nYou can program buttons for users answering a bot.\nTamTam supports the following types of buttons:
\n`callback` — sends a notification to a bot (via WebHook or long polling)
\n`link` — makes a user to follow a link
\n`message` — sends a pre-formed message to the bot as a regular text message
\n`request_contact` — requests the user permission to access contact information (phone number, short link, email)
\nYou may also send a message with an [InlineKeyboard]() type attachment to start creating buttons. When the user presses a button, the bot receives the answer with filled callback field. It is recommended to edit that message so the user can receive updated buttons.\n"
+ "openapi": "3.0.0",
+ "info": {
+ "version": "0.1.6",
+ "title": "TamTam Bot API",
+ "license": {
+ "name": "Apache 2.0"
},
- "servers": [
- {
- "url": "https://botapi.tamtam.chat"
- }
- ],
- "security": [
- {
- "api_key": []
- }
- ],
- "x-tagGroups": [{
- "name": "Methods",
+ "description": "# About\nBot API allows bots to interact with TamTam. Methods are called by sending HTTPS requests to [botapi.tamtam.chat](https://botapi.tamtam.chat) domain.\nBots are third-party applications that use TamTam features. A bot can legitimately take part in a conversation. It can be achieved through HTTP requests to the TamTam Bot API.\n## Features\nTamTam bots of the current version are able to:\n- Communicate with users and respond to requests\n- Recommend users complete actions via programmed buttons\n- Request personal data from users (name, short reference, phone number)\nWe'll keep working on expanding bot capabilities in the future.\n## Examples\nBots can be used for the following purposes:\n- Providing support, answering frequently asked questions\n- Sending typical information\n- Voting\n- Likes/dislikes\n- Following external links\n- Forwarding a user to a chat/channel\n## @PrimeBot\nWe are beta testing bots in TamTam now. To become a beta tester, please, contact us on **[@support](https://tt.me/support)** or [team@tamtam.chat](mailto:team@tamtam.chat). We'll give you access to [PrimeBot](https://tt.me/primebot), all TamTam bots creator. It will help you choose a unique short name for a bot and fill in its full name and description. With PrimeBot you can create bots as well as edit and delete them and browse information on bots you have created.\n#### [PrimeBot](https://tt.me/primebot) commands:\n`/start` — start a dialog with a bot\n\n`/create` — create a bot, assign the unique short name to it (from 4 to 64 characters)\n\n`/set_name [name]` — assign a short or full name to the bot (up to 200 characters)\n\n`/set_description [description]` — enter the description for the bot profile (up to 400 characters)\n\n`/set_picture [URL]` — enter the URL of bot's picture\n\n`/delete [username]` — delete the bot\n\n`/list` — show the list of all bots\n\n`/get_token` — obtain a token for a bot\n\n`/revoke` — request a new token\n\n`/help` — help\n\n## HTTP verbs\n`GET` — getting resources, parameters are transmitted via URL\n\n`POST` — creation of resources (for example, sending new messages)\n\n`PUT` — editing resources\n\n`DELETE` — deleting resources\n`PATCH` — patching resources\n## HTTP response codes\n`200` — successful operation\n\n`400` — invalid request\n\n`401` — authentication error\n\n`404` — resource not found\n\n`405` — method not allowed\n\n`429` — the number of requests is exceeded\n\n`503` — service unavailable\n\n## Resources format\nFor content requests (PUT and POST) and responses, the API uses the JSON format.\nAll strings are UTF-8 encoded.\nDate/time fields are represented as the number of milliseconds that have elapsed since 00:00 January 1, 1970 in the long format. To get it, you can simply multiply the UNIX timestamp by 1000. All date/time fields have a UTC timezone.\n## Error responses\nIn case of an error, the API returns a response with the corresponding HTTP code and JSON with the following fields:\n\n\n`code` - the string with the error key \n\n`message` - a string describing the error \nFor example:\n```bash\n> http https://botapi.tamtam.chat/chats?access_token={EXAMPLE_TOKEN}\nHTTP / 1.1 403 Forbidden\nCache-Control: no-cache\nConnection: Keep-Alive\nContent-Length: 57\nContent-Type: application / json; charset = utf-8\nSet-Cookie: web_ui_lang = ru; Path = /; Domain = .tamtam.chat; Expires = 2019-03-24T11: 45: 36.500Z\n{\n \"code\": \"verify.token\",\n \"message\": \"Invalid access_token\"\n}\n```\n## Receiving Notifications\nTamTam Bot API supports 2 options of receiving notifications on new dialog events for bots:\n- Push notifications via WebHook. To receive data via WebHook, you'll have to [add subscription](https://dev.tamtam.chat/#operation/subscribe);\n- Notifications upon request via [long polling](#operation/getUpdates) API.\nAll data can be received via long polling **by default** after creating the bot,\n\nBoth methods **cannot** be used simultaneously.\nRefer to the response schema of [/updates](https://dev.tamtam.chat/#operation/getUpdates) method to check all available types of updates.\n## Message buttons\nYou can program buttons for users answering a bot.\nTamTam supports the following types of buttons: \n\n`callback` — sends a notification to a bot (via WebHook or long polling) \n\n`link` — makes a user to follow a link \n\n`request_contact` — requests the user permission to access contact information (phone number, short link, email) \n\nYou may also send a message with an [InlineKeyboard]() type attachment to start creating buttons. When the user presses a button, the bot receives the answer with filled callback field. It is recommended to edit that message so the user can receive updated buttons.\n# Versioning\nAPI models and interface may change over time. To make sure your bot will get the right info, we strongly recommend adding API version number to each request. You can add it as `v` parameter to each HTTP-request. For instance, `v=0.1.2`.\nTo specify the data model version you are getting through WebHook subscription, use the `version` property in the request body of the [subscribe](https://dev.tamtam.chat/#operation/subscribe) request.\n# Libraries\nWe have created [Java library](https://github.com/tamtam-chat/tamtam-bot-api) to make using API easier.\n# Changelog\n##### Version 0.1.5\n- Added `id` property to media attachments (`VideoAttachment`, `AudioAttachment`) so you can reuse attachment from one message in another\n- Added ability to create *linked* message: replied or forwarded. See `link` in `NewMessageBody`\n- `intent` property marked as required only for `CallbackButton`\n\n##### Version 0.1.4\n\n- Added `user_ids` parameter to [get members](#operation/getMembers) in chat by id\n- `attachment` property of [send message](#operation/sendMessage) request body marked as deprecated\n\n##### Version 0.1.3\n- Added method to [delete](https://dev.tamtam.chat/#operation/deleteMessages) messages\n- Added ability to [get](https://dev.tamtam.chat/#operation/getMessages) particular messages by ID\n- Added `is_admin` flag to `ChatMember`\n- Added `message` property to `MessageCallbackUpdate`\n- Renamed property `message` to `body` for `Message` schema\n- Added reusable `token` to `PhotoAttachment`. It allows to attach the same photo more than once."
+ },
+ "servers": [
+ {
+ "url": "https://botapi.tamtam.chat"
+ }
+ ],
+ "security": [
+ {
+ "access_token": []
+ }
+ ],
+ "x-tagGroups": [
+ {
+ "name": "Methods",
+ "tags": [
+ "bots",
+ "chats",
+ "messages",
+ "subscriptions",
+ "upload"
+ ]
+ }
+ ],
+ "paths": {
+ "/me": {
+ "get": {
"tags": [
- "bots",
- "chats",
- "messages",
- "subscriptions",
- "upload"
- ]
- }],
- "paths": {
- "/me": {
- "get": {
- "tags": ["bots"],
- "summary": "Get current bot info",
- "operationId": "getMyInfo",
- "description": "Returns info about current bot. Current bot can be identified by access token. Method returns bot identifier, name and avatar (if any).",
- "responses": {
- "200": {
- "description": "Expected response to a valid request",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/User"
- }
- }
- }
- },
- "500": {
- "$ref": "#/components/responses/InternalError"
- },
- "401": {
- "$ref": "#/components/responses/Unauthorized"
- }
- }
- }
- },
- "/chats": {
- "get": {
- "tags": [
- "chats"
- ],
- "operationId": "getChats",
- "description": "Returns information about chats that bot participated in: a result list and marker points to the next page.",
- "summary": "Get all chats",
- "parameters": [
- {
- "description": "Number of chats requested",
- "name": "count",
- "in": "query",
- "schema": {
- "type": "integer",
- "format": "int32",
- "minimum": 1,
- "maximum": 100,
- "default": "50"
- }
- },
- {
- "description": "Points to next data page. `null` for the first page",
- "name": "marker",
- "in": "query",
- "schema": {
- "$ref": "#/components/schemas/bigint"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Returns paginated response of chats",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ChatList"
- }
- }
- }
- },
- "500": {
- "$ref": "#/components/responses/InternalError"
- },
- "401": {
- "$ref": "#/components/responses/Unauthorized"
- }
- }
- }
- },
- "/chats/{chatId}": {
- "get": {
- "tags": [
- "chats"
- ],
- "operationId": "getChat",
- "description": "Returns info about chat.",
- "summary": "Get chat",
- "parameters": [
- {
- "name": "chatId",
- "description": "Requested chat identifier",
- "required": true,
- "in": "path",
- "schema": {
- "type": "integer",
- "format": "int64",
- "pattern": "\\-?\\d+"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Chat information",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Chat"
- }
- }
- }
- },
- "500": {
- "$ref": "#/components/responses/InternalError"
- },
- "401": {
- "$ref": "#/components/responses/Unauthorized"
- }
- }
- }
- },
- "/chats/{chatId}/action": {
- "post": {
- "tags": [
- "chats"
- ],
- "operationId": "sendAction",
- "description": "Send bot action to chat",
- "summary": "Send action",
- "parameters": [
- {
- "name": "chatId",
- "description": "Chat identifier",
- "required": true,
- "in": "path",
- "schema": {
- "type": "integer",
- "format": "int64",
- "pattern": "\\-?\\d+"
- }
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ActionRequestBody"
- }
- }
- }
- },
- "responses": {
- "200": {
- "$ref": "#/components/responses/SuccessResponse"
- },
- "500": {
- "$ref": "#/components/responses/InternalError"
- },
- "401": {
- "$ref": "#/components/responses/Unauthorized"
- }
- }
- }
- },
- "/chats/{chatId}/control": {
- "post": {
- "tags": [
- "chats"
- ],
- "operationId": "sendControl",
- "description": "Send control message to chat",
- "summary": "Control chat",
- "parameters": [
- {
- "name": "chatId",
- "description": "Chat identifier",
- "required": true,
- "in": "path",
- "schema": {
- "type": "integer",
- "format": "int64",
- "pattern": "\\-?\\d+"
- }
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ChatControl"
- }
- }
- }
- },
- "responses": {
- "200": {
- "$ref": "#/components/responses/SuccessResponse"
- },
- "500": {
- "$ref": "#/components/responses/InternalError"
- },
- "401": {
- "$ref": "#/components/responses/Unauthorized"
- }
- }
- }
- },
- "/subscriptions": {
- "get": {
- "tags": [
- "subscriptions"
- ],
- "operationId": "getSubscriptions",
- "description": "In case your bot gets data via WebHook, the method returns list of all subscriptions.",
- "summary": "Get subscriptions",
- "responses": {
- "200": {
- "description": "As expected",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/GetSubscriptionsResult"
- }
- }
- }
- },
- "500": {
- "$ref": "#/components/responses/InternalError"
- },
- "401": {
- "$ref": "#/components/responses/Unauthorized"
- }
- }
- },
- "post": {
- "tags": [
- "subscriptions"
- ],
- "operationId": "subscribe",
- "description": "Subscribes bot to receive updates via WebHook. After calling this method, the bot will receive notifications about new events in chat rooms at the specified URL",
- "summary": "Subscribe",
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/SubscriptionRequestBody"
- }
- }
- }
- },
- "responses": {
- "200": {
- "$ref": "#/components/responses/SuccessResponse"
- },
- "500": {
- "$ref": "#/components/responses/InternalError"
- },
- "401": {
- "$ref": "#/components/responses/Unauthorized"
- }
- }
- },
- "delete": {
- "tags": [
- "subscriptions"
- ],
- "operationId": "unsubscribe",
- "description": "Unsubscribes bot from receiving updates via WebHook. After calling the method, the bot stops receiving notifications about new events. Notification via the long-poll API becomes available for the bot",
- "summary": "Unsubscribe",
- "parameters": [
- {
- "name": "url",
- "in": "query",
- "description": "URL to remove from WebHook subscriptions",
- "required": true,
- "schema": {
- "type": "string"
- }
- }
- ],
- "responses": {
- "200": {
- "$ref": "#/components/responses/SuccessResponse"
- },
- "500": {
- "$ref": "#/components/responses/InternalError"
- },
- "401": {
- "$ref": "#/components/responses/Unauthorized"
- }
- }
- }
- },
- "/uploads": {
- "post": {
- "tags": [
- "upload"
- ],
- "operationId": "getUploadUrl",
- "description": "Returns the URL for the subsequent file upload.\n\nFor example, you can upload it via curl:\n```\ncurl -i -X POST \n -H \"Content-Type: multipart/form-data\" \n -F \"data=@movie.mp4\" \"%UPLOAD_URL%\"\n```\n\nTwo types of an upload are supported: \n- single request upload (multipart request)\n- and resumable upload.\n \n##### Multipart upload\n\nThis type of upload is a simpler one but it is less reliable and agile. If a `Content-Type`: multipart/form-data header is passed in a request our service indicates upload type as a simple single request upload. \nThis type of an upload has some restrictions: \n- Max. file size - 2 Gb\u2028\n- Only one file per request can be uploaded\n- No possibility to restart stopped / failed upload\n\n##### Resumable upload\nIf `Content-Type` header value is not equal to `multipart/form-data` our service indicated upload type as a resumable upload.\nWith a `Content-Range` header current file chunk range and complete file size can be passed. If a network error has happened or upload was stopped you can continue to upload a file from the last successfully uploaded file chunk. You can request the last known byte of uploaded file from server and continue to upload a file. \n\n##### Get upload status\nTo GET an upload status you simply need to perform HTTP-GET request to a file upload URL. Our service will respond with current upload status, complete file size and last known uploaded byte. This data can be used to complete stopped upload if something went wrong. If `REQUESTED_RANGE_NOT_SATISFIABLE` or `INTERNAL_SERVER_ERROR` status was returned it is a good point to try to restart an upload",
- "summary": "Get upload URL",
- "parameters": [
- {
- "description": "Uploaded file type: photo, audio, video, file",
- "name": "type",
- "required": true,
- "in": "query",
- "schema": {
- "$ref": "#/components/schemas/UploadType"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Returns URL to upload attachment",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/UploadEndpoint"
- }
- }
- }
- },
- "500": {
- "$ref": "#/components/responses/InternalError"
- },
- "401": {
- "$ref": "#/components/responses/Unauthorized"
- }
- }
- }
- },
- "/messages": {
- "get": {
- "tags": [
- "messages"
- ],
- "operationId": "getMessages",
- "description": "Returns messages in chat: result page and marker referencing to the next page",
- "summary": "Get messages",
- "parameters": [
- {
- "description": "Chat identifier",
- "name": "chat_id",
- "required": true,
- "in": "query",
- "schema": {
- "$ref": "#/components/schemas/bigint"
- }
- },
- {
- "name": "from",
- "description": "Start time for requested messages",
- "in": "query",
- "schema": {
- "$ref": "#/components/schemas/bigint"
- }
- },
- {
- "name": "to",
- "description": "End time for requested messages",
- "in": "query",
- "schema": {
- "$ref": "#/components/schemas/bigint"
- }
- },
- {
- "name": "count",
- "description": "Maximum amount of messages in response",
- "in": "query",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 50,
- "minimum": 1,
- "maximum": 100
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Returns list of messages",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/MessageList"
- }
- }
- }
- },
- "403": {
- "description": "This exception happens when user suspended bot or it doesn't have access to chat",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "500": {
- "$ref": "#/components/responses/InternalError"
- },
- "401": {
- "$ref": "#/components/responses/Unauthorized"
- }
- }
- },
- "post": {
- "tags": [
- "messages"
- ],
- "operationId": "sendMessage",
- "description": "Sends a message to a chat. As a result for this method new message identifier returns.",
- "summary": "Send message",
- "parameters": [
- {
- "name": "user_id",
- "description": "Fill this paramter if you want to send message to user",
- "in": "query",
- "required": false,
- "schema": {
- "type": "integer",
- "format": "int64"
- }
- },
- {
- "name": "chat_id",
- "description": "Fill this if you send message to chat",
- "schema": {
- "type": "integer",
- "format": "int64"
- },
- "in": "query",
- "required": false
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/NewMessageBody"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Returns info about created message",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/SendMessageResult"
- }
- }
- }
- },
- "500": {
- "$ref": "#/components/responses/InternalError"
- },
- "401": {
- "$ref": "#/components/responses/Unauthorized"
- }
- }
- },
- "put": {
- "tags": [
- "messages"
- ],
- "operationId": "editMessage",
- "description": "Updated message should be sent as `NewMessage` in a request body. In case `attachments` field is `null`, the current message attachments won’t be changed. In case of sending an empty list in this field, all attachments will be deleted.",
- "summary": "Edit message",
- "parameters": [
- {
- "name": "message_id",
- "description": "Editing message identifier",
- "required": true,
- "in": "query",
- "schema": {
- "$ref": "#/components/schemas/bigint"
- }
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/NewMessageBody"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Returns info about created message",
- "$ref": "#/components/responses/SuccessResponse"
- },
- "500": {
- "$ref": "#/components/responses/InternalError"
- },
- "401": {
- "$ref": "#/components/responses/Unauthorized"
- }
- }
- }
- },
- "/answers": {
- "post": {
- "tags": [
- "messages"
- ],
- "operationId": "answerOnCallback",
- "description": "This method should be called to send an answer after a user has clicked the button. The answer may be an updated message or a one-time user notification.",
- "summary": "Answer on callback",
- "parameters": [
- {
- "name": "callback_id",
- "description": "Identifies a button clicked by user. Bot receives this identifier after user pressed button as part of `MessageCallbackUpdate`",
- "required": true,
- "in": "query",
- "schema": {
- "type": "string"
- }
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/CallbackAnswer"
- }
- }
- }
- },
- "responses": {
- "200": {
- "$ref": "#/components/responses/SuccessResponse"
- },
- "500": {
- "$ref": "#/components/responses/InternalError"
- },
- "405": {
- "$ref": "#/components/responses/NotAllowed"
- },
- "401": {
- "$ref": "#/components/responses/Unauthorized"
- }
- }
- }
- },
- "/updates": {
- "get": {
- "operationId": "getUpdates",
- "tags": ["subscriptions"],
- "description": "You can use this method for getting updates in case your bot is not subscribed to WebHook. The method based on long polling.",
- "summary": "Get updates",
- "parameters": [
- {
- "name": "limit",
- "description": "Maximim number of updates to be retrieved.",
- "in": "query",
- "schema": {
- "type": "integer",
- "minimum": 0,
- "maximum": 1000,
- "default": 100
- }
- },
- {
- "name": "timeout",
- "description": "Timeout in seconds for long polling.",
- "in": "query",
- "schema": {
- "type": "integer",
- "minimum": 0,
- "maximum": 90,
- "default": 30
- }
- }
- ],
- "responses": {
- "200": {
- "description": "List of updates",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/UpdateList"
- }
- }
- }
- },
- "500": {
- "$ref": "#/components/responses/InternalError"
- },
- "405": {
- "$ref": "#/components/responses/NotAllowed"
- },
- "401": {
- "$ref": "#/components/responses/Unauthorized"
- }
+ "bots"
+ ],
+ "summary": "Get current bot info",
+ "operationId": "getMyInfo",
+ "description": "Returns info about current bot. Current bot can be identified by access token. Method returns bot identifier, name and avatar (if any).",
+ "responses": {
+ "200": {
+ "description": "Bot info",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/BotInfo"
}
+ }
}
+ },
+ "500": {
+ "$ref": "#/components/responses/InternalError"
+ },
+ "401": {
+ "$ref": "#/components/responses/Unauthorized"
+ }
}
- },
- "components": {
- "securitySchemes": {
- "api_key": {
- "type": "apiKey",
- "name": "access_token",
- "description": "Bot API token. Get it using https://tt.me/PrimeBot",
- "in": "query"
+ },
+ "patch": {
+ "tags": [
+ "bots"
+ ],
+ "summary": "Edit current bot info",
+ "operationId": "editMyInfo",
+ "description": "Edits current bot info. Fill only the fields you want to update. All remaning fields will stay untouched.",
+ "responses": {
+ "200": {
+ "description": "Modified bot info",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/BotInfo"
+ }
+ }
}
+ },
+ "500": {
+ "$ref": "#/components/responses/InternalError"
+ },
+ "401": {
+ "$ref": "#/components/responses/Unauthorized"
+ }
+ },
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/BotPatch"
+ }
+ }
+ }
+ }
+ }
+ },
+ "/chats": {
+ "get": {
+ "tags": [
+ "chats"
+ ],
+ "operationId": "getChats",
+ "description": "Returns information about chats that bot participated in: a result list and marker points to the next page.",
+ "summary": "Get all chats",
+ "parameters": [
+ {
+ "description": "Number of chats requested",
+ "name": "count",
+ "in": "query",
+ "schema": {
+ "type": "integer",
+ "format": "int32",
+ "minimum": 1,
+ "maximum": 100,
+ "default": "50"
+ }
+ },
+ {
+ "description": "Points to next data page. `null` for the first page",
+ "name": "marker",
+ "in": "query",
+ "schema": {
+ "$ref": "#/components/schemas/bigint"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Returns paginated response of chats",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ChatList"
+ }
+ }
+ }
+ },
+ "500": {
+ "$ref": "#/components/responses/InternalError"
+ },
+ "401": {
+ "$ref": "#/components/responses/Unauthorized"
+ }
+ }
+ }
+ },
+ "/chats/{chatId}": {
+ "get": {
+ "tags": [
+ "chats"
+ ],
+ "x-opGroup": "chat",
+ "operationId": "getChat",
+ "description": "Returns info about chat.",
+ "summary": "Get chat",
+ "parameters": [
+ {
+ "name": "chatId",
+ "description": "Requested chat identifier",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "integer",
+ "format": "int64",
+ "pattern": "\\-?\\d+"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Chat information",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Chat"
+ }
+ }
+ }
+ },
+ "500": {
+ "$ref": "#/components/responses/InternalError"
+ },
+ "401": {
+ "$ref": "#/components/responses/Unauthorized"
+ }
+ }
+ },
+ "patch": {
+ "tags": [
+ "chats"
+ ],
+ "x-opGroup": "chat",
+ "operationId": "editChat",
+ "description": "Edits chat info: title, icon, etc…",
+ "summary": "Edit chat info",
+ "parameters": [
+ {
+ "name": "chatId",
+ "description": "Chat identifier",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "integer",
+ "format": "int64",
+ "pattern": "\\-?\\d+"
+ }
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ChatPatch"
+ }
+ }
+ }
},
"responses": {
- "SuccessResponse": {
- "description": "Success or not result",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/SimpleQueryResult"
- }
- }
- }
- },
- "InternalError": {
- "description": "Internal Server Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "Unauthorized": {
- "description": "Authorization Error. No `access_token` provided or token is invalid",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "NotAllowed": {
- "description": "Method not allowed",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
+ "200": {
+ "description": "If success, returns updated chat object",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Chat"
}
+ }
}
+ },
+ "500": {
+ "$ref": "#/components/responses/InternalError"
+ },
+ "401": {
+ "$ref": "#/components/responses/Unauthorized"
+ },
+ "403": {
+ "$ref": "#/components/responses/Forbidden"
+ }
+ }
+ }
+ },
+ "/chats/{chatId}/actions": {
+ "post": {
+ "tags": [
+ "chats"
+ ],
+ "operationId": "sendAction",
+ "description": "Send bot action to chat",
+ "summary": "Send action",
+ "parameters": [
+ {
+ "name": "chatId",
+ "description": "Chat identifier",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "integer",
+ "format": "int64",
+ "pattern": "\\-?\\d+"
+ }
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ActionRequestBody"
+ }
+ }
+ }
},
- "schemas": {
- "bigint": {
+ "responses": {
+ "200": {
+ "$ref": "#/components/responses/SuccessResponse"
+ },
+ "500": {
+ "$ref": "#/components/responses/InternalError"
+ },
+ "401": {
+ "$ref": "#/components/responses/Unauthorized"
+ }
+ }
+ }
+ },
+ "/chats/{chatId}/members/me": {
+ "get": {
+ "tags": [
+ "chats"
+ ],
+ "x-opGroup": "myMemberhip",
+ "operationId": "getMembership",
+ "summary": "Get chat membership",
+ "description": "Returns chat membership info for current bot",
+ "parameters": [
+ {
+ "name": "chatId",
+ "description": "Chat identifier",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "integer",
+ "format": "int64",
+ "pattern": "\\-?\\d+"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Current bot membership info",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ChatMember"
+ }
+ }
+ }
+ },
+ "500": {
+ "$ref": "#/components/responses/InternalError"
+ },
+ "401": {
+ "$ref": "#/components/responses/Unauthorized"
+ },
+ "403": {
+ "$ref": "#/components/responses/Forbidden"
+ },
+ "404": {
+ "$ref": "#/components/responses/NotFound"
+ }
+ }
+ },
+ "delete": {
+ "tags": [
+ "chats"
+ ],
+ "operationId": "leaveChat",
+ "x-opGroup": "myMemberhip",
+ "summary": "Leave chat",
+ "description": "Removes bot from chat members.",
+ "parameters": [
+ {
+ "name": "chatId",
+ "description": "Chat identifier",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "integer",
+ "format": "int64",
+ "pattern": "\\-?\\d+"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/components/responses/SuccessResponse"
+ },
+ "500": {
+ "$ref": "#/components/responses/InternalError"
+ },
+ "401": {
+ "$ref": "#/components/responses/Unauthorized"
+ },
+ "403": {
+ "$ref": "#/components/responses/Forbidden"
+ },
+ "404": {
+ "$ref": "#/components/responses/NotFound"
+ }
+ }
+ }
+ },
+ "/chats/{chatId}/members": {
+ "get": {
+ "tags": [
+ "chats"
+ ],
+ "operationId": "getMembers",
+ "summary": "Get members",
+ "description": "Returns users participated in chat.",
+ "parameters": [
+ {
+ "name": "chatId",
+ "description": "Chat identifier",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "integer",
+ "format": "int64",
+ "pattern": "\\-?\\d+"
+ }
+ },
+ {
+ "name": "user_ids",
+ "description": "*Since* version [0.1.4](#section/About/Changelog).\n\nComma-separated list of users identifiers to get their membership. When this parameter is passed, both `count` and `marker` are ignored.",
+ "required": false,
+ "in": "query",
+ "schema": {
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
"type": "integer",
"format": "int64"
- },
- "User": {
- "properties": {
- "user_id": {
- "description": "Users identifier",
- "type": "integer",
- "format": "int64"
- },
- "name": {
- "description": "Users visible name",
- "type": "string"
- },
- "username": {
- "description": "Unique public user name. Can be `null` if user is not accessible or it is not set",
- "type": "string",
- "nullable": true
- }
- },
- "required": [
- "user_id",
- "name",
- "username"
- ]
- },
- "UserWithPhoto": {
- "allOf": [
- {
- "$ref": "#/components/schemas/User"
- },
- {
- "properties": {
- "avatar_url": {
- "description": "URL of avatar",
- "type": "string"
- },
- "full_avatar_url": {
- "description": "URL of avatar of a bigger size",
- "type": "string"
- }
- },
- "required": [
- "avatar_url",
- "full_avatar_url"
- ]
- }
- ]
- },
- "Chat": {
- "properties": {
- "chat_id": {
- "description": "Chats identifier",
- "type": "integer",
- "format": "int64"
- },
- "type": {
- "description": "Type of chat. One of: dialog, chat, channel",
- "allOf": [
- {
- "$ref": "#/components/schemas/ChatType"
- }
- ]
- },
- "status": {
- "description": "Status of chat. One of: ACTIVE, REMOVED, LEFT of CLOSED",
- "allOf": [
- {
- "$ref": "#/components/schemas/ChatStatus"
- }
- ]
- },
- "title": {
- "description": "Visible title of chat",
- "type": "string"
- },
- "icon": {
- "description": "Icon of chat",
- "nullable": true,
- "allOf": [
- {
- "$ref": "#/components/schemas/Image"
- }
- ]
- },
- "last_event_time": {
- "description": "Time of last event occured in chat",
- "type": "integer",
- "format": "int64"
- },
- "participants_count": {
- "description": "Number of people in chat. Always 2 for `dialog` chat type",
- "type": "integer",
- "format": "int32"
- },
- "owner_id": {
- "description": "Identifier of chat owner. Visible only for chat admins",
- "nullable": true,
- "type": "integer",
- "format": "int64",
- "readOnly": false
- },
- "participants": {
- "description": "Participants in chat with time of last activity. Visible only for chat admins",
- "nullable": true,
- "readOnly": false,
- "type": "object",
- "additionalProperties": {
- "type": "integer",
- "format": "int64"
- }
- }
- },
- "required": [
- "chat_id",
- "type",
- "status",
- "title",
- "last_event_time",
- "participants_count",
- "icon"
- ]
- },
- "ChatType": {
- "description": "Type of chat. Dialog (one-on-one), chat or channel",
- "enum": [
- "dialog",
- "chat",
- "channel"
- ]
- },
- "ChatStatus": {
- "description": "Chat status for current bot",
- "enum": [
- "ACTIVE",
- "REMOVED",
- "LEFT",
- "CLOSED"
- ]
- },
- "ChatList": {
- "properties": {
- "chats": {
- "description": "List of requested chats",
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Chat"
- }
- },
- "marker": {
- "description": "Reference to the next page of requested chats",
- "nullable": true,
- "type": "integer",
- "format": "int64"
- }
- },
- "required": [
- "chats",
- "marker"
- ]
- },
- "Image": {
- "description": "Generic schema describing image object",
- "properties": {
- "url": {
- "description": "URL of image",
- "type": "string"
- }
- },
- "required": [
- "url"
- ]
- },
- "Subscription": {
- "description": "Schema to describe WebHook subscription",
- "properties": {
- "url": {
- "description": "WebHook URL",
- "type": "string"
- },
- "time": {
- "description": "Unix-time when subscription was created",
- "type": "integer",
- "format": "int64"
- }
- },
- "required": [
- "url",
- "time"
- ]
- },
- "Recipient": {
- "description": "New message recepient. Could be user or chat",
- "properties": {
- "chat_id": {
- "description": "User identifier",
- "type": "integer",
- "format": "int64",
- "nullable": true
- },
- "user_id": {
- "description": "Chat identifier",
- "type": "integer",
- "format": "int64",
- "nullable": true
- }
- },
- "required": [
- "chat_id",
- "user_id"
- ]
- },
- "Message": {
- "description": "Message in chat",
- "properties": {
- "sender": {
- "description": "User that sent this message",
- "allOf": [
- {
- "$ref": "#/components/schemas/User"
- }
- ]
- },
- "recipient": {
- "description": "Message recipient. Could be user or chat",
- "allOf": [
- {
- "$ref": "#/components/schemas/Recipient"
- }
- ]
- },
- "timestamp": {
- "description": "Unix-time when message was created",
- "type": "integer",
- "format": "int64"
- },
- "message": {
- "description": "Body of created message. Text+attachments.",
- "allOf": [
- {
- "$ref": "#/components/schemas/MessageBody"
- }
- ]
- }
- },
- "required": [
- "sender",
- "recipient",
- "message",
- "timestamp"
- ]
- },
- "MessageBody": {
- "description": "Schema representing body of message",
- "type": "object",
- "properties": {
- "mid": {
- "description": "Unique identifier of message",
- "type": "string"
- },
- "seq": {
- "description": "Sequence identifier of message in chat",
- "type": "integer",
- "format": "int64"
- },
- "text": {
- "description": "Message text",
- "type": "string",
- "nullable": true
- },
- "attachments": {
- "description": "Message attachments. Could be one of `Attachment` type. See description of this schema",
- "type": "array",
- "nullable": true,
- "items": {
- "$ref": "#/components/schemas/Attachment"
- }
- },
- "link": {
- "description": "Forwarder or replied message",
- "nullable": true,
- "allOf": [
- {
- "$ref": "#/components/schemas/LinkedMessage"
- }
- ]
- },
- "reply_to": {
- "deprecated": true,
- "description": "In case this message is repled to, it is the unique identifier of the replied message",
- "type": "string",
- "nullable": true,
- "readOnly": false
- }
- },
- "required": [
- "mid",
- "seq",
- "text",
- "attachments",
- "link"
- ]
- },
- "MessageList": {
- "description": "Paginated list of messages",
- "properties": {
- "messages": {
- "description": "List of messages",
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Message"
- }
- }
- },
- "required": [
- "messages"
- ]
- },
- "NewMessage": {
- "description": "New message. Could be `control`, `sender_action` or real `message`",
- "properties": {
- "recipient": {
- "description": "Message recipient. User or chat",
- "allOf": [
- {
- "$ref": "#/components/schemas/Recipient"
- }
- ]
- },
- "sender_action": {
- "description": "Action to send to chat. For example: `typing` or `sending photo`. See `SenderAction` for full information",
- "nullable": true,
- "readOnly": false,
- "allOf": [
- {
- "$ref": "#/components/schemas/SenderAction"
- }
- ]
- },
- "chat_control": {
- "description": "Control message to chat. For example: to set icon or title of chat. See `ChatControl` description for full information",
- "nullable": true,
- "readOnly": false,
- "allOf": [
- {
- "$ref": "#/components/schemas/ChatControl"
- }
- ]
- },
- "message": {
- "description": "Real message to send to chat",
- "nullable": true,
- "readOnly": false,
- "allOf": [
- {
- "$ref": "#/components/schemas/NewMessageBody"
- }
- ]
- }
- },
- "required": [
- "recipient"
- ]
- },
- "NewMessageBody": {
- "properties": {
- "text": {
- "description": "Message text",
- "type": "string",
- "nullable": true
- },
- "attachment": {
- "description": "Single message attachment.",
- "type": "object",
- "nullable": true,
- "readOnly": false,
- "allOf": [
- {
- "$ref": "#/components/schemas/AttachmentRequest"
- }
- ]
- },
- "attachments": {
- "description": "Message attachments. See `AttachmentRequest` and it's inheritors for full information.",
- "type": "array",
- "nullable": true,
- "items": {
- "$ref": "#/components/schemas/AttachmentRequest"
- }
- },
- "notify": {
- "description": "If false, chat participants wouldn't be notified",
- "type": "boolean",
- "default": true,
- "readOnly": false
- }
- },
- "required": [
- "text",
- "attachments"
- ]
- },
- "LinkedMessage": {
- "properties": {
- "type": {
- "description": "Type of linked message",
- "allOf": [
- {
- "$ref": "#/components/schemas/MessageLinkType"
- }
- ]
- },
- "message": {
- "allOf": [
- {
- "$ref": "#/components/schemas/Message"
- }
- ]
- }
- },
- "required": [
- "type",
- "message"
- ]
- },
- "SendMessageResult": {
- "properties": {
- "chat_id": {
- "description": "Identifier of chat message was created in",
- "type": "integer",
- "format": "int64"
- },
- "recipient_id": {
- "description": "In most cases same as chat_id.",
- "nullable": true,
- "type": "integer",
- "format": "int64"
- },
- "message_id": {
- "description": "Unique identifier of created message",
- "type": "string"
- }
- },
- "required": [
- "chat_id",
- "recipient_id",
- "message_id"
- ]
- },
- "Attachment": {
- "description": "Generic schema representing message attachment",
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "image": "#/components/schemas/PhotoAttachment",
- "video": "#/components/schemas/VideoAttachment",
- "audio": "#/components/schemas/AudioAttachment",
- "file": "#/components/schemas/FileAttachment",
- "sticker": "#/components/schemas/StickerAttachment",
- "contact": "#/components/schemas/ContactAttachment",
- "inline_keyboard": "#/components/schemas/InlineKeyboardAttachment",
- "share": "#/components/schemas/ShareAttachment"
- }
- },
- "properties": {
- "type": {
- "type": "string"
- }
- }
- },
- "PhotoAttachment": {
- "description": "Image attachment",
- "allOf": [
- {
- "$ref": "#/components/schemas/Attachment"
- },
- {
- "properties": {
- "payload": {
- "type": "object",
- "allOf": [
- {
- "$ref": "#/components/schemas/PhotoAttachmentPayload"
- }
- ]
- }
- },
- "required": [
- "payload"
- ]
- }
- ]
- },
- "PhotoAttachmentPayload": {
- "properties": {
- "photo_id": {
- "description": "Unique identifier of this image",
- "type": "integer",
- "format": "int64"
- },
- "url": {
- "description": "Image URL",
- "type": "string"
- }
- },
- "required": [
- "photo_id",
- "url"
- ]
- },
- "VideoAttachment": {
- "allOf": [
- {
- "$ref": "#/components/schemas/Attachment"
- },
- {
- "properties": {
- "payload": {
- "type": "object",
- "allOf": [
- {
- "$ref": "#/components/schemas/AttachmentPayload"
- }
- ]
- }
- },
- "required": [
- "payload"
- ]
- }
- ]
- },
- "AudioAttachment": {
- "allOf": [
- {
- "$ref": "#/components/schemas/Attachment"
- },
- {
- "properties": {
- "payload": {
- "type": "object",
- "allOf": [
- {
- "$ref": "#/components/schemas/AttachmentPayload"
- }
- ]
- }
- },
- "required": [
- "payload"
- ]
- }
- ]
- },
- "FileAttachment": {
- "allOf": [
- {
- "$ref": "#/components/schemas/Attachment"
- },
- {
- "properties": {
- "payload": {
- "type": "object",
- "allOf": [
- {
- "$ref": "#/components/schemas/AttachmentPayload"
- }
- ]
- }
- },
- "required": [
- "payload"
- ]
- }
- ]
- },
- "AttachmentPayload": {
- "properties": {
- "url": {
- "description": "Media attachment URL",
- "type": "string"
- }
- },
- "required": [
- "url"
- ]
- },
- "ContactAttachment": {
- "allOf": [
- {
- "$ref": "#/components/schemas/Attachment"
- },
- {
- "properties": {
- "payload": {
- "type": "object",
- "allOf": [
- {
- "$ref": "#/components/schemas/ContactAttachmentPayload"
- }
- ]
- }
- },
- "required": [
- "payload"
- ]
- }
- ]
- },
- "ContactAttachmentPayload": {
- "properties": {
- "vcfInfo": {
- "description": "User info in VCF format",
- "nullable": true,
- "type": "string"
- },
- "tamInfo": {
- "description": "User info",
- "nullable": true,
- "allOf": [
- {
- "$ref": "#/components/schemas/User"
- }
- ]
- }
- },
- "required": [
- "vcfInfo",
- "tamInfo"
- ]
- },
- "StickerAttachment": {
- "allOf": [
- {
- "$ref": "#/components/schemas/Attachment"
- },
- {
- "properties": {
- "payload": {
- "type": "object",
- "allOf": [
- {
- "$ref": "#/components/schemas/AttachmentPayload"
- }
- ]
- }
- },
- "required": [
- "payload"
- ]
- }
- ]
- },
- "ShareAttachment": {
- "allOf": [
- {
- "$ref": "#/components/schemas/Attachment"
- },
- {
- "properties": {
- "payload": {
- "type": "object",
- "allOf": [
- {
- "$ref": "#/components/schemas/AttachmentPayload"
- }
- ]
- }
- },
- "required": [
- "payload"
- ]
- }
- ]
- },
- "InlineKeyboardAttachment": {
- "description": "Buttons in messages",
- "allOf": [
- {
- "$ref": "#/components/schemas/Attachment"
- },
- {
- "properties": {
- "callback_id": {
- "description": "Unique identifier of keyboard",
- "type": "string"
- },
- "payload": {
- "type": "object",
- "allOf": [
- {
- "$ref": "#/components/schemas/Keyboard"
- }
- ]
- }
- },
- "required": [
- "callback_id",
- "payload"
- ]
- }
- ]
- },
- "Keyboard": {
- "description": "Keyboard is two-dimension array of buttons",
- "properties": {
- "buttons": {
- "type": "array",
- "items": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Button"
- }
- }
- }
- },
- "required": [
- "buttons"
- ]
- },
- "Button": {
- "properties": {
- "type": {
- "type": "string"
- },
- "text": {
- "description": "Visible text of button",
- "type": "string"
- },
- "intent": {
- "description": "Intent of button. Affects clients representation.",
- "nullable": true,
- "default": "default",
- "allOf": [
- {
- "$ref": "#/components/schemas/Intent"
- }
- ]
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "callback": "#/components/schemas/CallbackButton",
- "link": "#/components/schemas/LinkButton",
- "request_geo_location": "#/components/schemas/RequestGeoLocationButton",
- "request_contact": "#/components/schemas/RequestContactButton"
- }
- },
- "required": [
- "text",
- "intent"
- ]
- },
- "CallbackButton": {
- "description": "After pressing this type of button client sends to server payload it contains",
- "allOf": [
- {
- "$ref": "#/components/schemas/Button"
- },
- {
- "type": "object",
- "properties": {
- "payload": {
- "description": "Button payload",
- "type": "string"
- }
- },
- "required": [
- "payload"
- ]
- }
- ]
- },
- "LinkButton": {
- "description": "After pressing this type of button user follows the link it contains",
- "allOf": [
- {
- "$ref": "#/components/schemas/Button"
- },
- {
- "properties": {
- "url": {
- "type": "string"
- }
- },
- "required": [
- "url"
- ]
- }
- ]
- },
- "RequestContactButton": {
- "description": "After pressing this type of button client sends new message with attachment of curent user contact",
- "allOf": [
- {
- "$ref": "#/components/schemas/Button"
- }
- ]
- },
- "RequestGeoLocationButton": {
- "description": "After pressing this type of button client sends new message with attachment of current user geo location",
- "allOf": [
- {
- "$ref": "#/components/schemas/Button"
- },
- {
- "properties": {
- }
- }
- ]
- },
- "Intent": {
- "description": "Intent of button",
- "type": "string",
- "enum": [
- "positive",
- "negative",
- "default"
- ]
- },
- "MessageLinkType": {
- "description": "Type of linked message",
- "type": "string",
- "enum": [
- "forward",
- "reply"
- ]
- },
- "AttachmentRequest": {
- "description": "Request to attach some data to message",
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "image": "#/components/schemas/PhotoAttachmentRequest",
- "video": "#/components/schemas/VideoAttachmentRequest",
- "audio": "#/components/schemas/AudioAttachmentRequest",
- "file": "#/components/schemas/FileAttachmentRequest",
- "sticker": "#/components/schemas/StickerAttachmentRequest",
- "contact": "#/components/schemas/ContactAttachmentRequest",
- "inline_keyboard": "#/components/schemas/InlineKeyboardAttachmentRequest"
- }
- },
- "properties": {
- "type": {
- "type": "string"
- }
- }
- },
- "PhotoAttachmentRequest": {
- "allOf": [
- {
- "$ref": "#/components/schemas/AttachmentRequest"
- },
- {
- "type": "object",
- "properties": {
- "payload": {
- "allOf": [
- {
- "$ref": "#/components/schemas/PhotoAttachmentRequestPayload"
- }
- ]
- }
- },
- "required": [
- "payload"
- ]
- }
- ]
- },
- "PhotoAttachmentRequestPayload": {
- "description": "Request to attach image",
- "properties": {
- "url": {
- "description": "If specified, given URL will be attached to message as image",
- "nullable": true,
- "type": "string"
- },
- "photos": {
- "description": "Tokens were obtained after uploading images",
- "nullable": true,
- "type": "object",
- "additionalProperties": {
- "$ref": "#/components/schemas/PhotoToken"
- }
- }
- },
- "required": [
- "url",
- "photos"
- ]
- },
- "PhotoToken": {
- "properties": {
- "token": {
- "description": "Encoded information of uploaded image",
- "type": "string"
- }
- },
- "required": [
- "token"
- ]
- },
- "PhotoTokens": {
- "description": "This is information you will recieve as soon as an image uploaded",
- "properties": {
- "photos": {
- "type": "object",
- "additionalProperties": {
- "$ref": "#/components/schemas/PhotoToken"
- }
- }
- },
- "required": [
- "photos"
- ]
- },
- "VideoAttachmentRequest": {
- "description": "Request to attach video to message",
- "allOf": [
- {
- "$ref": "#/components/schemas/AttachmentRequest"
- },
- {
- "properties": {
- "payload": {
- "allOf": [
- {
- "$ref": "#/components/schemas/UploadedInfo"
- }
- ]
- }
- },
- "required": [
- "payload"
- ]
- }
- ]
- },
- "AudioAttachmentRequest": {
- "description": "Request to attach audio to message. MUST be the only attachment in message",
- "allOf": [
- {
- "$ref": "#/components/schemas/AttachmentRequest"
- },
- {
- "properties": {
- "payload": {
- "allOf": [
- {
- "$ref": "#/components/schemas/UploadedInfo"
- }
- ]
- }
- },
- "required": [
- "payload"
- ]
- }
- ]
- },
- "UploadedInfo": {
- "description": "This is information you will recieve as soon as audio/video is uploaded",
- "properties": {
- "id": {
- "type": "integer",
- "format": "int64"
- }
- },
- "required": [
- "id"
- ]
- },
- "FileAttachmentRequest": {
- "description": "Request to attach file to message. MUST be the only attachment in message",
- "allOf": [
- {
- "$ref": "#/components/schemas/AttachmentRequest"
- },
- {
- "properties": {
- "payload": {
- "allOf": [
- {
- "$ref": "#/components/schemas/UploadedFileInfo"
- }
- ]
- }
- },
- "required": [
- "payload"
- ]
- }
- ]
- },
- "UploadType": {
- "description": "Type of file uploading",
- "enum": [
- "photo",
- "video",
- "audio",
- "file"
- ]
- },
- "UploadedFileInfo": {
- "description": "This is information you will recieve as soon as a file is uploaded",
- "properties": {
- "fileId": {
- "description": "Unique file identifier",
- "type": "integer",
- "format": "int64"
- }
- },
- "required": [
- "fileId"
- ]
- },
- "ContactAttachmentRequest": {
- "description": "Request to attach contact card to message. MUST be the only attachment in message",
- "allOf": [
- {
- "$ref": "#/components/schemas/AttachmentRequest"
- },
- {
- "properties": {
- "payload": {
- "allOf": [
- {
- "$ref": "#/components/schemas/ContactAttachmentRequestPayload"
- }
- ]
- }
- },
- "required": [
- "payload"
- ]
- }
- ]
- },
- "ContactAttachmentRequestPayload": {
- "properties": {
- "name": {
- "description": "Contact name",
- "nullable": true,
- "type": "string"
- },
- "contactId": {
- "description": "Contact identifier",
- "nullable": true,
- "type": "integer",
- "format": "int64"
- },
- "vcfInfo": {
- "description": "Full information about contact in VCF format",
- "nullable": true,
- "type": "string"
- },
- "vcfPhone": {
- "description": "Contact phone in VCF format",
- "nullable": true,
- "type": "string"
- }
- },
- "required": [
- "name",
- "contactId",
- "vcfInfo",
- "vcfPhone"
- ]
- },
- "StickerAttachmentRequest": {
- "description": "Request to attach sticker. MUST be the only attachment request in message",
- "allOf": [
- {
- "$ref": "#/components/schemas/AttachmentRequest"
- },
- {
- "properties": {
- "payload": {
- "allOf": [
- {
- "$ref": "#/components/schemas/StickerAttachmentRequestPayload"
- }
- ]
- }
- },
- "required": [
- "payload"
- ]
- }
- ]
- },
- "StickerAttachmentRequestPayload": {
- "properties": {
- "code": {
- "description": "Sticker code",
- "type": "string"
- }
- },
- "required": [
- "code"
- ]
- },
- "InlineKeyboardAttachmentRequest": {
- "description": "Request to attach keyboard to message",
- "allOf": [
- {
- "$ref": "#/components/schemas/AttachmentRequest"
- },
- {
- "properties": {
- "payload": {
- "type": "object",
- "allOf": [
- {
- "$ref": "#/components/schemas/InlineKeyboardAttachmentRequestPayload"
- }
- ]
- }
- },
- "required": [
- "payload"
- ]
- }
- ]
- },
- "InlineKeyboardAttachmentRequestPayload": {
- "properties": {
- "buttons": {
- "description": "Two-dimensional array of buttons",
- "type": "array",
- "items": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Button"
- }
- }
- }
- },
- "required": [
- "buttons"
- ]
- },
- "SubscriptionRequestBody": {
- "description": "Request to set up WebHook subscription",
- "properties": {
- "url": {
- "description": "URL of HTTP(S)-endpoint of your bot",
- "type": "string"
- },
- "filter": {
- "type": "string",
- "readOnly": false
- }
- },
- "required": [
- "url"
- ]
- },
- "GetSubscriptionsResult": {
- "description": "List of all WebHook subscriptions",
- "properties": {
- "subscriptions": {
- "description": "Current suscriptions",
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Subscription"
- }
- }
- },
- "required": [
- "subscriptions"
- ]
- },
- "SimpleQueryResult": {
- "description": "Simple response to request",
- "properties": {
- "success": {
- "description": "`true` if request was successful. `false` otherwise",
- "type": "boolean"
- }
- },
- "required": [
- "success"
- ]
- },
- "Callback": {
- "description": "Object sent to bot when user presses button",
- "properties": {
- "timestamp": {
- "description": "Unix-time when user pressed the button",
- "type": "integer",
- "format": "int64"
- },
- "callback_id": {
- "description": "Current keyboard identifier",
- "type": "string"
- },
- "payload": {
- "description": "Button payload",
- "type": "string"
- },
- "user": {
- "description": "User pressed the button",
- "allOf": [
- {
- "$ref": "#/components/schemas/User"
- }
- ]
- }
- },
- "required": [
- "timestamp",
- "callback_id",
- "payload",
- "user"
- ]
- },
- "CallbackAnswer": {
- "description": "Send this object when your bot wants to react to when a button is pressed",
- "properties": {
- "user_id": {
- "type": "integer",
- "format": "int64",
- "readOnly": false
- },
- "message": {
- "description": "Fill this if you want to modify current message",
- "nullable": true,
- "readOnly": false,
- "allOf": [
- {
- "$ref": "#/components/schemas/NewMessageBody"
- }
- ]
- },
- "notification": {
- "description": "Fill this if you just want to send one-time notification to user",
- "nullable": true,
- "readOnly": false,
- "type": "string"
- }
- }
- },
- "Error": {
- "description": "Server returns this if there was an exception to your request",
- "properties": {
- "error": {
- "description": "Error",
- "type": "string"
- },
- "code": {
- "description": "Error code",
- "type": "string"
- },
- "message": {
- "description": "Human-readable description",
- "type": "string"
- }
- },
- "required": [
- "code",
- "message"
- ]
- },
- "UploadEndpoint": {
- "description": "Endpoint you should upload to your binaries",
- "type": "object",
- "properties": {
- "url": {
- "description": "URL to upload",
- "type": "string"
- }
- },
- "required": [
- "url"
- ]
- },
- "ChatControl": {
- "description": "Part of NewMessage if your want to control your chat",
- "properties": {
- "title": {
- "description": "Fill this if you want to change chat title",
- "type": "string",
- "readOnly": false
- },
- "icon": {
- "description": "Fill this if you want to change chat icon",
- "readOnly": false,
- "allOf": [
- {
- "$ref": "#/components/schemas/PhotoAttachmentRequest"
- }
- ]
- },
- "leave": {
- "description": "Fill this if you want to leave chat",
- "type": "string",
- "readOnly": false
- },
- "add_members": {
- "description": "Fill this if you want to add members to chat. Admin permissions required",
- "type": "array",
- "readOnly": false,
- "items": {
- "$ref": "#/components/schemas/ChatMember"
- }
- },
- "remove_member": {
- "description": "Fill this if you want to remove members from chat. Admin permissions required",
- "readOnly": false,
- "allOf": [
- {
- "$ref": "#/components/schemas/ChatMember"
- }
- ]
- }
- }
- },
- "ChatMember": {
- "description": "Describes member of chat",
- "properties": {
- "user_id": {
- "description": "User identifier",
- "type": "integer",
- "format": "int64"
- },
- "chat_id": {
- "description": "Identifier of chat user participated in",
- "type": "integer",
- "format": "int64"
- }
- },
- "required": [
- "user_id",
- "chat_id"
- ]
- },
- "ActionRequestBody": {
- "properties": {
- "action": {
- "$ref": "#/components/schemas/SenderAction"
- }
- },
- "required": [
- "action"
- ]
- },
- "SenderAction": {
- "description": "Different actions to send to chat members",
- "enum": [
- "typing_on",
- "typing_off",
- "sending_photo",
- "sending_video",
- "sending_audio",
- "mark_seen"
- ]
- },
- "UpdateList": {
- "description": "List of all updates in chats your bot participated in",
- "properties": {
- "updates": {
- "description": "Page of updates",
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Update"
- }
- }
- },
- "required": [
- "updates"
- ]
- },
- "Update": {
- "description": "`Update` object repsesents different types of events that happened in chat. See its inheritors",
- "discriminator": {
- "propertyName": "update_type",
- "mapping": {
- "message_created": "#/components/schemas/MessageCreatedUpdate",
- "message_callback": "#/components/schemas/MessageCallbackUpdate",
- "message_removed": "#/components/schemas/MessageRemovedUpdate",
- "message_restored": "#/components/schemas/MessageRestoredUpdate"
- }
- },
- "properties": {
- "update_type": {
- "type": "string"
- },
- "timestamp": {
- "description": "Unix-time when event occured",
- "type": "integer",
- "format": "int64"
- }
- },
- "required": [
- "timestamp"
- ]
- },
- "MessageCallbackUpdate": {
- "description": "You will get this `update` as soon as user presses button",
- "allOf": [
- {
- "$ref": "#/components/schemas/Update"
- },
- {
- "properties": {
- "callback": {
- "description": "",
- "allOf": [
- {
- "$ref": "#/components/schemas/Callback"
- }
- ]
- }
- },
- "required": [
- "callback"
- ]
- }
- ]
- },
- "MessageCreatedUpdate": {
- "description": "You will get this `update` as soon as message is created",
- "allOf": [
- {
- "$ref": "#/components/schemas/Update"
- },
- {
- "properties": {
- "message": {
- "description": "Newly created message",
- "allOf": [
- {
- "$ref": "#/components/schemas/Message"
- }
- ]
- }
- },
- "required": [
- "message"
- ]
- }
- ]
- },
- "MessageRemovedUpdate": {
- "description": "You will get this `update` as soon as message is removed",
- "allOf": [
- {
- "$ref": "#/components/schemas/Update"
- },
- {
- "properties": {
- "message_id": {
- "description": "Identifier of removed message",
- "type": "string"
- }
- },
- "required": [
- "message_id"
- ]
- }
- ]
- },
- "MessageRestoredUpdate": {
- "description": "You will get this `update` as soon as message is restored",
- "allOf": [
- {
- "$ref": "#/components/schemas/Update"
- },
- {
- "properties": {
- "message_id": {
- "description": "Restored message identifier",
- "type": "string"
- }
- },
- "required": [
- "message_id"
- ]
- }
- ]
+ },
+ "nullable": true
}
+ },
+ {
+ "name": "marker",
+ "description": "Marker",
+ "in": "query",
+ "schema": {
+ "type": "integer",
+ "format": "int64"
+ }
+ },
+ {
+ "name": "count",
+ "description": "Count",
+ "in": "query",
+ "schema": {
+ "type": "integer",
+ "minimum": 1,
+ "maximum": 100,
+ "default": "20"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Returns members list and pointer to the next data page",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ChatMembersList"
+ }
+ }
+ }
+ },
+ "500": {
+ "$ref": "#/components/responses/InternalError"
+ },
+ "401": {
+ "$ref": "#/components/responses/Unauthorized"
+ },
+ "403": {
+ "$ref": "#/components/responses/Forbidden"
+ },
+ "404": {
+ "$ref": "#/components/responses/NotFound"
+ }
}
+ },
+ "post": {
+ "tags": [
+ "chats"
+ ],
+ "operationId": "addMembers",
+ "description": "Adds members to chat. Additional permissions may require.",
+ "summary": "Add members",
+ "parameters": [
+ {
+ "name": "chatId",
+ "description": "Chat identifier",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "integer",
+ "format": "int64",
+ "pattern": "\\-?\\d+"
+ }
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UserIdsList"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "$ref": "#/components/responses/SuccessResponse"
+ },
+ "500": {
+ "$ref": "#/components/responses/InternalError"
+ },
+ "401": {
+ "$ref": "#/components/responses/Unauthorized"
+ },
+ "403": {
+ "$ref": "#/components/responses/Forbidden"
+ },
+ "404": {
+ "$ref": "#/components/responses/NotFound"
+ }
+ }
+ },
+ "delete": {
+ "tags": [
+ "chats"
+ ],
+ "operationId": "removeMember",
+ "description": "Removes member from chat. Additional permissions may require.",
+ "summary": "Remove member",
+ "parameters": [
+ {
+ "name": "chatId",
+ "description": "Chat identifier",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "integer",
+ "format": "int64",
+ "pattern": "\\-?\\d+"
+ }
+ },
+ {
+ "name": "user_id",
+ "description": "User id to remove from chat",
+ "required": true,
+ "in": "query",
+ "schema": {
+ "type": "integer",
+ "format": "int64"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/components/responses/SuccessResponse"
+ },
+ "500": {
+ "$ref": "#/components/responses/InternalError"
+ },
+ "401": {
+ "$ref": "#/components/responses/Unauthorized"
+ },
+ "403": {
+ "$ref": "#/components/responses/Forbidden"
+ }
+ }
+ }
+ },
+ "/subscriptions": {
+ "get": {
+ "tags": [
+ "subscriptions"
+ ],
+ "operationId": "getSubscriptions",
+ "description": "In case your bot gets data via WebHook, the method returns list of all subscriptions.",
+ "summary": "Get subscriptions",
+ "responses": {
+ "200": {
+ "description": "As expected",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/GetSubscriptionsResult"
+ }
+ }
+ }
+ },
+ "500": {
+ "$ref": "#/components/responses/InternalError"
+ },
+ "401": {
+ "$ref": "#/components/responses/Unauthorized"
+ }
+ }
+ },
+ "post": {
+ "tags": [
+ "subscriptions"
+ ],
+ "operationId": "subscribe",
+ "description": "Subscribes bot to receive updates via WebHook. After calling this method, the bot will receive notifications about new events in chat rooms at the specified URL",
+ "summary": "Subscribe",
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/SubscriptionRequestBody"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "$ref": "#/components/responses/SuccessResponse"
+ },
+ "500": {
+ "$ref": "#/components/responses/InternalError"
+ },
+ "401": {
+ "$ref": "#/components/responses/Unauthorized"
+ }
+ }
+ },
+ "delete": {
+ "tags": [
+ "subscriptions"
+ ],
+ "operationId": "unsubscribe",
+ "description": "Unsubscribes bot from receiving updates via WebHook. After calling the method, the bot stops receiving notifications about new events. Notification via the long-poll API becomes available for the bot",
+ "summary": "Unsubscribe",
+ "parameters": [
+ {
+ "name": "url",
+ "in": "query",
+ "description": "URL to remove from WebHook subscriptions",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/components/responses/SuccessResponse"
+ },
+ "500": {
+ "$ref": "#/components/responses/InternalError"
+ },
+ "401": {
+ "$ref": "#/components/responses/Unauthorized"
+ }
+ }
+ }
+ },
+ "/uploads": {
+ "post": {
+ "tags": [
+ "upload"
+ ],
+ "operationId": "getUploadUrl",
+ "description": "Returns the URL for the subsequent file upload.\n\nFor example, you can upload it via curl:\n```\ncurl -i -X POST \n -H \"Content-Type: multipart/form-data\" \n -F \"data=@movie.mp4\" \"%UPLOAD_URL%\"\n```\n\nTwo types of an upload are supported: \n- single request upload (multipart request)\n- and resumable upload.\n \n##### Multipart upload\n\nThis type of upload is a simpler one but it is less reliable and agile. If a `Content-Type`: multipart/form-data header is passed in a request our service indicates upload type as a simple single request upload. \nThis type of an upload has some restrictions: \n- Max. file size - 2 Gb\u2028\n- Only one file per request can be uploaded\n- No possibility to restart stopped / failed upload\n\n##### Resumable upload\nIf `Content-Type` header value is not equal to `multipart/form-data` our service indicated upload type as a resumable upload.\nWith a `Content-Range` header current file chunk range and complete file size can be passed. If a network error has happened or upload was stopped you can continue to upload a file from the last successfully uploaded file chunk. You can request the last known byte of uploaded file from server and continue to upload a file. \n\n##### Get upload status\nTo GET an upload status you simply need to perform HTTP-GET request to a file upload URL. Our service will respond with current upload status, complete file size and last known uploaded byte. This data can be used to complete stopped upload if something went wrong. If `REQUESTED_RANGE_NOT_SATISFIABLE` or `INTERNAL_SERVER_ERROR` status was returned it is a good point to try to restart an upload",
+ "summary": "Get upload URL",
+ "parameters": [
+ {
+ "description": "Uploaded file type: photo, audio, video, file",
+ "name": "type",
+ "required": true,
+ "in": "query",
+ "schema": {
+ "$ref": "#/components/schemas/UploadType"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Returns URL to upload attachment",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UploadEndpoint"
+ }
+ }
+ }
+ },
+ "500": {
+ "$ref": "#/components/responses/InternalError"
+ },
+ "401": {
+ "$ref": "#/components/responses/Unauthorized"
+ }
+ }
+ }
+ },
+ "/messages": {
+ "get": {
+ "tags": [
+ "messages"
+ ],
+ "operationId": "getMessages",
+ "description": "Returns messages in chat: result page and marker referencing to the next page. Messages traversed in reverse direction so the latest message in chat will be first in result array. Therefore if you use `from` and `to` parameters, `to` must be **less than** `from`",
+ "summary": "Get messages",
+ "parameters": [
+ {
+ "description": "Chat identifier to get messages in chat",
+ "name": "chat_id",
+ "in": "query",
+ "schema": {
+ "$ref": "#/components/schemas/bigint"
+ }
+ },
+ {
+ "description": "Messages ids you want to get",
+ "name": "message_ids",
+ "in": "query",
+ "schema": {
+ "uniqueItems": true,
+ "items": {
+ "type": "string"
+ },
+ "nullable": true
+ }
+ },
+ {
+ "name": "from",
+ "description": "Start time for requested messages",
+ "in": "query",
+ "schema": {
+ "$ref": "#/components/schemas/bigint"
+ }
+ },
+ {
+ "name": "to",
+ "description": "End time for requested messages",
+ "in": "query",
+ "schema": {
+ "$ref": "#/components/schemas/bigint"
+ }
+ },
+ {
+ "name": "count",
+ "description": "Maximum amount of messages in response",
+ "in": "query",
+ "schema": {
+ "type": "integer",
+ "format": "int32",
+ "default": 50,
+ "minimum": 1,
+ "maximum": 100
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Returns list of messages",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/MessageList"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "This exception happens when user suspended bot or it doesn't have access to chat",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ }
+ }
+ }
+ },
+ "500": {
+ "$ref": "#/components/responses/InternalError"
+ },
+ "401": {
+ "$ref": "#/components/responses/Unauthorized"
+ }
+ }
+ },
+ "post": {
+ "tags": [
+ "messages"
+ ],
+ "operationId": "sendMessage",
+ "description": "Sends a message to a chat. As a result for this method new message identifier returns.\n### Attaching media\nAttaching media to messages is a three-step process.\n\nAt first step, you should [obtain a URL to upload](#operation/getUploadUrl) your media files.\n\nAt the second, you should upload binary of appropriate format to URL you obtained at the previous step. See [upload](https://dev.tamtam.chat/#operation/getUploadUrl) section for details.\n\nFinally, if the upload process was successful, you will receive JSON-object in a response body. Use this object to create attachment. Construct an object with two properties: \n- `type` with the value set to appropriate media type \n- and `payload` filled with the JSON you've got. \n\nFor example, you can attach a video to message this way:\n\n1. Get URL to upload. Execute following:\n```shell\ncurl -X POST \\\n 'https://botapi.tamtam.chat/uploads?access_token=%access_token%&type=video'\n```\nAs the result it will return URL for the next step.\n```json\n{\n \"url\": \"http://vu.mycdn.me/upload.do…\"\n}\n```\n\n\n2. Use this url to upload your binary: \n```shell\ncurl -i -X POST \n -H \"Content-Type: multipart/form-data\" \n -F \"data=@movie.mp4\" \"http://vu.mycdn.me/upload.do…\"\n```\nAs the result it will return JSON you can attach to message:\n```json\n{\n \"id\": 1234567890\n}\n```\n3. Send message with attach:\n```json\n{\n\t\"text\": \"Message with video\",\n\t\"attachments\": [\n\t\t{\n\t\t\t\"type\": \"video\",\n\t\t\t\"payload\": {\n\t\t\t \"id\": 1173574260020\n\t\t\t}\n\t\t}\n\t]\n}\n```\n\n**Important notice**:\n\nIt may take time for the server to process your file (audio/video or any binary). While a file is not processed you can't attach it. It means the last step will fail with `400` error. Try to send a message again until you'll get a successful result.",
+ "summary": "Send message",
+ "parameters": [
+ {
+ "name": "user_id",
+ "description": "Fill this parameter if you want to send message to user",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "integer",
+ "format": "int64"
+ }
+ },
+ {
+ "name": "chat_id",
+ "description": "Fill this if you send message to chat",
+ "schema": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "in": "query",
+ "required": false
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/NewMessageBody"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Returns info about created message",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/SendMessageResult"
+ }
+ }
+ }
+ },
+ "500": {
+ "$ref": "#/components/responses/InternalError"
+ },
+ "401": {
+ "$ref": "#/components/responses/Unauthorized"
+ }
+ }
+ },
+ "put": {
+ "tags": [
+ "messages"
+ ],
+ "operationId": "editMessage",
+ "description": "Updated message should be sent as `NewMessageBody` in a request body. In case `attachments` field is `null`, the current message attachments won’t be changed. In case of sending an empty list in this field, all attachments will be deleted.",
+ "summary": "Edit message",
+ "parameters": [
+ {
+ "name": "message_id",
+ "description": "Editing message identifier",
+ "required": true,
+ "in": "query",
+ "schema": {
+ "type": "string",
+ "pattern": "mid\\.[a-z0-9]{32}"
+ }
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/NewMessageBody"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Returns info about created message",
+ "$ref": "#/components/responses/SuccessResponse"
+ },
+ "500": {
+ "$ref": "#/components/responses/InternalError"
+ },
+ "401": {
+ "$ref": "#/components/responses/Unauthorized"
+ }
+ }
+ },
+ "delete": {
+ "tags": [
+ "messages"
+ ],
+ "operationId": "deleteMessage",
+ "summary": "Delete message",
+ "description": "Deletes message in a dialog or in a chat if bot has permission to delete messages.",
+ "parameters": [
+ {
+ "name": "message_id",
+ "description": "Deleting message identifier",
+ "required": true,
+ "in": "query",
+ "schema": {
+ "type": "string",
+ "pattern": "mid\\.[a-z0-9]{32}"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/components/responses/SuccessResponse"
+ },
+ "500": {
+ "$ref": "#/components/responses/InternalError"
+ },
+ "401": {
+ "$ref": "#/components/responses/Unauthorized"
+ },
+ "403": {
+ "$ref": "#/components/responses/Forbidden"
+ }
+ }
+ }
+ },
+ "/answers": {
+ "post": {
+ "tags": [
+ "messages"
+ ],
+ "operationId": "answerOnCallback",
+ "description": "This method should be called to send an answer after a user has clicked the button. The answer may be an updated message or/and a one-time user notification.",
+ "summary": "Answer on callback",
+ "parameters": [
+ {
+ "name": "callback_id",
+ "description": "Identifies a button clicked by user. Bot receives this identifier after user pressed button as part of `MessageCallbackUpdate`",
+ "required": true,
+ "in": "query",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/CallbackAnswer"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "$ref": "#/components/responses/SuccessResponse"
+ },
+ "500": {
+ "$ref": "#/components/responses/InternalError"
+ },
+ "405": {
+ "$ref": "#/components/responses/NotAllowed"
+ },
+ "401": {
+ "$ref": "#/components/responses/Unauthorized"
+ }
+ }
+ }
+ },
+ "/updates": {
+ "get": {
+ "operationId": "getUpdates",
+ "tags": [
+ "subscriptions"
+ ],
+ "description": "You can use this method for getting updates in case your bot is not subscribed to WebHook. The method based on long polling.",
+ "summary": "Get updates",
+ "parameters": [
+ {
+ "name": "limit",
+ "description": "Maximim number of updates to be retrieved.",
+ "in": "query",
+ "schema": {
+ "type": "integer",
+ "minimum": 1,
+ "maximum": 1000,
+ "default": 100
+ }
+ },
+ {
+ "name": "timeout",
+ "description": "Timeout in seconds for long polling.",
+ "in": "query",
+ "schema": {
+ "type": "integer",
+ "minimum": 0,
+ "maximum": 90,
+ "default": 30
+ }
+ },
+ {
+ "name": "marker",
+ "description": "Identifier of first requested update. Pass `null` to get updates you didn't get yet.",
+ "in": "query",
+ "schema": {
+ "type": "integer",
+ "format": "int64",
+ "nullable": true
+ }
+ },
+ {
+ "name": "types",
+ "description": "Comma separated list of update types your bot want to receive.",
+ "in": "query",
+ "example": "types=message_created,message_callback",
+ "schema": {
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "string"
+ },
+ "nullable": true
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "List of updates",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UpdateList"
+ }
+ }
+ }
+ },
+ "500": {
+ "$ref": "#/components/responses/InternalError"
+ },
+ "405": {
+ "$ref": "#/components/responses/NotAllowed"
+ },
+ "401": {
+ "$ref": "#/components/responses/Unauthorized"
+ }
+ }
+ }
}
+ },
+ "components": {
+ "securitySchemes": {
+ "access_token": {
+ "type": "apiKey",
+ "name": "access_token",
+ "description": "A token is given to you by [PrimeBot](https://tt.me/primebot) after you have created a bot.\nIn all subsequent requests to the Bot API, you **must** pass the received token as an `access_token` parameter to the HTTP request.\n\n\nIf [Terms and Conditions of TamTam usage](https://team.tamtam.chat/en/terms/) have been violated, the TamTam administration may withdraw tokens by aborting user sessions.\nIf your token has been compromised, you can request a new one by sending a `/revoke` command to **[PrimeBot](https://tt.me/primebot)**.",
+ "in": "query"
+ }
+ },
+ "responses": {
+ "SuccessResponse": {
+ "description": "Success or not result",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/SimpleQueryResult"
+ }
+ }
+ }
+ },
+ "InternalError": {
+ "description": "Internal Server Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ }
+ }
+ }
+ },
+ "Unauthorized": {
+ "description": "Authorization Error. No `access_token` provided or token is invalid",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ }
+ }
+ }
+ },
+ "Forbidden": {
+ "description": "Access error. You don't have permissions to access this resource",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ }
+ }
+ }
+ },
+ "NotFound": {
+ "description": "Requested resource is not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ }
+ }
+ }
+ },
+ "NotAllowed": {
+ "description": "Method not allowed",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ }
+ }
+ }
+ }
+ },
+ "schemas": {
+ "bigint": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "User": {
+ "properties": {
+ "user_id": {
+ "description": "Users identifier",
+ "type": "integer",
+ "format": "int64"
+ },
+ "name": {
+ "description": "Users visible name",
+ "type": "string"
+ },
+ "username": {
+ "description": "Unique public user name. Can be `null` if user is not accessible or it is not set",
+ "type": "string",
+ "nullable": true
+ }
+ },
+ "required": [
+ "user_id",
+ "name",
+ "username"
+ ]
+ },
+ "UserWithPhoto": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/User"
+ },
+ {
+ "properties": {
+ "avatar_url": {
+ "description": "URL of avatar",
+ "type": "string",
+ "readOnly": false
+ },
+ "full_avatar_url": {
+ "description": "URL of avatar of a bigger size",
+ "type": "string",
+ "readOnly": false
+ }
+ }
+ }
+ ]
+ },
+ "BotInfo": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/UserWithPhoto"
+ },
+ {
+ "properties": {
+ "commands": {
+ "description": "Commands supported by bot",
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/BotCommand"
+ },
+ "maxItems": 32,
+ "readOnly": false,
+ "nullable": true
+ },
+ "description": {
+ "description": "Bot description",
+ "maxLength": 16000,
+ "type": "string",
+ "readOnly": false,
+ "nullable": true
+ }
+ }
+ }
+ ]
+ },
+ "BotPatch": {
+ "properties": {
+ "name": {
+ "description": "Visible name of bot",
+ "type": "string",
+ "maxLength": 64,
+ "minLength": 1,
+ "readOnly": false,
+ "nullable": true
+ },
+ "username": {
+ "description": "Bot unique identifier. It can be any string 4-64 characters long containing any digit, letter or special symbols: \"-\" or \"_\". It **must** starts with a letter",
+ "type": "string",
+ "pattern": "[a-z]+[a-z0-9-_]*",
+ "readOnly": false,
+ "minLength": 4,
+ "maxLength": 64,
+ "nullable": true
+ },
+ "description": {
+ "description": "Bot description up to 16k characters long",
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 16000,
+ "readOnly": false,
+ "nullable": true
+ },
+ "commands": {
+ "description": "Commands supported by bot. Pass empty list if you want to remove commands",
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/BotCommand"
+ },
+ "maxItems": 32,
+ "readOnly": false,
+ "nullable": true
+ },
+ "photo": {
+ "description": "Request to set bot photo",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/PhotoAttachmentRequestPayload"
+ }
+ ],
+ "readOnly": false,
+ "nullable": true
+ }
+ }
+ },
+ "BotCommand": {
+ "properties": {
+ "name": {
+ "description": "Command name",
+ "type": "string",
+ "maxLength": 64,
+ "minLength": 1
+ },
+ "description": {
+ "description": "Optional command description",
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 128,
+ "readOnly": false,
+ "nullable": true
+ }
+ },
+ "required": [
+ "name"
+ ]
+ },
+ "Chat": {
+ "properties": {
+ "chat_id": {
+ "description": "Chats identifier",
+ "type": "integer",
+ "format": "int64"
+ },
+ "type": {
+ "description": "Type of chat. One of: dialog, chat, channel",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ChatType"
+ }
+ ]
+ },
+ "status": {
+ "description": "Chat status. One of:\n - active: bot is active member of chat\n - removed: bot was kicked\n - left: bot intentionally left chat\n - closed: chat was closed",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ChatStatus"
+ }
+ ]
+ },
+ "title": {
+ "description": "Visible title of chat. Can be null for dialogs",
+ "type": "string",
+ "nullable": true
+ },
+ "icon": {
+ "description": "Icon of chat",
+ "nullable": true,
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Image"
+ }
+ ]
+ },
+ "last_event_time": {
+ "description": "Time of last event occured in chat",
+ "type": "integer",
+ "format": "int64"
+ },
+ "participants_count": {
+ "description": "Number of people in chat. Always 2 for `dialog` chat type",
+ "type": "integer",
+ "format": "int32"
+ },
+ "owner_id": {
+ "description": "Identifier of chat owner. Visible only for chat admins",
+ "nullable": true,
+ "type": "integer",
+ "format": "int64",
+ "readOnly": false
+ },
+ "participants": {
+ "description": "Participants in chat with time of last activity. Can be *null* when you request list of chats. Visible for chat admins only",
+ "nullable": true,
+ "readOnly": false,
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer",
+ "format": "int64"
+ }
+ },
+ "is_public": {
+ "description": "Is current chat publicly available. Always `false` for dialogs",
+ "type": "boolean"
+ },
+ "link": {
+ "description": "Link on chat if it is public",
+ "type": "string",
+ "readOnly": false,
+ "nullable": true
+ },
+ "description": {
+ "description": "Chat description",
+ "nullable": true
+ }
+ },
+ "required": [
+ "chat_id",
+ "type",
+ "status",
+ "title",
+ "last_event_time",
+ "participants_count",
+ "icon",
+ "is_public",
+ "description"
+ ]
+ },
+ "ChatType": {
+ "description": "Type of chat. Dialog (one-on-one), chat or channel",
+ "enum": [
+ "dialog",
+ "chat",
+ "channel"
+ ]
+ },
+ "ChatStatus": {
+ "description": "Chat status for current bot",
+ "enum": [
+ "active",
+ "removed",
+ "left",
+ "closed",
+ "suspended"
+ ]
+ },
+ "ChatList": {
+ "properties": {
+ "chats": {
+ "description": "List of requested chats",
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Chat"
+ }
+ },
+ "marker": {
+ "description": "Reference to the next page of requested chats",
+ "nullable": true,
+ "type": "integer",
+ "format": "int64"
+ }
+ },
+ "required": [
+ "chats",
+ "marker"
+ ]
+ },
+ "ChatPatch": {
+ "properties": {
+ "icon": {
+ "readOnly": false,
+ "nullable": true,
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/PhotoAttachmentRequestPayload"
+ }
+ ]
+ },
+ "title": {
+ "type": "string",
+ "readOnly": false,
+ "nullable": true
+ }
+ }
+ },
+ "ChatMember": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/UserWithPhoto"
+ },
+ {
+ "properties": {
+ "last_access_time": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "is_owner": {
+ "type": "boolean"
+ },
+ "is_admin": {
+ "type": "boolean"
+ },
+ "join_time": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "permissions": {
+ "description": "Permissions in chat if member is admin. `null` otherwise",
+ "type": "array",
+ "uniqueItems": true,
+ "nullable": true,
+ "items": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ChatAdminPermission"
+ }
+ ]
+ }
+ }
+ },
+ "required": [
+ "last_access_time",
+ "is_owner",
+ "is_admin",
+ "permissions",
+ "join_time"
+ ]
+ }
+ ]
+ },
+ "ChatAdminPermission": {
+ "description": "Chat admin permissions",
+ "type": "string",
+ "enum": [
+ "read_all_messages",
+ "add_remove_members",
+ "add_admins",
+ "change_chat_info",
+ "pin_message",
+ "write"
+ ]
+ },
+ "ChatMembersList": {
+ "properties": {
+ "members": {
+ "description": "Participants in chat with time of last activity. Visible only for chat admins",
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/ChatMember"
+ }
+ },
+ "marker": {
+ "description": "Pointer to the next data page",
+ "type": "integer",
+ "format": "int64",
+ "nullable": true
+ }
+ },
+ "required": [
+ "members",
+ "marker"
+ ]
+ },
+ "Image": {
+ "description": "Generic schema describing image object",
+ "properties": {
+ "url": {
+ "description": "URL of image",
+ "type": "string"
+ }
+ },
+ "required": [
+ "url"
+ ]
+ },
+ "Subscription": {
+ "description": "Schema to describe WebHook subscription",
+ "properties": {
+ "url": {
+ "description": "WebHook URL",
+ "type": "string"
+ },
+ "time": {
+ "description": "Unix-time when subscription was created",
+ "type": "integer",
+ "format": "int64"
+ },
+ "update_types": {
+ "description": "Update types bot subscribed for",
+ "example": "[\"message_created\", \"bot_started\"]",
+ "type": "array",
+ "nullable": true,
+ "uniqueItems": true,
+ "items": {
+ "type": "string",
+ "minLength": 1
+ }
+ },
+ "version": {
+ "type": "string",
+ "nullable": true,
+ "pattern": "[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}"
+ }
+ },
+ "required": [
+ "url",
+ "time",
+ "update_types",
+ "version"
+ ]
+ },
+ "Recipient": {
+ "description": "New message recepient. Could be user or chat",
+ "properties": {
+ "chat_id": {
+ "description": "Chat identifier",
+ "type": "integer",
+ "format": "int64",
+ "nullable": true
+ },
+ "chat_type": {
+ "description": "Chat type",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ChatType"
+ }
+ ]
+ },
+ "user_id": {
+ "description": "User identifier, if message was sent to user",
+ "type": "integer",
+ "format": "int64",
+ "nullable": true
+ }
+ },
+ "required": [
+ "chat_id",
+ "chat_type",
+ "user_id"
+ ]
+ },
+ "Message": {
+ "description": "Message in chat",
+ "properties": {
+ "sender": {
+ "description": "User that sent this message. Can be `null` if message has been posted on behalf of a channel.",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/User"
+ }
+ ],
+ "readOnly": false
+ },
+ "recipient": {
+ "description": "Message recipient. Could be user or chat",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Recipient"
+ }
+ ]
+ },
+ "timestamp": {
+ "description": "Unix-time when message was created",
+ "type": "integer",
+ "format": "int64"
+ },
+ "link": {
+ "description": "Forwarder or replied message",
+ "nullable": true,
+ "readOnly": false,
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/LinkedMessage"
+ }
+ ]
+ },
+ "body": {
+ "description": "Body of created message. Text + attachments. Could be null if message contains only forwarded message.",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/MessageBody"
+ }
+ ]
+ },
+ "stat": {
+ "description": "Message staistics. Available only for channels in [GET:/messages](#operation/getMessages) context",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/MessageStat"
+ }
+ ],
+ "nullable": true,
+ "readOnly": false
+ }
+ },
+ "required": [
+ "recipient",
+ "body",
+ "timestamp"
+ ]
+ },
+ "MessageStat": {
+ "description": "Message statistics",
+ "properties": {
+ "views": {
+ "type": "integer"
+ }
+ },
+ "required": [
+ "views"
+ ]
+ },
+ "MessageBody": {
+ "description": "Schema representing body of message",
+ "type": "object",
+ "properties": {
+ "mid": {
+ "description": "Unique identifier of message",
+ "type": "string"
+ },
+ "seq": {
+ "description": "Sequence identifier of message in chat",
+ "type": "integer",
+ "format": "int64"
+ },
+ "text": {
+ "description": "Message text",
+ "type": "string",
+ "nullable": true
+ },
+ "attachments": {
+ "description": "Message attachments. Could be one of `Attachment` type. See description of this schema",
+ "type": "array",
+ "nullable": true,
+ "items": {
+ "$ref": "#/components/schemas/Attachment"
+ }
+ },
+ "reply_to": {
+ "deprecated": true,
+ "description": "In case this message is repled to, it is the unique identifier of the replied message",
+ "type": "string",
+ "nullable": true,
+ "readOnly": false
+ }
+ },
+ "required": [
+ "mid",
+ "seq",
+ "text",
+ "attachments",
+ "link"
+ ]
+ },
+ "MessageList": {
+ "description": "Paginated list of messages",
+ "properties": {
+ "messages": {
+ "description": "List of messages",
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Message"
+ }
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ },
+ "NewMessageBody": {
+ "properties": {
+ "text": {
+ "description": "Message text",
+ "type": "string",
+ "maxLength": 4000,
+ "nullable": true
+ },
+ "attachment": {
+ "description": "Use `attachments` property instead. Will be removed in the next major release.\n\nSingle message attachment.",
+ "deprecated": true,
+ "type": "object",
+ "nullable": true,
+ "readOnly": false,
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/AttachmentRequest"
+ }
+ ]
+ },
+ "attachments": {
+ "description": "Message attachments. See `AttachmentRequest` and it's inheritors for full information.",
+ "type": "array",
+ "nullable": true,
+ "items": {
+ "$ref": "#/components/schemas/AttachmentRequest"
+ }
+ },
+ "link": {
+ "description": "Link to Message",
+ "type": "object",
+ "nullable": true,
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/NewMessageLink"
+ }
+ ]
+ },
+ "notify": {
+ "description": "If false, chat participants wouldn't be notified",
+ "type": "boolean",
+ "default": true,
+ "readOnly": false
+ }
+ },
+ "required": [
+ "text",
+ "attachments",
+ "link"
+ ]
+ },
+ "NewMessageLink": {
+ "properties": {
+ "type": {
+ "description": "Type of message link",
+ "nullable": false,
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/MessageLinkType"
+ }
+ ]
+ },
+ "mid": {
+ "description": "Message identifier of original message",
+ "type": "string",
+ "nullable": false
+ }
+ },
+ "required": [
+ "type",
+ "mid"
+ ]
+ },
+ "LinkedMessage": {
+ "properties": {
+ "type": {
+ "description": "Type of linked message",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/MessageLinkType"
+ }
+ ]
+ },
+ "sender": {
+ "description": "User sent this message",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/User"
+ }
+ ]
+ },
+ "chat_id": {
+ "description": "Chat where message was originally posted",
+ "type": "integer",
+ "format": "int64"
+ },
+ "message": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/MessageBody"
+ }
+ ]
+ }
+ },
+ "required": [
+ "type",
+ "message",
+ "sender",
+ "chat_id"
+ ]
+ },
+ "SendMessageResult": {
+ "properties": {
+ "message": {
+ "$ref": "#/components/schemas/Message"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ },
+ "Attachment": {
+ "description": "Generic schema representing message attachment",
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "image": "#/components/schemas/PhotoAttachment",
+ "video": "#/components/schemas/VideoAttachment",
+ "audio": "#/components/schemas/AudioAttachment",
+ "file": "#/components/schemas/FileAttachment",
+ "sticker": "#/components/schemas/StickerAttachment",
+ "contact": "#/components/schemas/ContactAttachment",
+ "inline_keyboard": "#/components/schemas/InlineKeyboardAttachment",
+ "share": "#/components/schemas/ShareAttachment",
+ "location": "#/components/schemas/LocationAttachment"
+ }
+ },
+ "properties": {
+ "type": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "type"
+ ]
+ },
+ "PhotoAttachment": {
+ "description": "Image attachment",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Attachment"
+ },
+ {
+ "properties": {
+ "payload": {
+ "type": "object",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/PhotoAttachmentPayload"
+ }
+ ]
+ }
+ },
+ "required": [
+ "payload"
+ ]
+ }
+ ]
+ },
+ "PhotoAttachmentPayload": {
+ "properties": {
+ "photo_id": {
+ "description": "Unique identifier of this image",
+ "type": "integer",
+ "format": "int64"
+ },
+ "token": {
+ "description": "",
+ "type": "string"
+ },
+ "url": {
+ "description": "Image URL",
+ "type": "string"
+ }
+ },
+ "required": [
+ "photo_id",
+ "url",
+ "token"
+ ]
+ },
+ "VideoAttachment": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Attachment"
+ },
+ {
+ "properties": {
+ "payload": {
+ "type": "object",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/MediaAttachmentPayload"
+ }
+ ]
+ }
+ },
+ "required": [
+ "payload"
+ ]
+ }
+ ]
+ },
+ "AudioAttachment": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Attachment"
+ },
+ {
+ "properties": {
+ "payload": {
+ "type": "object",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/MediaAttachmentPayload"
+ }
+ ]
+ }
+ },
+ "required": [
+ "payload"
+ ]
+ }
+ ]
+ },
+ "FileAttachment": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Attachment"
+ },
+ {
+ "properties": {
+ "payload": {
+ "type": "object",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/FileAttachmentPayload"
+ }
+ ]
+ }
+ },
+ "required": [
+ "payload"
+ ]
+ }
+ ]
+ },
+ "AttachmentPayload": {
+ "properties": {
+ "url": {
+ "description": "Media attachment URL",
+ "type": "string"
+ }
+ },
+ "required": [
+ "url"
+ ]
+ },
+ "MediaAttachmentPayload": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/AttachmentPayload"
+ },
+ {
+ "properties": {
+ "id": {
+ "description": "Identifier of media attachment",
+ "type": "integer",
+ "format": "int64"
+ }
+ },
+ "required": [
+ "id"
+ ]
+ }
+ ]
+ },
+ "FileAttachmentPayload": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/AttachmentPayload"
+ },
+ {
+ "properties": {
+ "fileId": {
+ "description": "Identifier of uploaded file",
+ "type": "integer",
+ "format": "int64"
+ }
+ },
+ "required": [
+ "fileId"
+ ]
+ }
+ ]
+ },
+ "ContactAttachment": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Attachment"
+ },
+ {
+ "properties": {
+ "payload": {
+ "type": "object",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ContactAttachmentPayload"
+ }
+ ]
+ }
+ },
+ "required": [
+ "payload"
+ ]
+ }
+ ]
+ },
+ "ContactAttachmentPayload": {
+ "properties": {
+ "vcfInfo": {
+ "description": "User info in VCF format",
+ "nullable": true,
+ "type": "string"
+ },
+ "tamInfo": {
+ "description": "User info",
+ "nullable": true,
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/User"
+ }
+ ]
+ }
+ },
+ "required": [
+ "vcfInfo",
+ "tamInfo"
+ ]
+ },
+ "StickerAttachment": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Attachment"
+ },
+ {
+ "properties": {
+ "payload": {
+ "type": "object",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/AttachmentPayload"
+ }
+ ]
+ }
+ },
+ "required": [
+ "payload"
+ ]
+ }
+ ]
+ },
+ "ShareAttachment": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Attachment"
+ },
+ {
+ "properties": {
+ "payload": {
+ "type": "object",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/AttachmentPayload"
+ }
+ ]
+ }
+ },
+ "required": [
+ "payload"
+ ]
+ }
+ ]
+ },
+ "LocationAttachment": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Attachment"
+ },
+ {
+ "properties": {
+ "latitude": {
+ "type": "number",
+ "format": "double"
+ },
+ "longitude": {
+ "type": "number",
+ "format": "double"
+ }
+ },
+ "required": [
+ "latitude",
+ "longitude"
+ ]
+ }
+ ]
+ },
+ "InlineKeyboardAttachment": {
+ "description": "Buttons in messages",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Attachment"
+ },
+ {
+ "properties": {
+ "callback_id": {
+ "description": "Unique identifier of keyboard",
+ "type": "string"
+ },
+ "payload": {
+ "type": "object",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Keyboard"
+ }
+ ]
+ }
+ },
+ "required": [
+ "callback_id",
+ "payload"
+ ]
+ }
+ ]
+ },
+ "Keyboard": {
+ "description": "Keyboard is two-dimension array of buttons",
+ "properties": {
+ "buttons": {
+ "type": "array",
+ "items": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Button"
+ }
+ }
+ }
+ },
+ "required": [
+ "buttons"
+ ]
+ },
+ "Button": {
+ "properties": {
+ "type": {
+ "type": "string"
+ },
+ "text": {
+ "description": "Visible text of button",
+ "type": "string",
+ "maxLength": 128
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "callback": "#/components/schemas/CallbackButton",
+ "link": "#/components/schemas/LinkButton",
+ "request_geo_location": "#/components/schemas/RequestGeoLocationButton",
+ "request_contact": "#/components/schemas/RequestContactButton"
+ }
+ },
+ "required": [
+ "type",
+ "text"
+ ]
+ },
+ "CallbackButton": {
+ "description": "After pressing this type of button client sends to server payload it contains",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Button"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "description": "Button payload",
+ "type": "string",
+ "maxLength": 1024
+ },
+ "intent": {
+ "description": "Intent of button. Affects clients representation.",
+ "readOnly": false,
+ "default": "default",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Intent"
+ }
+ ]
+ }
+ },
+ "required": [
+ "payload"
+ ]
+ }
+ ]
+ },
+ "LinkButton": {
+ "description": "After pressing this type of button user follows the link it contains",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Button"
+ },
+ {
+ "properties": {
+ "url": {
+ "type": "string",
+ "maxLength": 256
+ }
+ },
+ "required": [
+ "url"
+ ]
+ }
+ ]
+ },
+ "RequestContactButton": {
+ "description": "After pressing this type of button client sends new message with attachment of curent user contact",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Button"
+ }
+ ]
+ },
+ "RequestGeoLocationButton": {
+ "description": "After pressing this type of button client sends new message with attachment of current user geo location",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Button"
+ },
+ {
+ "properties": {
+ "quick": {
+ "description": "If *true*, sends location without asking user's confirmation",
+ "readOnly": false,
+ "type": "boolean",
+ "default": false
+ }
+ }
+ }
+ ]
+ },
+ "Intent": {
+ "description": "Intent of button",
+ "type": "string",
+ "enum": [
+ "positive",
+ "negative",
+ "default"
+ ]
+ },
+ "MessageLinkType": {
+ "description": "Type of linked message",
+ "type": "string",
+ "enum": [
+ "forward",
+ "reply"
+ ]
+ },
+ "AttachmentRequest": {
+ "description": "Request to attach some data to message",
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "image": "#/components/schemas/PhotoAttachmentRequest",
+ "video": "#/components/schemas/VideoAttachmentRequest",
+ "audio": "#/components/schemas/AudioAttachmentRequest",
+ "file": "#/components/schemas/FileAttachmentRequest",
+ "sticker": "#/components/schemas/StickerAttachmentRequest",
+ "contact": "#/components/schemas/ContactAttachmentRequest",
+ "inline_keyboard": "#/components/schemas/InlineKeyboardAttachmentRequest",
+ "location": "#/components/schemas/LocationAttachmentRequest"
+ }
+ },
+ "properties": {
+ "type": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "type"
+ ]
+ },
+ "PhotoAttachmentRequest": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/AttachmentRequest"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/PhotoAttachmentRequestPayload"
+ }
+ ]
+ }
+ },
+ "required": [
+ "payload"
+ ]
+ }
+ ]
+ },
+ "PhotoAttachmentRequestPayload": {
+ "description": "Request to attach image. All fields are mutually exclusive.",
+ "properties": {
+ "url": {
+ "description": "Any external image URL you want to attach",
+ "nullable": true,
+ "readOnly": false,
+ "type": "string"
+ },
+ "token": {
+ "description": "Token of any existing attachment",
+ "nullable": true,
+ "readOnly": false,
+ "type": "string"
+ },
+ "photos": {
+ "description": "Tokens were obtained after uploading images",
+ "nullable": true,
+ "readOnly": false,
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/components/schemas/PhotoToken"
+ }
+ }
+ }
+ },
+ "PhotoToken": {
+ "properties": {
+ "token": {
+ "description": "Encoded information of uploaded image",
+ "type": "string"
+ }
+ },
+ "required": [
+ "token"
+ ]
+ },
+ "PhotoTokens": {
+ "description": "This is information you will recieve as soon as an image uploaded",
+ "properties": {
+ "photos": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/components/schemas/PhotoToken"
+ }
+ }
+ },
+ "required": [
+ "photos"
+ ]
+ },
+ "VideoAttachmentRequest": {
+ "description": "Request to attach video to message",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/AttachmentRequest"
+ },
+ {
+ "properties": {
+ "payload": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/UploadedInfo"
+ }
+ ]
+ }
+ },
+ "required": [
+ "payload"
+ ]
+ }
+ ]
+ },
+ "AudioAttachmentRequest": {
+ "description": "Request to attach audio to message. MUST be the only attachment in message",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/AttachmentRequest"
+ },
+ {
+ "properties": {
+ "payload": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/UploadedInfo"
+ }
+ ]
+ }
+ },
+ "required": [
+ "payload"
+ ]
+ }
+ ]
+ },
+ "UploadedInfo": {
+ "description": "This is information you will recieve as soon as audio/video is uploaded",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64"
+ }
+ },
+ "required": [
+ "id"
+ ]
+ },
+ "FileAttachmentRequest": {
+ "description": "Request to attach file to message. MUST be the only attachment in message",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/AttachmentRequest"
+ },
+ {
+ "properties": {
+ "payload": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/UploadedFileInfo"
+ }
+ ]
+ }
+ },
+ "required": [
+ "payload"
+ ]
+ }
+ ]
+ },
+ "UploadType": {
+ "description": "Type of file uploading",
+ "enum": [
+ "photo",
+ "video",
+ "audio",
+ "file"
+ ]
+ },
+ "UploadedFileInfo": {
+ "description": "This is information you will recieve as soon as a file is uploaded",
+ "properties": {
+ "fileId": {
+ "description": "Unique file identifier",
+ "type": "integer",
+ "format": "int64"
+ }
+ },
+ "required": [
+ "fileId"
+ ]
+ },
+ "ContactAttachmentRequest": {
+ "description": "Request to attach contact card to message. MUST be the only attachment in message",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/AttachmentRequest"
+ },
+ {
+ "properties": {
+ "payload": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ContactAttachmentRequestPayload"
+ }
+ ]
+ }
+ },
+ "required": [
+ "payload"
+ ]
+ }
+ ]
+ },
+ "ContactAttachmentRequestPayload": {
+ "properties": {
+ "name": {
+ "description": "Contact name",
+ "nullable": true,
+ "type": "string"
+ },
+ "contactId": {
+ "description": "Contact identifier",
+ "nullable": true,
+ "type": "integer",
+ "format": "int64"
+ },
+ "vcfInfo": {
+ "description": "Full information about contact in VCF format",
+ "nullable": true,
+ "type": "string"
+ },
+ "vcfPhone": {
+ "description": "Contact phone in VCF format",
+ "nullable": true,
+ "type": "string"
+ }
+ },
+ "required": [
+ "name",
+ "contactId",
+ "vcfInfo",
+ "vcfPhone"
+ ]
+ },
+ "StickerAttachmentRequest": {
+ "description": "Request to attach sticker. MUST be the only attachment request in message",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/AttachmentRequest"
+ },
+ {
+ "properties": {
+ "payload": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/StickerAttachmentRequestPayload"
+ }
+ ]
+ }
+ },
+ "required": [
+ "payload"
+ ]
+ }
+ ]
+ },
+ "StickerAttachmentRequestPayload": {
+ "properties": {
+ "code": {
+ "description": "Sticker code",
+ "type": "string"
+ }
+ },
+ "required": [
+ "code"
+ ]
+ },
+ "InlineKeyboardAttachmentRequest": {
+ "description": "Request to attach keyboard to message",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/AttachmentRequest"
+ },
+ {
+ "properties": {
+ "payload": {
+ "type": "object",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/InlineKeyboardAttachmentRequestPayload"
+ }
+ ]
+ }
+ },
+ "required": [
+ "payload"
+ ]
+ }
+ ]
+ },
+ "InlineKeyboardAttachmentRequestPayload": {
+ "properties": {
+ "buttons": {
+ "description": "Two-dimensional array of buttons",
+ "type": "array",
+ "items": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Button"
+ }
+ }
+ }
+ },
+ "required": [
+ "buttons"
+ ]
+ },
+ "LocationAttachmentRequest": {
+ "description": "Request to attach keyboard to message",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/AttachmentRequest"
+ },
+ {
+ "properties": {
+ "latitude": {
+ "type": "number",
+ "format": "double"
+ },
+ "longitude": {
+ "type": "number",
+ "format": "double"
+ }
+ },
+ "required": [
+ "latitude",
+ "longitude"
+ ]
+ }
+ ]
+ },
+ "SubscriptionRequestBody": {
+ "description": "Request to set up WebHook subscription",
+ "properties": {
+ "url": {
+ "description": "URL of HTTP(S)-endpoint of your bot",
+ "type": "string"
+ },
+ "update_types": {
+ "description": "List of update types your bot want to receive. See `Update` object for a complete list of types",
+ "example": "[\"message_created\", \"bot_started\"]",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "string"
+ },
+ "readOnly": false
+ },
+ "version": {
+ "description": "Version of API. Affects model representation",
+ "type": "string",
+ "readOnly": false
+ }
+ },
+ "required": [
+ "url"
+ ]
+ },
+ "GetSubscriptionsResult": {
+ "description": "List of all WebHook subscriptions",
+ "properties": {
+ "subscriptions": {
+ "description": "Current suscriptions",
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Subscription"
+ }
+ }
+ },
+ "required": [
+ "subscriptions"
+ ]
+ },
+ "SimpleQueryResult": {
+ "description": "Simple response to request",
+ "properties": {
+ "success": {
+ "description": "`true` if request was successful. `false` otherwise",
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "success"
+ ]
+ },
+ "Callback": {
+ "description": "Object sent to bot when user presses button",
+ "properties": {
+ "timestamp": {
+ "description": "Unix-time when user pressed the button",
+ "type": "integer",
+ "format": "int64"
+ },
+ "callback_id": {
+ "description": "Current keyboard identifier",
+ "type": "string"
+ },
+ "payload": {
+ "description": "Button payload",
+ "type": "string"
+ },
+ "user": {
+ "description": "User pressed the button",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/User"
+ }
+ ]
+ }
+ },
+ "required": [
+ "timestamp",
+ "callback_id",
+ "payload",
+ "user"
+ ]
+ },
+ "CallbackAnswer": {
+ "description": "Send this object when your bot wants to react to when a button is pressed",
+ "properties": {
+ "user_id": {
+ "type": "integer",
+ "format": "int64",
+ "readOnly": false
+ },
+ "message": {
+ "description": "Fill this if you want to modify current message",
+ "nullable": true,
+ "readOnly": false,
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/NewMessageBody"
+ }
+ ]
+ },
+ "notification": {
+ "description": "Fill this if you just want to send one-time notification to user",
+ "nullable": true,
+ "readOnly": false,
+ "type": "string"
+ }
+ }
+ },
+ "Error": {
+ "description": "Server returns this if there was an exception to your request",
+ "properties": {
+ "error": {
+ "description": "Error",
+ "type": "string"
+ },
+ "code": {
+ "description": "Error code",
+ "type": "string"
+ },
+ "message": {
+ "description": "Human-readable description",
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "message"
+ ]
+ },
+ "UploadEndpoint": {
+ "description": "Endpoint you should upload to your binaries",
+ "type": "object",
+ "properties": {
+ "url": {
+ "description": "URL to upload",
+ "type": "string"
+ }
+ },
+ "required": [
+ "url"
+ ]
+ },
+ "UserIdsList": {
+ "properties": {
+ "user_ids": {
+ "items": {
+ "type": "integer",
+ "format": "int64"
+ }
+ }
+ },
+ "required": [
+ "user_ids"
+ ]
+ },
+ "ActionRequestBody": {
+ "properties": {
+ "action": {
+ "$ref": "#/components/schemas/SenderAction"
+ }
+ },
+ "required": [
+ "action"
+ ]
+ },
+ "SenderAction": {
+ "description": "Different actions to send to chat members",
+ "enum": [
+ "typing_on",
+ "typing_off",
+ "sending_photo",
+ "sending_video",
+ "sending_audio",
+ "mark_seen"
+ ]
+ },
+ "UpdateList": {
+ "description": "List of all updates in chats your bot participated in",
+ "properties": {
+ "updates": {
+ "description": "Page of updates",
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Update"
+ }
+ },
+ "marker": {
+ "description": "Pointer to the next data page",
+ "type": "integer",
+ "format": "int64",
+ "nullable": true
+ }
+ },
+ "required": [
+ "updates",
+ "marker"
+ ]
+ },
+ "Update": {
+ "description": "`Update` object repsesents different types of events that happened in chat. See its inheritors",
+ "discriminator": {
+ "propertyName": "update_type",
+ "mapping": {
+ "message_created": "#/components/schemas/MessageCreatedUpdate",
+ "message_callback": "#/components/schemas/MessageCallbackUpdate",
+ "message_edited": "#/components/schemas/MessageEditedUpdate",
+ "message_removed": "#/components/schemas/MessageRemovedUpdate",
+ "bot_added": "#/components/schemas/BotAddedToChatUpdate",
+ "bot_removed": "#/components/schemas/BotRemovedFromChatUpdate",
+ "user_added": "#/components/schemas/UserAddedToChatUpdate",
+ "user_removed": "#/components/schemas/UserRemovedFromChatUpdate",
+ "bot_started": "#/components/schemas/BotStartedUpdate",
+ "chat_title_changed": "#/components/schemas/ChatTitleChangedUpdate"
+ }
+ },
+ "properties": {
+ "update_type": {
+ "type": "string"
+ },
+ "timestamp": {
+ "description": "Unix-time when event has occured",
+ "type": "integer",
+ "format": "int64"
+ }
+ },
+ "required": [
+ "update_type",
+ "timestamp"
+ ]
+ },
+ "MessageCallbackUpdate": {
+ "description": "You will get this `update` as soon as user presses button",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Update"
+ },
+ {
+ "properties": {
+ "callback": {
+ "description": "",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Callback"
+ }
+ ]
+ },
+ "message": {
+ "description": "Original message containing inline keyboard. Can be `null` in case it had been deleted by the moment a bot got this update.",
+ "nullable": true,
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Message"
+ }
+ ]
+ }
+ },
+ "required": [
+ "callback",
+ "message"
+ ]
+ }
+ ]
+ },
+ "MessageCreatedUpdate": {
+ "description": "You will get this `update` as soon as message is created",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Update"
+ },
+ {
+ "properties": {
+ "message": {
+ "description": "Newly created message",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Message"
+ }
+ ]
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ ]
+ },
+ "MessageRemovedUpdate": {
+ "description": "You will get this `update` as soon as message is removed",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Update"
+ },
+ {
+ "properties": {
+ "message_id": {
+ "description": "Identifier of removed message",
+ "type": "string"
+ }
+ },
+ "required": [
+ "message_id"
+ ]
+ }
+ ]
+ },
+ "MessageEditedUpdate": {
+ "description": "You will get this `update` as soon as message is edited",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Update"
+ },
+ {
+ "properties": {
+ "message": {
+ "description": "Edited message",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Message"
+ }
+ ]
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ ]
+ },
+ "BotAddedToChatUpdate": {
+ "description": "You will receive this update when bot has been added to chat",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Update"
+ },
+ {
+ "properties": {
+ "chat_id": {
+ "description": "Chat id where bot was added",
+ "type": "integer",
+ "format": "int64"
+ },
+ "user_id": {
+ "description": "User id who added bot to chat",
+ "type": "integer",
+ "format": "int64"
+ }
+ },
+ "required": [
+ "chat_id",
+ "user_id"
+ ]
+ }
+ ]
+ },
+ "BotRemovedFromChatUpdate": {
+ "description": "You will receive this update when bot has been removed from chat",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Update"
+ },
+ {
+ "properties": {
+ "chat_id": {
+ "description": "Chat identifier bot removed from",
+ "type": "integer",
+ "format": "int64"
+ },
+ "user_id": {
+ "description": "User id who removed bot from chat",
+ "type": "integer",
+ "format": "int64"
+ }
+ },
+ "required": [
+ "chat_id",
+ "user_id"
+ ]
+ }
+ ]
+ },
+ "UserAddedToChatUpdate": {
+ "description": "You will receive this update when user has been added to chat where bot is administrator",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Update"
+ },
+ {
+ "properties": {
+ "chat_id": {
+ "description": "Chat identifier where event has occured",
+ "type": "integer",
+ "format": "int64"
+ },
+ "user_id": {
+ "description": "User added to chat",
+ "type": "integer",
+ "format": "int64"
+ },
+ "inviter_id": {
+ "description": "User who added user to chat",
+ "type": "integer",
+ "format": "int64"
+ }
+ },
+ "required": [
+ "chat_id",
+ "user_id",
+ "inviter_id"
+ ]
+ }
+ ]
+ },
+ "UserRemovedFromChatUpdate": {
+ "description": "You will receive this update when user has been removed from chat where bot is administrator",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Update"
+ },
+ {
+ "properties": {
+ "chat_id": {
+ "description": "Chat identifier where event has occured",
+ "type": "integer",
+ "format": "int64"
+ },
+ "user_id": {
+ "description": "User removed from chat",
+ "type": "integer",
+ "format": "int64"
+ },
+ "admin_id": {
+ "description": "Administrator who removed user from chat",
+ "type": "integer",
+ "format": "int64"
+ }
+ },
+ "required": [
+ "chat_id",
+ "user_id",
+ "admin_id"
+ ]
+ }
+ ]
+ },
+ "BotStartedUpdate": {
+ "description": "Bot gets this type of update as soon as user pressed `Start` button",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Update"
+ },
+ {
+ "properties": {
+ "chat_id": {
+ "description": "Dialog identifier where event has occurred",
+ "type": "integer",
+ "format": "int64"
+ },
+ "user_id": {
+ "description": "User pressed the 'Start' button",
+ "type": "integer",
+ "format": "int64"
+ }
+ },
+ "required": [
+ "chat_id",
+ "user_id"
+ ]
+ }
+ ]
+ },
+ "ChatTitleChangedUpdate": {
+ "description": "Bot gets this type of update as soon as title has been changed in chat",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Update"
+ },
+ {
+ "properties": {
+ "chat_id": {
+ "description": "Chat identifier where event has occurred",
+ "type": "integer",
+ "format": "int64"
+ },
+ "user_id": {
+ "description": "User who changed title",
+ "type": "integer",
+ "format": "int64"
+ },
+ "title": {
+ "description": "New title",
+ "type": "string"
+ }
+ },
+ "required": [
+ "chat_id",
+ "user_id",
+ "title"
+ ]
+ }
+ ]
+ }
+ }
+ }
}
diff --git a/src/common-elements/dropdown.ts b/src/common-elements/dropdown.ts
index 86623949..1538a2aa 100644
--- a/src/common-elements/dropdown.ts
+++ b/src/common-elements/dropdown.ts
@@ -17,7 +17,7 @@ export const StyledDropdown = styled(Dropdown)`
min-width: 100px;
display: inline-block;
position: relative;
- width: auto;
+ width: 100%;
font-family: ${props => props.theme.typography.headings.fontFamily};
.Dropdown-control {
diff --git a/src/theme.ts b/src/theme.ts
index 7f462906..47b9d0ad 100644
--- a/src/theme.ts
+++ b/src/theme.ts
@@ -85,7 +85,7 @@ const defaultTheme: ThemeInterface = {
nestingSpacing: '1em',
nestedBackground: '#fafafa',
arrow: {
- size: '1.1em',
+ size: '1.4em',
color: theme => theme.colors.text.secondary,
},
},