С помощью данного API вы можете получать список созданных чатов, получать информацию о чате, помечать как “прочитанное“ или “закрыть“.
Вы так же можете получать сообщения из переписки или отправлять сообщение.
Чтение.
Позволяет просматривать существующие чаты.
Code Block |
---|
GET https://api.smartsender.eu/v1/chats |
Основные параметры:
Название | Описание | Валидация |
---|---|---|
page | Запрашиваемая страница | Минимальное значение 1 |
limitation | Количество данных для вывода на странице | Минимальное значение 1, максимальное 20 |
В случае успешного ответа получите следующее:
Code Block |
---|
{
"cursor": {
"page": 1,
"pages": 235
},
"collection": [
{
"id": 2196,
"name": "Oleksandr Baday",
"image": "https:\/\/messenger.smartsender.eu\/storage\/projects\/1\/TVZhdSAq9XeqMktQSo7f8qZVHnt4vsy5BmnVt8gl.jpeg",
"contact": {
"id": 3404,
"originalId": 2231
},
"gates": [
{
"id": 3404,
"subscribed": true,
"unreadMessages": 0,
"channel": {
"id": 2,
"active": true,
"occupied": true,
"type": "viber",
"name": "smartsender",
"referrer": 1,
"link": "https:\/\/viber.me\/smartsender",
"app": "viber:\/\/pa?chatURI=smartsender",
"createdAt": "2019-08-02 18:26:33",
"updatedAt": "2019-11-25 15:07:43"
}
}
],
"createdAt": "2019-10-23 16:16:38",
"updatedAt": "2019-11-25 21:43:22"
},
{
"id": 2353,
"name": "Oleksandr Serdiuk",
"image": "https:\/\/messenger.smartsender.eu\/storage\/projects\/1\/moub4Xed0fmScg7G1lk9c7vvPU8Wa1IF7gwHPehZ.jpeg",
"contact": {
"id": 3580,
"originalId": 2387
},
"gates": [
{
"id": 124,
"subscribed": true,
"unreadMessages": 0,
"channel": {
"id": 1,
"active": true,
"occupied": true,
"type": "telegram",
"name": "SmartsenderBot",
"referrer": 1,
"link": "https:\/\/t.me\/SmartsenderBot",
"app": "tg:\/\/resolve?domain=SmartsenderBot",
"createdAt": "2019-08-02 18:26:08",
"updatedAt": "2019-08-02 18:26:08"
}
},
{
"id": 139,
"subscribed": true,
"unreadMessages": 0,
"channel": {
"id": 2,
"active": true,
"occupied": true,
"type": "viber",
"name": "smartsender",
"referrer": 1,
"link": "https:\/\/viber.me\/smartsender",
"app": "viber:\/\/pa?chatURI=smartsender",
"createdAt": "2019-08-02 18:26:33",
"updatedAt": "2019-11-25 15:07:43"
}
},
{
"id": 3010,
"subscribed": true,
"unreadMessages": 0,
"channel": {
"id": 16,
"active": true,
"occupied": true,
"type": "skype",
"name": "SmartSender",
"referrer": 4,
"link": "http:\/\/join.skype.com\/bot\/7b71302e-42da-4bbd-90a9-44526835aa13",
"app": "skype:\/\/28:7b71302e-42da-4bbd-90a9-44526835aa13?chat",
"createdAt": "2019-08-09 17:23:30",
"updatedAt": "2019-08-09 17:23:30"
}
},
{
"id": 3580,
"subscribed": true,
"unreadMessages": 0,
"channel": {
"id": 34,
"active": true,
"occupied": true,
"type": "facebook",
"name": "Smart Sender",
"referrer": 12,
"link": "https:\/\/m.me\/1139181152871740",
"app": "fb-messenger:\/\/1139181152871740",
"createdAt": "2019-11-13 11:08:15",
"updatedAt": "2019-11-13 11:08:15"
}
}
],
"createdAt": "2019-11-13 11:08:50",
"updatedAt": "2020-02-01 16:12:21"
}
]
} |
Описание ответа:
Название | Описание |
---|---|
cursor.page | Запрашиваемая страница |
cursor.pages | Количество страниц с указанным лимитом |
collection.*.id | ID чата |
collection.*.name | Название чата (Имя клиента) |
collection.*.image | Иконка чата (Фото клиента) |
collection.*.createdAt | Дата создания чата |
collection.*.updatedAt | Дата обновления чата |
collection.*.contact.id | Внутренний ID контакта |
collection.*.contact.originalId | Оригинальный ID контакта |
collection.*.gates.*.id | ID шлюза |
collection.*.gates.*.subscribed | Статус подписки на шлюз |
collection.*.gates.*.unreadMessages | Количество непрочитанных уведомлений в шлюзе |
collection.*.gates.*.channel.id | ID канала |
collection.*.gates.*.channel.active | Статус активности канала |
collection.*.gates.*.channel.occupied | Статус подключения канала |
collection.*.gates.*.channel.type | Тип канала |
collection.*.gates.*.channel.name | Название канала |
collection.*.gates.*.channel.referrer | Внутренняя метка отслеживания |
collection.*.gates.*.channel.link | Ссылка на канал |
collection.*.gates.*.channel.app | Ссылка приложения на канал |
collection.*.gates.*.channel.createdAt | Дата создания канала |
collection.*.gates.*.channel.updatedAt | Дата обновления канала |
Получение по ID.
Позволяет получить информацию об указанном чате.
Code Block |
---|
GET https://api.smartsender.eu/v1/chats/{chatId} |
В случае успешного ответа получите следующее:
Code Block |
---|
{
"id": 2120,
"name": "Helena",
"image": "https:\/\/messenger.smartsender.eu\/storage\/projects\/1\/TVZhdSAq9XeqMktQSo7f8qZVHnt4vsy5BmnVt8gl.jpeg",
"contact": {
"id": 3410,
"originalId": 2240
},
"gates": [
{
"id": 3404,
"subscribed": true,
"unreadMessages": 0,
"channel": {
"id": 2,
"active": true,
"occupied": true,
"type": "viber",
"name": "smartsender",
"referrer": 1,
"link": "https:\/\/viber.me\/smartsender",
"app": "viber:\/\/pa?chatURI=smartsender",
"createdAt": "2019-08-02 18:26:33",
"updatedAt": "2019-11-25 15:07:43"
}
}
],
"createdAt": "2019-10-23 16:16:38",
"updatedAt": "2019-11-25 21:43:22"
} |
Описание ответа:
Название | Описание |
---|---|
id | ID чата |
name | Название чата (Имя клиента) |
image | Иконка чата (Фото клиента) |
createdAt | Дата создания чата |
updatedAt | Дата обновления чата |
contact.id | Внутренний ID контакта |
contact.originalId | Оригинальный ID контакта |
gates.*.id | ID шлюза |
gates.*.subscribed | Статус подписки на шлюз |
gates.*.unreadMessages | Количество непрочитанных уведомлений в шлюзе |
gates.*.channel.id | ID канала |
gates.*.channel.active | Статус активности канала |
gates.*.channel.occupied | Статус подключения канала |
gates.*.channel.type | Тип канала |
gates.*.channel.name | Название канала |
gates.*.channel.referrer | Внутренняя метка отслеживания |
gates.*.channel.link | Ссылка на канал |
gates.*.channel.app | Ссылка приложения на канал |
gates.*.channel.createdAt | Дата создания канала |
gates.*.channel.updatedAt | Дата обновления канала |
Прочитать выбранный чат.
Позволяет прочитать все уведомления в выбранном чате.
Code Block |
---|
PUT https://api.smartsender.eu/v1/chats/{chatId}/read |
В случае успешного ответа получите следующее:
Code Block |
---|
{
"state": true
} |
Закрыть выбранный чат.
Позволяет закрыть выбранный чат.
Code Block |
---|
PUT https://api.smartsender.eu/v1/chats/{chatId}/close |
В случае успешного ответа получите следующее:
Code Block |
---|
{
"state": true
} |
Получить сообщения выбранного чат.
Позволяет получить сообщения в выбранном чате
Code Block |
---|
GET https://api.smartsender.eu/v1/chats/{chatId}/messages |
Основные параметры:
Название | Описание | Валидация |
---|---|---|
page | Запрашиваемая страница | Минимальное значение 1 |
limitation | Количество данных для вывода на странице | Минимальное значение 1, максимальное 20 |
……