Возвращает список каналов
| id | integer <int> >= 1 Идентификатор запрашиваемого объекта |
| active | string (Boolean) Enum: "1" "0" "true" "false" Флаг активности канала |
| types | Array of strings (ChannelType) Items Enum: "telegram" "tiktok" "fbmessenger" "viber" "whatsapp" "skype" "vk" "instagram" "consultant" "yandex_chat" "odnoklassniki" "max" "ozon" "wildberries" "yandex_market" "mega_market" "avito" "drom" "youla" "custom" Example: types=telegram Типы каналов |
| since | string <date-time> Нижний предел даты последнего обновления объекта |
| until | string <date-time> Верхний предел даты последнего обновления объекта |
| limit | integer <int> [ 1 .. 1000 ] Количество элементов в ответе. Значение по умолчанию - 100 |
| id required | integer <int64> |
| type required | string (ChannelType) Enum: "telegram" "tiktok" "fbmessenger" "viber" "whatsapp" "skype" "vk" "instagram" "consultant" "yandex_chat" "odnoklassniki" "max" "ozon" "wildberries" "yandex_market" "mega_market" "avito" "drom" "youla" "custom" Типы каналов |
| created_at required | string <date-time> |
| activated_at required | string <date-time> |
| is_active required | boolean |
| external_id | string or null |
| name | string or null |
object or null Настройки канала | |
| updated_at | string or null <date-time> |
| deactivated_at | string or null <date-time> |
[- {
- "id": 1,
- "external_id": "ch2847",
- "name": "Example Channel",
- "type": "telegram",
- "is_active": true,
- "settings": {
- "text": {
- "creating": "both",
- "deleting": "both",
- "editing": "both",
- "quoting": "both",
- "reaction": "both",
- "max_chars_count": 0,
- "markup_formats": [
- "bold"
]
}, - "audio": {
- "creating": "both",
- "deleting": "both",
- "quoting": "both",
- "reaction": "both",
- "max_item_size": 0,
- "max_items_count": 0
}, - "file": {
- "creating": "both",
- "deleting": "both",
- "editing": "both",
- "quoting": "both",
- "reaction": "both",
- "max_item_size": 0,
- "max_items_count": 0,
- "note_max_chars_count": 0
}, - "image": {
- "creating": "both",
- "deleting": "both",
- "editing": "both",
- "quoting": "both",
- "reaction": "both",
- "max_item_size": 0,
- "max_items_count": 0,
- "note_max_chars_count": 0
}, - "order": {
- "creating": "both",
- "deleting": "both",
- "editing": "both",
- "reaction": "both",
- "quoting": "both"
}, - "product": {
- "creating": "both",
- "deleting": "both",
- "editing": "both",
- "reaction": "both",
- "quoting": "both"
}, - "customer_external_id": "phone",
- "deferred_phone_template_send": true,
- "sending_policy": {
- "after_reply_timeout": "no",
- "new_customer": "no",
- "outgoing": "allowed"
}, - "status": {
- "delivered": "both",
- "read": "both"
}, - "suggestions": {
- "email": "both",
- "phone": "both",
- "text": "both",
- "url": "both"
}, - "template": {
- "creation": true,
- "sending": true
}, - "whatsapp": {
- "channel_quality": "high",
- "channel_status": "connected",
- "tier": 0
}, - "reactions": {
- "dictionary": [
- "string"
], - "max_count": 0
}
}, - "created_at": "2006-01-02T15:04:05.999999Z07:00",
- "updated_at": "2006-01-02T15:04:05.999999Z07:00",
- "activated_at": "2006-01-02T15:04:05.999999Z07:00",
- "deactivated_at": "2006-01-02T15:04:05.999999Z07:00"
}
]Активирует новый канал с заданными параметрами
Запрос на активацию канала
| id required | integer <int64> >= 0 Идентификатор канала |
| type required | string Enum: "telegram" "tiktok" "fbmessenger" "viber" "whatsapp" "skype" "vk" "instagram" "consultant" "yandex_chat" "odnoklassniki" "max" "ozon" "wildberries" "yandex_market" "mega_market" "avito" "drom" "youla" "custom" Типы каналов |
| external_id | string <= 64 characters Внешний идентификатор канала |
| name | string <= 100 characters Название канала |
| avatar_url | string <uri> <= 255 characters URL аватара канала |
object (ChannelSettings) Настройки канала |
| id required | integer <int64> Идентификатор канала |
| activated_at required | string <date-time> Дата и время активации канала |
| id required | integer <int64> Идентификатор канала |
| activated_at required | string <date-time> Дата и время активации канала |
{- "id": 146,
- "external_id": "ac3249",
- "name": "demo channel",
- "settings": {
- "text": {
- "creating": "both",
- "deleting": "both",
- "editing": "both",
- "quoting": "both",
- "reaction": "both",
- "max_chars_count": 0,
- "markup_formats": [
- "bold"
]
}, - "audio": {
- "creating": "both",
- "deleting": "both",
- "quoting": "both",
- "reaction": "both",
- "max_item_size": 0,
- "max_items_count": 0
}, - "file": {
- "creating": "both",
- "deleting": "both",
- "editing": "both",
- "quoting": "both",
- "reaction": "both",
- "max_item_size": 0,
- "max_items_count": 0,
- "note_max_chars_count": 0
}, - "image": {
- "creating": "both",
- "deleting": "both",
- "editing": "both",
- "quoting": "both",
- "reaction": "both",
- "max_item_size": 0,
- "max_items_count": 0,
- "note_max_chars_count": 0
}, - "order": {
- "creating": "both",
- "deleting": "both",
- "editing": "both",
- "reaction": "both",
- "quoting": "both"
}, - "product": {
- "creating": "both",
- "deleting": "both",
- "editing": "both",
- "reaction": "both",
- "quoting": "both"
}, - "customer_external_id": "phone",
- "deferred_phone_template_send": true,
- "sending_policy": {
- "after_reply_timeout": "no",
- "new_customer": "no",
- "outgoing": "allowed"
}, - "status": {
- "delivered": "both",
- "read": "both"
}, - "suggestions": {
- "email": "both",
- "phone": "both",
- "text": "both",
- "url": "both"
}, - "template": {
- "creation": true,
- "sending": true
}, - "whatsapp": {
- "channel_quality": "high",
- "channel_status": "connected",
- "tier": 0
}, - "reactions": {
- "dictionary": [
- "string"
], - "max_count": 0
}
}, - "type": "telegram"
}{- "id": 34,
- "activated_at": "2006-01-02T15:04:05Z07:00"
}Деактивирует существующий канал
| channel_id required | integer <int64> Идентификатор канала |
| id required | integer <int64> Идентификатор деактивированного канала |
| deactivated_at required | string <date-time> Дата и время деактивации канала |
{- "id": 34,
- "deactivated_at": "2006-01-02T15:04:05Z07:00"
}Обновление параметров существующего канала
| channel_id required | integer <int64> Идентификатор канала |
Запрос на обновление канала
| external_id | string <= 64 characters Внешний идентификатор |
| name | string <= 100 characters Название канала |
| avatar_url | string <= 255 characters URL аватара канала |
object (ChannelSettings) Настройки канала | |
| type | string Enum: "telegram" "tiktok" "fbmessenger" "viber" "whatsapp" "skype" "vk" "instagram" "consultant" "yandex_chat" "odnoklassniki" "max" "ozon" "wildberries" "yandex_market" "mega_market" "avito" "drom" "youla" "custom" Типы каналов |
| id required | integer <int64> Идентификатор канала |
| updated_at required | string <date-time> Дата и время последнего обновления |
{- "external_id": "ac3249",
- "name": "demo channel",
- "settings": {
- "text": {
- "creating": "both",
- "deleting": "both",
- "editing": "both",
- "quoting": "both",
- "reaction": "both",
- "max_chars_count": 0,
- "markup_formats": [
- "bold"
]
}, - "audio": {
- "creating": "both",
- "deleting": "both",
- "quoting": "both",
- "reaction": "both",
- "max_item_size": 0,
- "max_items_count": 0
}, - "file": {
- "creating": "both",
- "deleting": "both",
- "editing": "both",
- "quoting": "both",
- "reaction": "both",
- "max_item_size": 0,
- "max_items_count": 0,
- "note_max_chars_count": 0
}, - "image": {
- "creating": "both",
- "deleting": "both",
- "editing": "both",
- "quoting": "both",
- "reaction": "both",
- "max_item_size": 0,
- "max_items_count": 0,
- "note_max_chars_count": 0
}, - "order": {
- "creating": "both",
- "deleting": "both",
- "editing": "both",
- "reaction": "both",
- "quoting": "both"
}, - "product": {
- "creating": "both",
- "deleting": "both",
- "editing": "both",
- "reaction": "both",
- "quoting": "both"
}, - "customer_external_id": "phone",
- "deferred_phone_template_send": true,
- "sending_policy": {
- "after_reply_timeout": "no",
- "new_customer": "no",
- "outgoing": "allowed"
}, - "status": {
- "delivered": "both",
- "read": "both"
}, - "suggestions": {
- "email": "both",
- "phone": "both",
- "text": "both",
- "url": "both"
}, - "template": {
- "creation": true,
- "sending": true
}, - "whatsapp": {
- "channel_quality": "high",
- "channel_status": "connected",
- "tier": 0
}, - "reactions": {
- "dictionary": [
- "string"
], - "max_count": 0
}
}, - "type": "telegram"
}{- "id": 23,
- "updated_at": "2006-01-02T15:04:05Z07:00"
}Загружает файл в репозиторий и возвращает информацию о нём
| id required | string <uuid> UUID загруженного файла |
| type required | string (FileType) Enum: "none" "image" "video" "file" "audio" Тип файла |
| size required | integer <int> Размер файла (в байтах) |
| Url | string <uri> Deprecated URL для скачивания файла (устаревшее, используйте поле |
| url | string <uri> URL для скачивания файла |
| mime_type | string MIME-тип файла |
{- "id": "123e4567-e89b-12d3-a456-426614174000",
- "size": 640,
- "mime_type": "text/plain",
- "type": "file"
}Загружает файл из внешних источников по URL
Загрузить файл по URL
| url required | string <uri> URL источника загрузки |
| id required | string <uuid> UUID загруженного файла |
| type required | string (FileType) Enum: "none" "image" "video" "file" "audio" Тип файла |
| size required | integer <int> Размер файла (в байтах) |
| Url | string <uri> Deprecated URL для скачивания файла (устаревшее, используйте поле |
| url | string <uri> URL для скачивания файла |
| mime_type | string MIME-тип файла |
{
}{- "id": "123e4567-e89b-12d3-a456-426614174000",
- "size": 640,
- "mime_type": "text/plain",
- "type": "file"
}Возвращает информацию о файле по его UUID
| id required | string UUID файла |
| id required | string <uuid> UUID загруженного файла |
| type required | string (FileType) Enum: "none" "image" "video" "file" "audio" Тип файла |
| size required | integer <int> Размер файла (в байтах) |
| Url | string <uri> Deprecated URL для скачивания файла (устаревшее, используйте поле |
| url | string <uri> URL для скачивания файла |
| mime_type | string MIME-тип файла |
{- "id": "123e4567-e89b-12d3-a456-426614174000",
- "size": 640,
- "mime_type": "text/plain",
- "type": "file"
}Активирует новый шаблон сообщения для канала
| channel_id required | integer <int64> Идентификатор канала |
Запрос на активацию нового шаблона
| name required | string or null [ 1 .. 512 ] characters Название шаблона |
| code required | string [ 1 .. 512 ] characters Уникальный код шаблона |
| type required | string Enum: "text" "media" Тип шаблона |
| body | string or null Тело шаблона |
object (TemplateButtons) Список кнопок шаблона | |
| category | string Категория шаблона |
| footer | string Подвал шаблона |
object (TemplateHeader) Секция заголовка шаблона | |
| lang | string Язык шаблона |
| rejection_reason | string Enum: "abusive_content" "incorrect_category" "invalid_format" "scam" Причина отклонения шаблона (для статуса |
| verification_status | string Enum: "approved" "pending" "rejected" "paused" "disabled" Статус верификации шаблона |
Array of objects or null (TemplateItem) | |
| quality | string Enum: "pending" "high" "medium" "low" Качество шаблона |
{- "body": "Hello {{1}}! Your order #{{2}} for the amount of ${{3}} has been delivered to the pickup point. Thank you for your order!",
- "buttons": {
- "items": [
- {
- "label": "Click me",
- "type": "plain"
}, - {
- "label": "Call us",
- "type": "phone",
- "phone": "+1234567890"
},
]
}, - "category": "MARKETING",
- "footer": "foo bar",
- "header": {
- "content": {
- "type": "text",
- "body": "string"
}
}, - "lang": "en",
- "name": "test template",
- "rejection_reason": "invalid_format",
- "verification_status": "approved",
- "template": [
- {
- "type": 1,
- "text": "string",
- "var": 0
}
], - "quality": "pending",
- "code": "DEMO_TEMPLATE",
- "type": "text"
}{ }Деактивирует существующий шаблон сообщения для канала
| channel_id required | integer <int64> Идентификатор канала |
| template_code required | string Код шаблона |
{ }Обновление существующего шаблона сообщения для канала
| channel_id required | integer <int64> Идентификатор канала |
| template_code required | string Код шаблона |
Запрос на обновление существующего шаблона
| name required | string or null [ 1 .. 512 ] characters Название шаблона |
| verification_status required | string Enum: "approved" "pending" "rejected" "paused" "disabled" Статус верификации шаблона |
| body | string or null Тело шаблона |
object (TemplateButtons) Список кнопок шаблона | |
| category | string Категория шаблона |
| footer | string Подвал шаблона |
object (TemplateHeader) Секция заголовка шаблона | |
| lang | string Язык шаблона |
| rejection_reason | string Enum: "abusive_content" "incorrect_category" "invalid_format" "scam" Причина отклонения шаблона (для статуса |
Array of objects or null (TemplateItem) | |
| quality | string Enum: "pending" "high" "medium" "low" Качество шаблона |
{- "body": "Hello {{1}}! Your order #{{2}} for the amount of ${{3}} has been delivered to the pickup point. Thank you for your order!",
- "buttons": {
- "items": [
- {
- "label": "Click me",
- "type": "plain"
}, - {
- "label": "Call us",
- "type": "phone",
- "phone": "+1234567890"
},
]
}, - "category": "MARKETING",
- "footer": "foo bar",
- "header": {
- "content": {
- "type": "text",
- "body": "string"
}
}, - "lang": "en",
- "name": "test template",
- "rejection_reason": "invalid_format",
- "verification_status": "approved",
- "template": [
- {
- "type": 1,
- "text": "string",
- "var": 0
}
], - "quality": "pending"
}{ }Возвращает список доступных шаблонов сообщений для данного транспорта
| id required | integer or null <int64> Идентификатор шаблона |
| code required | string or null [ 1 .. 512 ] characters Уникальный код шаблона |
| channel_id required | integer or null <int64> Идентификатор канала |
| name required | string or null [ 1 .. 512 ] characters Название шаблона |
| enabled required | boolean or null Индикатор активности шаблона |
| type required | string Enum: "text" "media" Тип шаблона |
| body required | string or null Тело шаблона |
| verification_status required | string Enum: "approved" "pending" "rejected" "paused" "disabled" Статус верификации шаблона |
object (TemplateButtons) Список кнопок шаблона | |
| category | string Категория шаблона |
| footer | string Подвал шаблона |
object (TemplateHeader) Секция заголовка шаблона | |
| lang | string Язык шаблона |
| rejection_reason | string Enum: "abusive_content" "incorrect_category" "invalid_format" "scam" Причина отклонения шаблона (для статуса |
Array of objects or null (TemplateItem) | |
| quality | string Enum: "pending" "high" "medium" "low" Качество шаблона |
object (TemplateExample) Пример шаблона |
[- {
- "body": "Hello {{1}}! Your order #{{2}} for the amount of ${{3}} has been delivered to the pickup point. Thank you for your order!",
- "buttons": {
- "items": [
- {
- "label": "Click me",
- "type": "plain"
}, - {
- "label": "Call us",
- "type": "phone",
- "phone": "+1234567890"
},
]
}, - "category": "MARKETING",
- "footer": "foo bar",
- "header": {
- "content": {
- "type": "text",
- "body": "string"
}
}, - "lang": "en",
- "name": "test template",
- "rejection_reason": "invalid_format",
- "verification_status": "approved",
- "template": [
- {
- "type": 1,
- "text": "string",
- "var": 0
}
], - "quality": "pending",
- "id": 12,
- "channel_id": 34,
- "enabled": true,
- "example": {
- "attachments": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "caption": "string"
}
], - "body": [
- "Max",
- "e3459",
- "328"
], - "buttons": [
- [
- "string"
]
], - "header": [
- "Alex"
]
}, - "code": "DEMO_TEMPLATE",
- "type": "text"
}
]Удаляет созданное сообщение, если канал поддерживает такую операцию
Запрос на удаление сообщения
required | object Идентификатор сообщения |
| channel required | integer <int64> Идентификатор канала |
| action required | string (SystemAction) Enum: "dialog_opened" "dialog_closed" "user_joined" "user_left" "dialog_assign" "customer_blocked" "customer_unblocked" "dialog_unassign" "dialog_tag_added" "dialog_tag_removed" Системное действие сообщения (только для сообщений типа "системное") |
| id required | integer <int64> Идентификатор сообщения |
| time required | string <date-time> Время создания сообщения |
| type required | string (MessageType) Enum: "text" "system" "command" "order" "product" "file" "image" "audio" Тип сообщения |
| scope required | string (MessageScope) Enum: "undefined" "public" "private" Область видимости сообщения |
| chat_id required | integer <int64> Идентификатор чата |
| is_read required | boolean Индикатор прочтения сообщения |
| is_edit required | boolean Индикатор редактирования сообщения |
| status required | string (MessageStatus) Enum: "undefined" "received" "sending" "sent" "failed" "seen" Статус сообщения |
| content | string Текст сообщения |
object (QuoteMessage) Цитируемое сообщение | |
object (UserRef) Сведения о пользователе | |
object (UserRef) Сведения о пользователе | |
| actions | Array of strings (MessageAction) Items Enum: "edit" "delete" "quote" Доступные действия для сообщения |
object (MessageDialog) Диалог сообщения | |
object (MessageError) Подробности ошибки сообщения (только для сообщений со статусом | |
object (UserRef) Сведения о пользователе | |
Array of objects (MessageFile) | |
| note | string Аннотация медиа-данных (для медиа-сообщений) |
object (MessageOrder) Представляет детали заказа в сообщении | |
object (MessageProduct) Описывает товар, упомянутый в сообщении | |
object (MessageTransportAttachments) Транспортные вложения |
{- "channel": 88,
- "message": {
- "id": 45,
- "external_id": "rm2884"
}
}{- "content": "hi there",
- "quote": {
- "id": 45,
- "content": "quote content",
- "from": {
- "id": 56,
- "available": false,
- "email": "demo@user.demo",
- "external_id": "eid3459",
- "first_name": "John",
- "is_blocked": false,
- "is_system": true,
- "is_technical_account": false,
- "last_name": "Doe",
- "name": "John D.",
- "phone": "541-392-2618",
- "type": "user",
- "username": "johndoe."
}, - "items": [
- {
- "id": "c425d178-eb6f-11ec-8ea0-0242ac120002",
- "caption": "demo caption",
- "duration": 345,
- "size": 34534,
- "height": 1080,
- "width": 1920,
- "histogram": [
- 1,
- 34,
- 23,
- 4,
- 32,
- 34,
- 23,
- 12,
- 93,
- 4
], - "kind": "file",
- "transcription": "Sample transcription",
- "type": "application/pdf"
}
], - "time": "2021-12-29T14:18:41Z",
- "type": "text"
}, - "action": "user_joined",
- "responsible": {
- "id": 56,
- "available": false,
- "email": "demo@user.demo",
- "external_id": "eid3459",
- "first_name": "John",
- "is_blocked": false,
- "is_system": true,
- "is_technical_account": false,
- "last_name": "Doe",
- "name": "John D.",
- "phone": "541-392-2618",
- "type": "user",
- "username": "johndoe."
}, - "user": {
- "id": 56,
- "available": false,
- "email": "demo@user.demo",
- "external_id": "eid3459",
- "first_name": "John",
- "is_blocked": false,
- "is_system": true,
- "is_technical_account": false,
- "last_name": "Doe",
- "name": "John D.",
- "phone": "541-392-2618",
- "type": "user",
- "username": "johndoe."
}, - "id": 45,
- "actions": [
- "edit"
], - "chat_id": 56,
- "dialog": {
- "id": 9
}, - "error": {
- "code": "malformed_response",
- "message": "error malformed response"
}, - "from": {
- "id": 56,
- "available": false,
- "email": "demo@user.demo",
- "external_id": "eid3459",
- "first_name": "John",
- "is_blocked": false,
- "is_system": true,
- "is_technical_account": false,
- "last_name": "Doe",
- "name": "John D.",
- "phone": "541-392-2618",
- "type": "user",
- "username": "johndoe."
}, - "is_edit": false,
- "is_read": true,
- "items": [
- {
- "id": "c425d178-eb6f-11ec-8ea0-0242ac120002",
- "caption": "demo caption",
- "duration": 345,
- "size": 34534,
- "height": 1080,
- "width": 1920,
- "histogram": [
- 1,
- 34,
- 23,
- 4,
- 32,
- 34,
- 23,
- 12,
- 93,
- 4
], - "kind": "file",
- "transcription": "Sample transcription",
- "type": "application/pdf"
}
], - "note": "demo note",
- "order": {
- "external_id": 56,
- "cost": {
- "currency": "str",
- "value": 256
}, - "date": "2021-12-29T14:18:37.051393Z",
- "delivery": {
- "address": "2641 Webster St Berkeley, California(CA), 94705",
- "comment": "demo delivery comment",
- "name": "dhl",
- "price": {
- "currency": "str",
- "value": 256
}
}, - "discount": {
- "currency": "str",
- "value": 256
}, - "items": [
- {
- "external_id": 45,
- "name": "demo order item",
- "price": {
- "currency": "str",
- "value": 256
}, - "quantity": {
- "unit": "pcs",
- "value": 5
},
}
], - "number": "23546",
- "payments": [
- {
- "amount": {
- "currency": "str",
- "value": 256
}, - "name": "paid",
- "status": {
- "name": "demo-payment-status",
- "payed": true
}
}
], - "status": {
- "code": "approval",
- "name": "approval"
},
}, - "product": {
- "id": 56,
- "article": "324-DFT-495",
- "cost": {
- "currency": "str",
- "value": 256
}, - "name": "demo product",
- "unit": "string",
}, - "scope": "public",
- "status": "seen",
- "time": "2022-05-30T22:28:55Z",
- "transport_attachments": {
}, - "type": "text"
}Отправляет сообщение
Запрос на отправку сообщения
required | object Определяет содержимое сообщения в запросе на отправку |
| channel required | integer <int64> Идентификатор канала |
object Содержит информацию о клиенте, отправившем сообщение | |
| external_chat_id | string <= 64 characters Внешний идентификатор |
| originator | string Enum: "customer" "channel" "user" Тип отправителя сообщения |
object Идентификатор сообщения | |
| reply_deadline | string <date-time> Крайний срок для ответа |
| secondary_external_chat_ids | Array of strings Массив дополнительных внешних идентификаторов чата |
object Deprecated Содержит информацию о клиенте, отправившем сообщение |
| message_id required | integer <int64> Идентификатор созданного сообщения |
| time required | string <date-time> Время создания сообщения |
| warnings | Array of strings Предупреждения, возникшие при создании сообщения |
{- "channel": 618,
- "customer": {
- "country": "US",
- "email": "customer@customer.demo",
- "external_id": "cs9109",
- "secondary_external_ids": [
- "string"
], - "first_name": "John",
- "language": "en",
- "last_name": "Doe",
- "nickname": "John Doe",
- "phone": "+14844578894",
- "utm": {
- "campaign": "spring_sale",
- "content": "textlink",
- "medium": "cpc",
- "source": "Google",
- "term": "running"
}
}, - "external_chat_id": "c7832",
- "message": {
- "text": "demo text",
- "product": {
- "id": 56,
- "article": "324-DFT-495",
- "cost": {
- "currency": "str",
- "value": 256
}, - "name": "demo product",
- "unit": "string",
}, - "order": {
- "external_id": 56,
- "cost": {
- "currency": "str",
- "value": 256
}, - "date": "2021-12-29T14:18:37.051393Z",
- "delivery": {
- "address": "2641 Webster St Berkeley, California(CA), 94705",
- "comment": "demo delivery comment",
- "name": "dhl",
- "price": {
- "currency": "str",
- "value": 256
}
}, - "discount": {
- "currency": "str",
- "value": 256
}, - "items": [
- {
- "external_id": 45,
- "name": "demo order item",
- "price": {
- "currency": "str",
- "value": 256
}, - "quantity": {
- "unit": "pcs",
- "value": 5
},
}
], - "number": "23546",
- "payments": [
- {
- "amount": {
- "currency": "str",
- "value": 256
}, - "name": "paid",
- "status": {
- "name": "demo-payment-status",
- "payed": true
}
}
], - "status": {
- "code": "approval",
- "name": "approval"
},
}, - "items": [
- {
- "caption": "string",
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}
], - "note": "string",
- "created_at": "2021-08-02T10:11:12",
- "external_id": "m45418",
- "type": "text"
}, - "originator": "customer",
- "quote": {
- "id": 45,
- "external_id": "rm2884"
}, - "reply_deadline": "2021-08-02T10:11:12",
- "secondary_external_chat_ids": [
- "string"
], - "user": {
- "country": "US",
- "email": "customer@customer.demo",
- "external_id": "cs9109",
- "secondary_external_ids": [
- "string"
], - "first_name": "John",
- "language": "en",
- "last_name": "Doe",
- "nickname": "John Doe",
- "phone": "+14844578894",
- "utm": {
- "campaign": "spring_sale",
- "content": "textlink",
- "medium": "cpc",
- "source": "Google",
- "term": "running"
}
}
}{- "message_id": 34,
- "time": "2021-08-02T10:11:12",
- "warnings": [
- "string"
]
}Изменяет созданное сообщение, если канал поддерживает такую операцию
Запрос на редактирование сообщения
required | object (EditMessageRequestMessage) Определяет содержимое сообщения в запросе на редактирование |
| channel required | integer <int64> Канал сообщения |
{- "channel": 46,
- "message": {
- "id": 45,
- "external_id": "rm2884",
- "edited_at": 1652767093,
- "text": "Lorem Ipsum"
}
}{ }Отправляет сообщение из истории
Запрос на отправку сообщения из истории
required | object Определяет содержимое сообщения в запросе на отправку |
| channel_id required | integer <int64> Идентификатор канала |
object Содержит информацию о клиенте, отправившем сообщение | |
| external_chat_id | string <= 64 characters Внешний идентификатор |
| originator | string Enum: "customer" "channel" "user" Тип отправителя сообщения |
object Идентификатор сообщения | |
| reply_deadline | string <date-time> Крайний срок для ответа |
| message_id required | integer <int64> Идентификатор созданного сообщения |
| time required | string <date-time> Время создания сообщения |
| warnings | Array of strings Предупреждения, возникшие при создании сообщения |
{- "channel_id": 618,
- "customer": {
- "country": "US",
- "email": "customer@customer.demo",
- "external_id": "cs9109",
- "secondary_external_ids": [
- "string"
], - "first_name": "John",
- "language": "en",
- "last_name": "Doe",
- "nickname": "John Doe",
- "phone": "+14844578894",
- "utm": {
- "campaign": "spring_sale",
- "content": "textlink",
- "medium": "cpc",
- "source": "Google",
- "term": "running"
}
}, - "external_chat_id": "c7832",
- "message": {
- "text": "demo text",
- "product": {
- "id": 56,
- "article": "324-DFT-495",
- "cost": {
- "currency": "str",
- "value": 256
}, - "name": "demo product",
- "unit": "string",
}, - "order": {
- "external_id": 56,
- "cost": {
- "currency": "str",
- "value": 256
}, - "date": "2021-12-29T14:18:37.051393Z",
- "delivery": {
- "address": "2641 Webster St Berkeley, California(CA), 94705",
- "comment": "demo delivery comment",
- "name": "dhl",
- "price": {
- "currency": "str",
- "value": 256
}
}, - "discount": {
- "currency": "str",
- "value": 256
}, - "items": [
- {
- "external_id": 45,
- "name": "demo order item",
- "price": {
- "currency": "str",
- "value": 256
}, - "quantity": {
- "unit": "pcs",
- "value": 5
},
}
], - "number": "23546",
- "payments": [
- {
- "amount": {
- "currency": "str",
- "value": 256
}, - "name": "paid",
- "status": {
- "name": "demo-payment-status",
- "payed": true
}
}
], - "status": {
- "code": "approval",
- "name": "approval"
},
}, - "items": [
- {
- "caption": "string",
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}
], - "note": "string",
- "created_at": "2021-08-02T10:11:12",
- "external_id": "m45418",
- "type": "text"
}, - "originator": "customer",
- "quote": {
- "id": 45,
- "external_id": "rm2884"
}, - "reply_deadline": "2021-08-02T10:11:12"
}{- "message_id": 34,
- "time": "2021-08-02T10:11:12",
- "warnings": [
- "string"
]
}Подтверждает статус доставки сообщения (успех или ошибка) во внешней системе
Запрос на подтверждение статуса доставки сообщения
| channel required | integer <int64> Идентификатор канала отправки |
| created_at | string <date-time> Дата и время отправки |
object Подробности ошибки, возникшей в процессе отправки | |
object Идентификаторы клиента, определённые транспортом при подтверждении отложенного исходящего сообщения | |
object Идентификаторы чата, определённые транспортом при подтверждении отложенного исходящего сообщения | |
| external_message_id | string Deprecated Внешний идентификатор сообщения |
| transport_message_id | string <= 255 characters Идентификатор сообщения в транспортной системе |
object (MessageIdentifier) Идентификатор сообщения |
{- "channel": 92,
- "created_at": "2021-08-02T10:11:12",
- "error": {
- "code": "customer_not_exists",
- "external_code": "130472",
- "message": "demo message"
}, - "customer": {
- "external_id": "RU.1545487730617822",
- "secondary_external_ids": [
- "string"
], - "phone": "79604598479",
- "first_name": "string",
- "last_name": "string",
- "country": "string",
- "language": "string",
- "email": "user@example.com"
}, - "chat": {
- "external_id": "RU.1545487730617822",
- "secondary_external_ids": [
- "string"
]
}, - "external_message_id": "em3948",
- "transport_message_id": "ydi73-end72-lkmxd-k2en8-827bs",
- "message": {
- "id": 45,
- "external_id": "rm2884"
}
}{ }Помечает все сообщения в чате как прочитанные до указанного сообщения
Запрос на пометку сообщения как прочитанного
required | object Идентификатор сообщения |
| channel_id required | integer <int64> Идентификатор канала отправки |
{- "channel_id": 92,
- "message": {
- "id": 45,
- "external_id": "rm2884"
}
}{ }Помечает все сообщения в канале как прочитанные до указанной метки времени
Запрос на пометку сообщений как прочитанных до указанной даты
| customer_external_id required | string Внешний идентификатор клиента |
| channel_id required | integer <int64> >= 1 Идентификатор канала |
| until required | string <date-time> Дата, до которой сообщения считаются прочитанными |
| ids required | Array of integers <int64> [ items <int64 > ] Идентификаторы сообщений, отмеченных как прочитанные |
{- "channel_id": 145,
- "customer_external_id": "cs9109",
- "until": "2022-10-15T23:20:50.52Z"
}{- "ids": [
- 0
]
}Восстанавливает ранее удалённое сообщение и возвращает его
Запрос на восстановление сообщения
required | object Идентификатор сообщения |
| channel_id required | integer <int64> Идентификатор канала отправки |
| action required | string (SystemAction) Enum: "dialog_opened" "dialog_closed" "user_joined" "user_left" "dialog_assign" "customer_blocked" "customer_unblocked" "dialog_unassign" "dialog_tag_added" "dialog_tag_removed" Системное действие сообщения (только для сообщений типа "системное") |
| id required | integer <int64> Идентификатор сообщения |
| time required | string <date-time> Время создания сообщения |
| type required | string (MessageType) Enum: "text" "system" "command" "order" "product" "file" "image" "audio" Тип сообщения |
| scope required | string (MessageScope) Enum: "undefined" "public" "private" Область видимости сообщения |
| chat_id required | integer <int64> Идентификатор чата |
| is_read required | boolean Индикатор прочтения сообщения |
| is_edit required | boolean Индикатор редактирования сообщения |
| status required | string (MessageStatus) Enum: "undefined" "received" "sending" "sent" "failed" "seen" Статус сообщения |
| content | string Текст сообщения |
object (QuoteMessage) Цитируемое сообщение | |
object (UserRef) Сведения о пользователе | |
object (UserRef) Сведения о пользователе | |
| actions | Array of strings (MessageAction) Items Enum: "edit" "delete" "quote" Доступные действия для сообщения |
object (MessageDialog) Диалог сообщения | |
object (MessageError) Подробности ошибки сообщения (только для сообщений со статусом | |
object (UserRef) Сведения о пользователе | |
Array of objects (MessageFile) | |
| note | string Аннотация медиа-данных (для медиа-сообщений) |
object (MessageOrder) Представляет детали заказа в сообщении | |
object (MessageProduct) Описывает товар, упомянутый в сообщении | |
object (MessageTransportAttachments) Транспортные вложения |
{- "channel_id": 92,
- "message": {
- "id": 45,
- "external_id": "rm2884"
}
}{- "content": "hi there",
- "quote": {
- "id": 45,
- "content": "quote content",
- "from": {
- "id": 56,
- "available": false,
- "email": "demo@user.demo",
- "external_id": "eid3459",
- "first_name": "John",
- "is_blocked": false,
- "is_system": true,
- "is_technical_account": false,
- "last_name": "Doe",
- "name": "John D.",
- "phone": "541-392-2618",
- "type": "user",
- "username": "johndoe."
}, - "items": [
- {
- "id": "c425d178-eb6f-11ec-8ea0-0242ac120002",
- "caption": "demo caption",
- "duration": 345,
- "size": 34534,
- "height": 1080,
- "width": 1920,
- "histogram": [
- 1,
- 34,
- 23,
- 4,
- 32,
- 34,
- 23,
- 12,
- 93,
- 4
], - "kind": "file",
- "transcription": "Sample transcription",
- "type": "application/pdf"
}
], - "time": "2021-12-29T14:18:41Z",
- "type": "text"
}, - "action": "user_joined",
- "responsible": {
- "id": 56,
- "available": false,
- "email": "demo@user.demo",
- "external_id": "eid3459",
- "first_name": "John",
- "is_blocked": false,
- "is_system": true,
- "is_technical_account": false,
- "last_name": "Doe",
- "name": "John D.",
- "phone": "541-392-2618",
- "type": "user",
- "username": "johndoe."
}, - "user": {
- "id": 56,
- "available": false,
- "email": "demo@user.demo",
- "external_id": "eid3459",
- "first_name": "John",
- "is_blocked": false,
- "is_system": true,
- "is_technical_account": false,
- "last_name": "Doe",
- "name": "John D.",
- "phone": "541-392-2618",
- "type": "user",
- "username": "johndoe."
}, - "id": 45,
- "actions": [
- "edit"
], - "chat_id": 56,
- "dialog": {
- "id": 9
}, - "error": {
- "code": "malformed_response",
- "message": "error malformed response"
}, - "from": {
- "id": 56,
- "available": false,
- "email": "demo@user.demo",
- "external_id": "eid3459",
- "first_name": "John",
- "is_blocked": false,
- "is_system": true,
- "is_technical_account": false,
- "last_name": "Doe",
- "name": "John D.",
- "phone": "541-392-2618",
- "type": "user",
- "username": "johndoe."
}, - "is_edit": false,
- "is_read": true,
- "items": [
- {
- "id": "c425d178-eb6f-11ec-8ea0-0242ac120002",
- "caption": "demo caption",
- "duration": 345,
- "size": 34534,
- "height": 1080,
- "width": 1920,
- "histogram": [
- 1,
- 34,
- 23,
- 4,
- 32,
- 34,
- 23,
- 12,
- 93,
- 4
], - "kind": "file",
- "transcription": "Sample transcription",
- "type": "application/pdf"
}
], - "note": "demo note",
- "order": {
- "external_id": 56,
- "cost": {
- "currency": "str",
- "value": 256
}, - "date": "2021-12-29T14:18:37.051393Z",
- "delivery": {
- "address": "2641 Webster St Berkeley, California(CA), 94705",
- "comment": "demo delivery comment",
- "name": "dhl",
- "price": {
- "currency": "str",
- "value": 256
}
}, - "discount": {
- "currency": "str",
- "value": 256
}, - "items": [
- {
- "external_id": 45,
- "name": "demo order item",
- "price": {
- "currency": "str",
- "value": 256
}, - "quantity": {
- "unit": "pcs",
- "value": 5
},
}
], - "number": "23546",
- "payments": [
- {
- "amount": {
- "currency": "str",
- "value": 256
}, - "name": "paid",
- "status": {
- "name": "demo-payment-status",
- "payed": true
}
}
], - "status": {
- "code": "approval",
- "name": "approval"
},
}, - "product": {
- "id": 56,
- "article": "324-DFT-495",
- "cost": {
- "currency": "str",
- "value": 256
}, - "name": "demo product",
- "unit": "string",
}, - "scope": "public",
- "status": "seen",
- "time": "2022-05-30T22:28:55Z",
- "transport_attachments": {
}, - "type": "text"
}Удаляет реакцию из сообщения
Запрос на удаление реакции
required | object Идентификатор сообщения |
| channel required | integer <int64> Идентификатор канала отправки |
| reaction | string Удаляемая реакция |
{- "channel": 88,
- "message": {
- "id": 45,
- "external_id": "rm2884"
}, - "reaction": "string"
}{ }Добавляет одну из разрешённых каналом реакций к сообщению
Запрос на добавление реакции
required | object Идентификатор сообщения |
| channel required | integer <int64> Идентификатор канала отправки |
| reaction required | string Удаляемая реакция |
{- "channel": 88,
- "message": {
- "id": 45,
- "external_id": "rm2884"
}, - "reaction": "string"
}{ }