1. Overview

RetailCRM Message Gateway Bot API

1.1. Version information

Version : 1.0.0

1.2. URI scheme

Host : api.example.com
BasePath : /api/bot/v1
Schemes : HTTPS

1.3. Consumes

  • application/json

1.4. Produces

  • application/json

2. Paths

2.1. Getting a list of bots

GET /bots

2.1.1. Description

Returns the list of bots according to the passed parameters, number of entries is 1000, if parameters "since" and "until" or only parameter "until" are passed, the list is sorted in reverse order

2.1.2. Parameters

Type Name Description Schema

Query

active
optional

Activity checkbox (0|1)

integer

Query

id
optional

Bot ID

integer (uint64)

Query

limit
optional

Maximum number of records in the response

integer (uint64)

Query

since
optional

Is changed from date / time (with microseconds)

string (date-time)

Query

until
optional

Is changed up until date/time (with microseconds)

string (date-time)

2.1.3. Responses

HTTP Code Description Schema

200

List is received

< Bot > array

400

Request error

Error

500

Server error

Error

2.2. Getting a list of channels

GET /channels

2.2.1. Description

Returns the list of channels according to the passed parameters, number of entries is 1000, if parameters "since" and "until" or only parameter "until" are passed, the list is sorted in reverse order

2.2.2. Parameters

Type Name Description Schema

Query

active
optional

Activity checkbox (0|1)

integer

Query

id
optional

Channel ID

integer (uint64)

Query

limit
optional

Maximum number of records in the response

integer (uint64)

Query

since
optional

Is changed from date / time (with microseconds)

string (date-time)

Query

types
optional

Available events

< string > array

Query

until
optional

Is changed up until date/time (with microseconds)

string (date-time)

2.2.3. Responses

HTTP Code Description Schema

200

List is received

< Channel > array

400

Request error

Error

500

Server error

Error

2.3. Getting a list of chats

GET /chats

2.3.1. Description

Returns the list of chats according to the passed parameters, number of entries is 1000, if parameters "since" and "until" or only parameter "until" are passed, the list is sorted in reverse order

2.3.2. Parameters

Type Name Description Schema

Query

channel_id
optional

Channel ID

integer (uint64)

Query

channel_type
optional

Channel type

string

Query

id
optional

Chat ID

integer (uint64)

Query

limit
optional

Maximum number of records in the response

integer (uint64)

Query

since
optional

Is changed from date / time (with microseconds)

string (date-time)

Query

until
optional

Is changed up until date/time (with microseconds)

string (date-time)

2.3.3. Responses

HTTP Code Description Schema

200

List is received

< Chat > array

400

Request error

Error

500

Server error

Error

2.4. Getting a list of customers

GET /customers

2.4.1. Description

Returns the list of customers according to the passed parameters, number of entries is 1000, if parameters "since" and "until" or only parameter "until" are passed, the list is sorted in reverse order

2.4.2. Parameters

Type Name Description Schema

Query

external_id (id in messenger)
optional

External ID of the customer

string

Query

id
optional

Customer ID

integer (uint64)

Query

limit
optional

Maximum number of records in the response

integer (uint64)

Query

since
optional

Is changed from date / time (with microseconds)

string (date-time)

Query

until
optional

Is changed up until date/time (with microseconds)

string (date-time)

2.4.3. Responses

HTTP Code Description Schema

200

List is received

< Customer > array

400

Request error

Error

500

Server error

Error

2.5. Getting a list of dialogs

GET /dialogs

2.5.1. Description

Returns the list of dialogs according to the passed parameters, number of entries is 1000, if parameters "since" and "until" or only parameter "until" are passed, the list is sorted in reverse order

2.5.2. Parameters

Type Name Description Schema

Query

active
optional

Activity checkbox (0|1)

integer

Query

assign
optional

Manager assignment mark (0|1)

integer

Query

bot_id
optional

Bot ID

integer (uint64)

Query

chat_id
optional

Chat ID

integer (uint64)

Query

id
optional

Dialog ID

integer (uint64)

Query

limit
optional

Maximum number of records in the response

integer (uint64)

Query

since
optional

Is changed from date / time (with microseconds)

string (date-time)

Query

until
optional

Is changed up until date/time (with microseconds)

string (date-time)

Query

user_id
optional

Manager ID

integer (uint64)

2.5.3. Responses

HTTP Code Description Schema

200

List is received

< Dialog > array

400

Request error

Error

500

Server error

Error

2.6. Assigning a dialog to a manager or a bot

PATCH /dialogs/{dialog_id}/assign

2.6.1. Description

It is required to specify in the body of the request either the manager`s data to whom the dialog should be assigned or the bot data

2.6.2. Parameters

Type Name Schema

Path

dialog_id
required

integer (uint64)

Body

dialog
required

AssignRequest

2.6.3. Responses

HTTP Code Description Schema

200

The dialog is assigned

AssignResponse

400

Request error

Error

500

Server error

Error

2.7. Closing the dialog

DELETE /dialogs/{dialog_id}/close

2.7.1. Parameters

Type Name Schema

Path

dialog_id
required

integer (uint64)

2.7.2. Responses

HTTP Code Description Schema

200

The dialog is closed

No Content

400

Request error

Error

500

Server error

Error

2.8. Unassigning a dialog from a manager or a bot

PATCH /dialogs/{dialog_id}/unassign

2.8.1. Parameters

Type Name Schema

Path

dialog_id
required

integer (uint64)

2.8.2. Responses

HTTP Code Description Schema

200

The dialog is unassigned

UnassignResponse

400

Request error

Error

500

Server error

Error

2.9. Uploading the file

POST /files/upload

2.9.1. Parameters

Type Name Schema

FormData

file
required

file

2.9.2. Responses

HTTP Code Description Schema

200

The file is uploaded

UploadFileResponse

400

Request error

Error

500

Server error

Error

2.10. Uploading the file from URL

POST /files/upload_by_url

2.10.1. Parameters

Type Name Schema

Body

URL
required

UploadFileByUrlRequest

2.10.2. Responses

HTTP Code Description Schema

200

The file is uploaded

UploadFileResponse

400

Request error

Error

500

Server error

Error

2.11. Getting a file

GET /files/{file_id}

2.11.1. Parameters

Type Name Schema

Path

file_id
required

string

2.11.2. Responses

HTTP Code Description Schema

200

File

FullFileResponse

400

Request error

Error

500

Server error

Error

2.12. Getting a list of chat members

GET /members

2.12.1. Description

Returns the list of chat members according to the passed parameters, number of entries is 1000, if parameters "since" and "until" or only parameter "until" are passed, the list is sorted in reverse order

2.12.2. Parameters

Type Name Description Schema

Query

chat_id
optional

Chat ID

integer (uint64)

Query

limit
optional

Maximum number of records in the response

integer (uint64)

Query

manager_id
optional

User ID

integer (uint64)

Query

since
optional

Is changed from date / time (with microseconds)

string (date-time)

Query

state
optional

Member status (active|kicked|leaved)

integer

Query

until
optional

Is changed up until date/time (with microseconds)

string (date-time)

2.12.3. Responses

HTTP Code Description Schema

200

List is received

< Member > array

400

Request error

Error

500

Server error

Error

2.13. Sending a message

POST /messages

2.13.1. Parameters

Type Name Schema

Body

message
required

MessageSendRequest

2.13.2. Responses

HTTP Code Description Schema

200

The message is sent

MessageSendResponse

400

Request error

Error

500

Server error

Error

2.14. Getting a list of messages

GET /messages

2.14.1. Description

Returns the list of messages according to the passed parameters, number of entries is 1000, if parameters "since" and "until" or only parameter "until" are passed, the list is sorted in reverse order

2.14.2. Parameters

Type Name Description Schema

Query

bot_id
optional

Bot ID

integer (uint64)

Query

channel_id
optional

Channel ID

integer (uint64)

Query

chat_id
optional

Chat ID

integer (uint64)

Query

customer_id
optional

Customer ID

integer (uint64)

Query

dialog_id
optional

Dialog ID

integer (uint64)

Query

id
optional

Message ID

< integer > array

Query

manager_id
optional

Manager ID

integer (uint64)

Query

scope
optional

Scope (public|private)

string

Query

since
optional

Is changed from date / time (with microseconds)

string (date-time)

Query

type
optional

Message type

string

Query

until
optional

Is changed up until date/time (with microseconds)

string (date-time)

2.14.3. Responses

HTTP Code Description Schema

200

List is received

< Message > array

400

Request error

Error

500

Server error

Error

2.15. Deleting the message

DELETE /messages/{message_id}

2.15.1. Parameters

Type Name Schema

Path

message_id
required

integer (uint64)

2.15.2. Responses

HTTP Code Description Schema

200

The message is deleted

No Content

400

Request error

Error

500

Server error

Error

2.16. Editing the message

PATCH /messages/{message_id}

2.16.1. Parameters

Type Name Schema

Path

message_id
required

integer (uint64)

Body

message
required

MessageEditRequest

2.16.2. Responses

HTTP Code Description Schema

200

The message is edited

No Content

400

Request error

Error

500

Server error

Error

2.17. Getting a list of bot commands

GET /my/commands

2.17.1. Description

Returns the list of bot commands according to the passed parameters, number of entries is 1000, if parameters "since" and "until" or only parameter "until" are passed, the list is sorted in reverse order

2.17.2. Parameters

Type Name Description Schema

Query

id
optional

Command ID

integer (uint64)

Query

name
optional

Command name

string

Query

since
optional

Is changed from date / time (with microseconds)

string (date-time)

Query

until
optional

Is changed up until date/time (with microseconds)

string (date-time)

2.17.3. Responses

HTTP Code Description Schema

200

List is received

< Command > array

400

Request error

Error

500

Server error

Error

2.18. Creating/editing a command

PUT /my/commands/{name}

2.18.1. Parameters

Type Name Schema

Path

name
required

string

Body

command
required

CommandEditRequest

2.18.2. Responses

HTTP Code Description Schema

200

The command is edited

No Content

400

Request error

Error

500

Server error

Error

2.19. Deleting the command

DELETE /my/commands/{name}

2.19.1. Parameters

Type Name Schema

Path

name
required

string

2.19.2. Responses

HTTP Code Description Schema

200

The command is deleted

No Content

400

Request error

Error

500

Server error

Error

2.20. Updating information about a bot

PATCH /my/info

2.20.1. Parameters

Type Name Schema

Body

info
required

InfoRequest

2.20.2. Responses

HTTP Code Description Schema

200

The data of the bot is updated

No Content

400

Request error

Error

500

Server error

Error

2.21. Getting a list of managers

GET /users

2.21.1. Description

Returns the list of managers according to the passed parameters, number of entries is 1000, if parameters "since" and "until" or only parameter "until" are passed, the list is sorted in reverse order

2.21.2. Parameters

Type Name Description Schema

Query

active
optional

Activity checkbox (0|1)

integer

Query

external_id (id in messenger)
optional

External ID of the manager

string

Query

id
optional

Manager ID

integer (uint64)

Query

limit
optional

Maximum number of records in the response

integer (uint64)

Query

online
optional

Online indicator (0|1)

integer

Query

since
optional

Is changed from date / time (with microseconds)

string (date-time)

Query

until
optional

Is changed up until date/time (with microseconds)

string (date-time)

2.21.3. Responses

HTTP Code Description Schema

200

List is received

< User > array

400

Request error

Error

500

Server error

Error

2.22. Opening a websocket connection

GET /ws

2.22.1. Description

This URL is used for opening the websocket connection, by means of this connection a bot will be able to receive the data by each type of events to which it is subscribed, the list of events is passed as a string, values are separated by commas (wss://api.example.com/api/bot/v1/ws?events=message_new,message_updated)

2.22.2. Parameters

Type Name Description Schema

Query

events
required

Types of events to which the bot can be subscribed

enum (message_new, message_updated, message_deleted, dialog_opened, dialog_closed, dialog_assign, chat_created, chat_updated, user_joined_chat, user_left_chat, user_updated)

2.22.3. Responses

HTTP Code Description Schema

200

The connection is open

Event

3. Definitions

3.1. AssignRequest

One of two parameters is specified

Name Description Schema

bot_id
optional

Bot ID

integer (uint64)

dialog_id
optional

Dialog ID

integer (uint64)

user_id
optional

Manager ID

integer (uint64)

3.2. AssignResponse

Name Description Schema

is_reassign
required

Successful reassignment mark

boolean

left_manager_id
optional

ID of previous manager

integer (uint64)

previous_responsible
optional

Previous responsible person

Responsible

responsible
required

New responsible person

Responsible

3.3. Attachment

File attachment

Name Description Schema

caption
optional

Displayed name

string

height
optional

Image height, not present if file is not an image

integer (uint64)

id
optional

ID of file

integer (uint64)

preview_url
optional

Preview url, not present if file is not an image

string

size
optional

File size in bytes

integer (uint64)

type
optional

MIME type

string

width
optional

Image width, not present if file is not an image

integer (uint64)

3.4. Bot

Name Description Schema

avatar_url
optional

Avatar URL

string

client_id
optional

Connection ID

string

created_at
optional

Date/time of creation

string (date-time)

deactivated_at
optional

Date/time of deactivation

string (date-time)

id
required

Bot ID

integer (uint64)

is_active
required

Activity checkbox

string

is_self
required

Field description

string

name
required

Bot name

string

roles
optional

Roles

< object > array

updated_at
optional

Date/time of last change

string (date-time)

3.5. Channel

Name Description Schema

activated_at
required

Date/time of activation

string (date-time)

created_at
required

Date/time of creation

string (date-time)

deactivated_at
optional

Date/time of deactivation

string (date-time)

id
required

Channel ID

integer (int64)

is_active
required

Activity checkbox

boolean

name
optional

Channel name

string

settings
optional

Channel settings

ChannelSettings

type
required

Channel type

enum (telegram, fbmessenger, viber, whatsapp, skype, vk, instagram, consultant, yandex_chat, custom)

updated_at
optional

Date/time of last change

string (date-time)

3.6. ChannelSettings

Name Description Schema

audio
optional

Settings of audio messages

audio

customer_external_id
optional

Parameter used for external identification of the customer
Default : "any"

enum (any, phone)

file
optional

Settings of messages with files

file

image
optional

Settings of messages with images

image

order
optional

Settings of messages with order

order

product
optional

Settings of messages with product card

product

sending_policy
optional

Sending message policy

sending_policy

status
optional

Setting of messages status updates

status

suggestions
optional

Settings of messages with buttons

suggestions

text
optional

Settings of text messages

text

audio

Name Description Schema

creating
optional

Possibility to send messages
Default : "none"

enum (none, receive, send, both)

deleting
optional

Possibility to delete messages
Default : "none"

enum (none, receive, send, both)

max_items_count
optional

Maximum number of audio recordings in a single message

integer

quoting
optional

Possibility to quote messages
Default : "none"

enum (none, receive, send, both)

file

Name Description Schema

creating
optional

Possibility to send messages
Default : "none"

enum (none, receive, send, both)

deleting
optional

Possibility to delete messages
Default : "none"

enum (none, receive, send, both)

editing
optional

Possibility to edit messages
Default : "none"

enum (none, receive, send, both)

max_items_count
optional

Maximum number of files in a single message

integer

note_max_chars_count
optional

Maximum allowed message length of an accompanying message

integer

quoting
optional

Possibility to quote messages
Default : "none"

enum (none, receive, send, both)

image

Name Description Schema

creating
optional

Possibility to send messages
Default : "none"

enum (none, receive, send, both)

deleting
optional

Possibility to delete messages
Default : "none"

enum (none, receive, send, both)

editing
optional

Possibility to edit messages
Default : "none"

enum (none, receive, send, both)

max_items_count
optional

Maximum number of images in a single message

integer

note_max_chars_count
optional

Maximum allowed message length of an accompanying message

integer

quoting
optional

Possibility to quote messages
Default : "none"

enum (none, receive, send, both)

order

Name Description Schema

creating
optional

Possibility to send messages
Default : "none"

enum (none, receive, send, both)

deleting
optional

Possibility to delete messages
Default : "none"

enum (none, receive, send, both)

editing
optional

Possibility to edit messages
Default : "none"

enum (none, receive, send, both)

product

Name Description Schema

creating
optional

Possibility to send messages
Default : "none"

enum (none, receive, send, both)

deleting
optional

Possibility to delete messages
Default : "none"

enum (none, receive, send, both)

editing
optional

Possibility to edit messages
Default : "none"

enum (none, receive, send, both)

sending_policy

Name Description Schema

after_reply_timeout
optional

After expiration of allowed time to respond to customer
Default : "no"

enum (no, template)

new_customer
optional

For customers with whom was no communication before
Default : "no"

enum (no, template)

status

Name Description Schema

delivered
optional

Possibility to send delivered status
Default : "none"

enum (none, receive, send, both)

read
optional

Possibility to send read status
Default : "none"

enum (none, receive, send, both)

suggestions

Name Description Schema

Email
optional

Possibility to request the customer’s email address
Default : "none"

enum (none, receive, send, both)

Phone
optional

Possibility to request the customer’s phone number
Default : "none"

enum (none, receive, send, both)

text
optional

Possibility to work with buttons that have random text
Default : "none"

enum (none, receive, send, both)

text

Name Description Schema

creating
optional

Possibility to send messages
Default : "none"

enum (none, receive, send, both)

deleting
optional

Possibility to delete messages
Default : "none"

enum (none, receive, send, both)

editing
optional

Possibility to edit messages
Default : "none"

enum (none, receive, send, both)

max_chars_count
optional

Maximum allowed message length (2000 characters by default)

integer (uint16)

quoting
optional

Possibility to quote messages
Default : "none"

enum (none, receive, send, both)

3.7. Chat

Name Description Schema

author_id
required

Author ID

integer (uint64)

avatar
required

Avatar URL

string

channel
optional

Channel data

Channel

created_at
required

Date/time of creation

string (date-time)

customer
required

User

Customer

id
required

Chat ID

integer (uint64)

last_activity
required

Last activity

string (date-time)

last_message
required

Last message

LastMessage

name
required

Name

string

updated_at
required

Date/time of last change

string (date-time)

LastMessage

Name Description Schema

id
optional

Message ID

integer (uint64)

time
optional

Time of creation

string (date-time)

type
optional

Message type

string

3.8. Command

Name Description Schema

created_at
required

Date/time of creation

string (date-time)

description
required

Command description

string

id
required

Command ID

integer (uint64)

name
required

Command name

string

updated_at
optional

Date/time of last change

string (date-time)

3.9. CommandEditRequest

Name Description Schema

description
optional

Command description

string

name
optional

Command name

string

3.10. Customer

Name Description Schema

avatar
optional

Avatar URL

string

channel_id
optional

Channel ID

string

country
optional

Country

string

created_at
required

Date/time of creation

string (date-time)

email
optional

Email

string

external_id
optional

External ID of the customer (id in a messenger)

string

first_name
optional

Fist name of the customer

string

id
required

Customer ID

integer (uint64)

language
optional

Selected locale

string

last_name
optional

Last name of the customer

string

phone
optional

Phone

string

profile_url
optional

Profile URL

string

revoked_at
optional

Date/time of registration revocation

string (date-time)

updated_at
optional

Date/time of last change

string (date-time)

username
optional

Username

string

3.11. Dialog

Name Description Schema

begin_message_id
optional

ID of the first message

integer (uint64)

bot_id
optional

Bot ID

integer (uint64)

chat_id
required

Chat ID

integer (uint64)

closed_at
optional

Date/time of closing

string (date-time)

created_at
required

Date/time of creation

string (date-time)

ending_message_id
optional

ID of the last message

integer (uint64)

id
required

Dialog ID

integer (uint64)

is_active
required

Activity checkbox

string

is_assigned
required

Assignment mark

string

responsible
optional

Responsible

updated_at
optional

Date/time of last change

string (date-time)

3.12. Error

Name Description Schema

messages
required

List of error messages
Example : [ "Something went wrong" ]

< string > array

3.13. Event

Object returned on event

Name Description Schema

app_id
required

Application ID

integer (uint)

data
required

Body of object (depends on the event type, one of the properties below will be received)

data

meta
required

Metadata

meta

type
required

Event type

string

data

Name Description Schema

chat_event
optional

Event - chat_created, chat_updated

Chat

dialog_assign
optional

Event - dialog_assign

EventTypeDialogAssign

dialog_event
optional

Event - dialog_opened, dialog_closed

Dialog

message_event
optional

Event - message_new, message_updated, message_deleted

EventTypeMessage

user_join_chat_event
optional

Event - user_join_chat

EventTypeUserJoinChat

user_left_chat_event
optional

Event - user_left_chat

EventTypeUserLeftChat

user_update_event
optional

Event - user_updated

User

meta

Name Description Schema

timestamp
optional

Timestamp

integer (int64)

3.14. EventTypeDialogAssign

Name Description Schema

chat
required

Information about chat

Chat

dialog
required

Information about dialog

Dialog

3.15. EventTypeMessage

Name Description Schema

message
optional

Information about message

Message

3.16. EventTypeUserJoinChat

Name Description Schema

chat
required

Information about chat

Chat

user
required

Information about user

User

3.17. EventTypeUserLeftChat

Name Description Schema

chat
required

Information about chat

Chat

reason
required

Reason of event (active, left, kicked)

string

user
required

Information about user

User

3.18. FileMeta

Name Schema

height
optional

integer (uint64)

width
optional

integer (uint64)

3.19. FullFileResponse

Name Description Schema

id
optional

File ID

string

size
optional

File size

integer (uint64)

type
optional

File type

string

url
optional

Link to file

string

3.20. InfoRequest

Name Description Schema

avatar_url
optional

Avatar URL

string

name
optional

Bot name

string

roles
optional

< object > array

3.21. Item

Name Schema

caption
required

string

id
required

string

3.22. Member

Name Description Schema

chat_id
required

Chat ID

integer (uint64)

created_at
required

Date/time of creation

string (date-time)

id
required

Member ID

integer (uint64)

is_author
required

Author mark

string

state
required

Status

string

updated_at
optional

Date/time of last change

string (date-time)

user_id
required

User ID

integer (uint64)

3.23. Message

Name Description Schema

actions
required

Available actions

< object > array

channel_id
required

Channel ID

integer (uint64)

channel_sent_at
required

Date/time of sending

string (date-time)

chat
optional

Chat data

Chat

chat_id
required

Chat ID

integer (uint64)

content
required

Message body

string

created_at
required

Date/time of creation

string (date-time)

from
required

From whom

User

id
required

Message ID

integer (uint64)

is_edit
required

Mark of editing

boolean

is_read
required

Mark that the message has been read

boolean

items
required

Attachments

< Attachment > array

order
optional

Order page

MessageOrder

product
optional

Product page

MessageProduct

scope
required

Scope

string

status
required

Status

string

time
required

Timestamp

string (date-time)

transport_attachments
optional

Attachments

TransportAttachments

type
required

Message type

string

updated_at
required

Date/time of last change

string (date-time)

3.24. MessageCost

Name Description Schema

currency
required

Currency code
Example : "rub | usd | eur"

string

value
optional

Price per unit

number (float32)

3.25. MessageDelivery

Name Description Schema

address
required

Address

string

comment
optional

Comment

string

name
required

Name of delivery type

string

price
required

Cost

MessageCost

3.26. MessageEditRequest

Name Description Schema

content
optional

Message body

string

id
optional

Message ID

integer (uint64)

3.27. MessageOrder

Order page

Name Description Schema

cost
optional

Sum for order

MessageCost

date
optional

Date of creation

string

delivery
required

Delivery

MessageDelivery

items
optional

Order items

< MessageOrderItem > array

number
required

Order number

string

payments
required

Payments

< MessagePayment > array

status
optional

Order status

MessageStatus

3.28. MessageOrderItem

Name Description Schema

img
optional

Image URL

string

name
optional

Product name

string

price
optional

Cost

MessageCost

quantity
optional

Quantity

MessageQuantity

url
optional

URL of product page

string

3.29. MessageOrderPaymentStatus

Name Description Schema

name
required

Name of status

string

payed
required

Indicator of payment completion

boolean

3.30. MessagePayment

Name Description Schema

amount
required

Payment name

MessageCost

name
required

Payment name

string

status
required

Payment status

MessageOrderPaymentStatus

3.31. MessageProduct

Product page

Name Description Schema

article
optional

Article

string

cost
optional

Price

MessageCost

id
required

Offer ID

integer (uint64)

img
optional

Image URL

string

name
required

Product name

string

quantity
optional

Quantity

MessageQuantity

url
optional

URL of product page

string

3.32. MessageQuantity

Name Description Schema

unit
required

Unit of measurement

string

value
required

Quantity

number (float32)

3.33. MessageSendRequest

Name Description Schema

chat_id
required

Chat ID

integer (uint64)

content
optional

Body of the text message, it is required if the 'text' type is specified

string

items
optional

Array of files, it is required if the 'file' type is specified

< Item > array

order
optional

Body of the order page, it is required if the 'text' type is specified

MessageOrder

product
optional

Body of the product page, it is required if the 'product' type is specified

MessageProduct

quote_message_id
optional

ID of the quoted message

integer (uint64)

scope
required

Scope
Example : "public"

string

transport_attachments
optional

Attachments

TransportAttachments

type
required

Message type
Example : "text | order | product | file"

string

3.34. MessageSendResponse

Name Description Schema

message_id
optional

Message ID

integer (uint64)

time
optional

Timestamp

string

3.35. MessageStatus

Name Description Schema

code
optional

Code of status

string

name
optional

Name of status

string

3.36. Responsible

Name Description Schema

assigned_at
required

Date/time of assignment

string (date-time)

id
required

ID of responsible person

integer (uint64)

type
required

Type of responsible person

string

3.37. Suggestion

Name Description Schema

title
optional

Suggestion title (only can be used with text type)

string

type
required

Suggestion type
Example : "text | email | phone"

string

3.38. TransportAttachments

Name Description Schema

suggestions
optional

Suggestions

< Suggestion > array

3.39. UnassignResponse

Name Description Schema

previous_responsible
optional

Previous responsible person

Responsible

3.40. UploadFileByUrlRequest

Name Schema

url
required

string

3.41. UploadFileResponse

Name Description Schema

created_at
required

Time of file creation

string (date-time)

hash
required

File hash

string

id
required

File ID

string

meta
required

Information about file

FileMeta

mime_type
required

MIME type

string

size
required

File size

integer (uint64)

source_url
required

Link to file

string

type
required

File type

string

3.42. User

Name Description Schema

avatar
optional

Avatar URL

string

created_at
required

Date/time of creation

string (date-time)

external_id
optional

External ID of the user (id in a messenger)

string

first_name
optional

Fist name of the user

string

id
required

User ID

integer (uint64)

is_active
required

Activity checkbox

string

is_online
required

Online indicator

string

last_name
optional

Last name of the user

string

revoked_at
optional

Date/time of registration revocation

string (date-time)

updated_at
optional

Date/time of last change

string (date-time)

username
optional

Username

string

4. Security

4.1. key

Type : apiKey
Name : x-bot-token
In : HEADER