Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
2236 lines (2178 sloc) 72.8 KB
openapi: 3.0.0
info:
version: 0.1.8
title: TamTam Bot API
license:
name: Apache 2.0
description: |-
# About
Bot API allows bots to interact with TamTam. Methods are called by sending HTTPS requests to [botapi.tamtam.chat](https://botapi.tamtam.chat) domain.
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.
## Features
TamTam bots of the current version are able to:
- Communicate with users and respond to requests
- Recommend users complete actions via programmed buttons
- Request personal data from users (name, short reference, phone number)
We'll keep working on expanding bot capabilities in the future.
## Examples
Bots can be used for the following purposes:
- Providing support, answering frequently asked questions
- Sending typical information
- Voting
- Likes/dislikes
- Following external links
- Forwarding a user to a chat/channel
## @PrimeBot
[PrimeBot](https://tt.me/primebot) is the main bot in TamTam, all bots creator. Use PrimeBot to create and edit
your bots. Feel free to contact us for any questions, [@support](https://tt.me/support) or [team@tamtam.chat](mailto:team@tamtam.chat).
#### [PrimeBot](https://tt.me/primebot) commands:
`/start` — start a dialog with a bot
`/create` — create a bot, assign the unique short name to it (from 4 to 64 characters)
`/set_name [name]` — assign a short or full name to the bot (up to 200 characters)
`/set_description [description]` — enter the description for the bot profile (up to 400 characters)
`/set_picture [URL]` — enter the URL of bot's picture
`/delete [username]` — delete the bot
`/list` — show the list of all bots
`/get_token` — obtain a token for a bot
`/revoke` — request a new token
`/help` — help
## HTTP verbs
`GET` — getting resources, parameters are transmitted via URL
`POST` — creation of resources (for example, sending new messages)
`PUT` — editing resources
`DELETE` — deleting resources
`PATCH` — patching resources
## HTTP response codes
`200` — successful operation
`400` — invalid request
`401` — authentication error
`404` — resource not found
`405` — method is not allowed
`429` — the number of requests is exceeded
`503` — service unavailable
## Resources format
For content requests (PUT and POST) and responses, the API uses the JSON format.
All strings are UTF-8 encoded.
Date/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.
## Error responses
In case of an error, the API returns a response with the corresponding HTTP code and JSON with the following fields:
`code` - the string with the error key
`message` - a string describing the error </br>
For example:
```bash
> http https://botapi.tamtam.chat/chats?access_token={EXAMPLE_TOKEN}
HTTP / 1.1 403 Forbidden
Cache-Control: no-cache
Connection: Keep-Alive
Content-Length: 57
Content-Type: application / json; charset = utf-8
Set-Cookie: web_ui_lang = ru; Path = /; Domain = .tamtam.chat; Expires = 2019-03-24T11: 45: 36.500Z
{
"code": "verify.token",
"message": "Invalid access_token"
}
```
## Receiving Notifications
TamTam Bot API supports 2 options of receiving notifications on new dialog events for bots:
- Push notifications via WebHook. To receive data via WebHook, you'll have to [add subscription](https://dev.tamtam.chat/#operation/subscribe);
- Notifications upon request via [long polling](#operation/getUpdates) API.
All data can be received via long polling **by default** after creating the bot,
Both methods **cannot** be used simultaneously.
Refer to the response schema of [/updates](https://dev.tamtam.chat/#operation/getUpdates) method to check all available types of updates.
## Message buttons
You can program buttons for users answering a bot.
TamTam supports the following types of buttons:
`callback` &mdash; sends a notification to a bot (via WebHook or long polling)
`link` &mdash; makes a user to follow a link
`request_contact` &mdash; requests the user permission to access contact information (phone number, short link, email)
You 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.
# Versioning
API 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`.
To 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.
# Libraries
We have created [Java library](https://github.com/tamtam-chat/tamtam-bot-api) to make using API easier.
# Changelog
##### Version 0.1.8
- Added `code`, `width`, `height` to [StickerAttachment](https://github.com/tamtam-chat/tamtam-bot-api-schema/blob/master/schema.json#L2047)
- `token` is now only one required property for video/audio/file attachments
- `sender` and `chat_id` of [LinkedMessage](https://github.com/tamtam-chat/tamtam-bot-api-schema/blob/master/schema.json#L1743) are now optional
- Added clarifying `message` to [SimpleQueryResult](https://github.com/tamtam-chat/tamtam-bot-api-schema/blob/master/schema.json#L2662)
##### Version 0.1.7
- It is now **required** to pass `marker` parameter in [/updates](#operation/getUpdates) requests, except initial
- Added full `User` object to update types: bot_started, bot_added, bot_removed, user_added, user_removed, chat_title_changed
- Added `size` and `filename` to [`FileAttachment`](https://github.com/tamtam-chat/tamtam-bot-api-schema/blob/master/schema.json#L1916)
- Added [`token`](https://github.com/tamtam-chat/tamtam-bot-api-schema/blob/master/schema.json#L1957) property to video/audio/file attachments allows you to reuse attachments uploaded by another user
##### Version 0.1.6
- Added method to [edit bot info](#operation/editMyInfo)
- Added statistics for messages in channel
- `Message.sender` and `UserWithPhoto.avatar_url/full_avatar_url` removed from required properties
##### Version 0.1.5
- Added `id` property to media attachments (`VideoAttachment`, `AudioAttachment`) so you can reuse attachment from one message in another
- Added ability to create *linked* message: replied or forwarded. See `link` in `NewMessageBody`
- `intent` property marked as required only for `CallbackButton`
##### Version 0.1.4
- Added `user_ids` parameter to [get members](#operation/getMembers) in chat by id
- `attachment` property of [send message](#operation/sendMessage) request body marked as deprecated
##### Version 0.1.3
- Added method to [delete](https://dev.tamtam.chat/#operation/deleteMessages) messages
- Added ability to [get](https://dev.tamtam.chat/#operation/getMessages) particular messages by ID
- Added `is_admin` flag to `ChatMember`
- Added `message` property to `MessageCallbackUpdate`
- Renamed property `message` to `body` for `Message` schema
- 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
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'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/InternalError'
patch:
tags:
- bots
summary: Edit current bot info
operationId: editMyInfo
description: Edits current bot info. Fill only the fields you want to update. All remaining fields will stay untouched
responses:
'200':
description: Modified bot info
content:
application/json:
schema:
$ref: '#/components/schemas/BotInfo'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/InternalError'
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'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/InternalError'
'/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'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/InternalError'
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:
'200':
description: 'If success, returns updated chat object'
content:
application/json:
schema:
$ref: '#/components/schemas/Chat'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'500':
$ref: '#/components/responses/InternalError'
'/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'
responses:
'200':
$ref: '#/components/responses/SuccessResponse'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/InternalError'
'/chats/{chatId}/members/me':
get:
tags:
- chats
x-opGroup: myMembership
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'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/InternalError'
delete:
tags:
- chats
operationId: leaveChat
x-opGroup: myMembership
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'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/InternalError'
'/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).
Comma-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
nullable: true
style: simple
- 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'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/InternalError'
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'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/InternalError'
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'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'500':
$ref: '#/components/responses/InternalError'
/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'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/InternalError'
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.
Your server **must** be listening on one of the following ports: **80, 8080, 443, 8443, 16384-32383**
summary: Subscribe
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SubscriptionRequestBody'
responses:
'200':
$ref: '#/components/responses/SuccessResponse'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/InternalError'
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'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/InternalError'
/uploads:
post:
tags:
- upload
operationId: getUploadUrl
description: |-
Returns the URL for the subsequent file upload.
For example, you can upload it via curl:
```curl -i -X POST
-H "Content-Type: multipart/form-data"
-F "data=@movie.mp4" "%UPLOAD_URL%"```
Two types of an upload are supported:
- single request upload (multipart request)
- and resumable upload.
##### Multipart upload
This 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.
This type of an upload has some restrictions:
- Max. file size - 2 Gb
- Only one file per request can be uploaded
- No possibility to restart stopped / failed upload
##### Resumable upload
If `Content-Type` header value is not equal to `multipart/form-data` our service indicated upload type
as a resumable upload.
With 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.
##### Get upload status
To 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'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/InternalError'
/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'
'401':
$ref: '#/components/responses/Unauthorized'
'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'
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'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/InternalError'
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'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/InternalError'
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'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'500':
$ref: '#/components/responses/InternalError'
/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'
'401':
$ref: '#/components/responses/Unauthorized'
'405':
$ref: '#/components/responses/NotAllowed'
'500':
$ref: '#/components/responses/InternalError'
/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 is based on long polling.
Every update has its own sequence number. `marker` property in response points to the next upcoming update.
All previous updates are considered as *committed* after passing `marker` parameter. If `marker` parameter is **not passed**, your bot will get all updates happened before the last commitment.
summary: Get updates
parameters:
- name: limit
description: Maximum 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: 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
style: simple
responses:
'200':
description: List of updates
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateList'
'401':
$ref: '#/components/responses/Unauthorized'
'405':
$ref: '#/components/responses/NotAllowed'
'500':
$ref: '#/components/responses/InternalError'
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.
In all subsequent requests to the Bot API, you **must** pass the received token as an `access_token` parameter to the HTTP request.
If [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.
If 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 is 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:
- active: bot is active member of chat
- removed: bot was kicked
- left: bot intentionally left chat
- 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 occurred 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
minLength: 1
maxLength: 200
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 recipient. 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 statistics. 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 reply to another, 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.
Single 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. Can be `null` if message has been posted on behalf of a channel
allOf:
- $ref: '#/components/schemas/User'
readOnly: false
chat_id:
description: Chat where message has been originally posted. For forwarded messages only
type: integer
format: int64
readOnly: false
message:
allOf:
- $ref: '#/components/schemas/MessageBody'
required:
- type
- message
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'
filename:
description: Uploaded file name
type: string
size:
description: File size in bytes
type: integer
format: int64
required:
- payload
- filename
- size
AttachmentPayload:
properties:
url:
description: Media attachment URL
type: string
required:
- url
MediaAttachmentPayload:
allOf:
- $ref: '#/components/schemas/AttachmentPayload'
- properties:
token:
description: Use `token` in case when you are trying to reuse the same attachment in other message
type: string
required:
- token
FileAttachmentPayload:
allOf:
- $ref: '#/components/schemas/AttachmentPayload'
- properties:
token:
description: Use `token` in case when you are trying to reuse the same attachment in other message
type: string
required:
- token
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
StickerAttachmentPayload:
allOf:
- $ref: '#/components/schemas/AttachmentPayload'
- properties:
code:
description: Sticker identifier
type: string
required:
- code
StickerAttachment:
allOf:
- $ref: '#/components/schemas/Attachment'
- properties:
payload:
type: object
allOf:
- $ref: '#/components/schemas/StickerAttachmentPayload'
width:
description: Sticker width
type: integer
height:
description: Sticker height
type: integer
required:
- payload
- width
- height
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 current 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
minLength: 1
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 receive 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 receive as soon as audio/video is uploaded
properties:
token:
description: Token is unique uploaded media identfier
type: string
readOnly: false
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/UploadedInfo'
required:
- payload
UploadType:
description: Type of file uploading
enum:
- photo
- video
- audio
- file
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. Must starts with http(s)://'
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 subscriptions
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
message:
description: Explanatory message if the result is not successful
type: string
readOnly: false
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
readOnly: false
user:
description: User pressed the button
allOf:
- $ref: '#/components/schemas/User'
required:
- timestamp
- callback_id
- 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 represents 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 occurred
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:
description: User who added bot to chat
allOf:
- $ref: '#/components/schemas/User'
required:
- chat_id
- user
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:
description: User who removed bot from chat
allOf:
- $ref: '#/components/schemas/User'
required:
- chat_id
- user
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 occurred
type: integer
format: int64
user:
description: User added to chat
allOf:
- $ref: '#/components/schemas/User'
inviter_id:
description: User who added user to chat
type: integer
format: int64
required:
- chat_id
- user
- 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 occurred
type: integer
format: int64
user:
description: User removed from chat
allOf:
- $ref: '#/components/schemas/User'
admin_id:
description: Administrator who removed user from chat
type: integer
format: int64
required:
- chat_id
- user
- 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:
description: User pressed the 'Start' button
allOf:
- $ref: '#/components/schemas/User'
required:
- chat_id
- user
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:
description: User who changed title
allOf:
- $ref: '#/components/schemas/User'
title:
description: New title
type: string
required:
- chat_id
- user
- title
You can’t perform that action at this time.