Перейти к основному содержимому

message.customer

Тело запроса POST на адрес подписки. Заголовки, подпись и повторы описаны в гайде «Вебхуки».

Схема message.customer.v1 собрана из src/backend/contracts/integrations/webhooks/message.customer.v1.json при сборке портала.

Поля​

CustomerMessage​

ПолеТипОбязательноеОписание
conversationConversationда
event_idstring (uuid)да
messageMessageда
occurred_atstring (date-time)да
schema_versionintegerнетПо умолчанию 1.
type"message.customer"даВид варианта: всегда message.customer.

Conversation​

ПолеТипОбязательноеОписание
customer_idstring (uuid)да
idstring (uuid)да
identitiesмассив Identityда
numberstringда
queue_idstring (uuid) или nullнетПо умолчанию null.

Identity​

Подтверждённая личность клиента: по ней система находит его у себя.

ПолеТипОбязательноеОписание
external_idstringда
namespacestringда

Message​

ПолеТипОбязательноеОписание
authorAuthorда
client_message_idstringнетПо умолчанию "".
filesмассив Fileда
hiddenbooleanда
idstring (uuid)да
sent_atstring (date-time)да
sequenceintegerда
textsмассив stringда

Author​

ПолеТипОбязательноеОписание
kindAuthorKindда
namestringнетПо умолчанию "".

AuthorKind​

Значения: "bot", "customer", "operator", "system".

File​

Файл сообщения: GET /api/integration/v1/attachments/{attachment_id}.

ПолеТипОбязательноеОписание
attachment_idstring (uuid)да
mime_typestringда
namestringда
sizeintegerда

JSON Schema​

{
"$defs": {
"Author": {
"properties": {
"kind": {
"$ref": "#/$defs/AuthorKind"
},
"name": {
"default": "",
"type": "string"
}
},
"required": [
"kind"
],
"title": "Author",
"type": "object"
},
"AuthorKind": {
"enum": [
"bot",
"customer",
"operator",
"system"
],
"title": "AuthorKind"
},
"Conversation": {
"properties": {
"customer_id": {
"format": "uuid",
"type": "string"
},
"id": {
"format": "uuid",
"type": "string"
},
"identities": {
"items": {
"$ref": "#/$defs/Identity"
},
"type": "array"
},
"number": {
"type": "string"
},
"queue_id": {
"anyOf": [
{
"format": "uuid",
"type": "string"
},
{
"type": "null"
}
],
"default": null
}
},
"required": [
"id",
"number",
"customer_id",
"identities"
],
"title": "Conversation",
"type": "object"
},
"CustomerMessage": {
"properties": {
"conversation": {
"$ref": "#/$defs/Conversation"
},
"event_id": {
"format": "uuid",
"type": "string"
},
"message": {
"$ref": "#/$defs/Message"
},
"occurred_at": {
"format": "date-time",
"type": "string"
},
"schema_version": {
"default": 1,
"type": "integer"
},
"type": {
"description": "Вид варианта: всегда `message.customer`.",
"enum": [
"message.customer"
]
}
},
"required": [
"type",
"event_id",
"occurred_at",
"conversation",
"message"
],
"title": "CustomerMessage",
"type": "object"
},
"File": {
"description": "Файл сообщения: ``GET /api/integration/v1/attachments/{attachment_id}``.",
"properties": {
"attachment_id": {
"format": "uuid",
"type": "string"
},
"mime_type": {
"type": "string"
},
"name": {
"type": "string"
},
"size": {
"type": "integer"
}
},
"required": [
"attachment_id",
"name",
"mime_type",
"size"
],
"title": "File",
"type": "object"
},
"Identity": {
"description": "Подтверждённая личность клиента: по ней система находит его у себя.",
"properties": {
"external_id": {
"type": "string"
},
"namespace": {
"type": "string"
}
},
"required": [
"namespace",
"external_id"
],
"title": "Identity",
"type": "object"
},
"Message": {
"properties": {
"author": {
"$ref": "#/$defs/Author"
},
"client_message_id": {
"default": "",
"type": "string"
},
"files": {
"items": {
"$ref": "#/$defs/File"
},
"type": "array"
},
"hidden": {
"type": "boolean"
},
"id": {
"format": "uuid",
"type": "string"
},
"sent_at": {
"format": "date-time",
"type": "string"
},
"sequence": {
"type": "integer"
},
"texts": {
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"id",
"sequence",
"author",
"hidden",
"texts",
"files",
"sent_at"
],
"title": "Message",
"type": "object"
}
},
"$ref": "#/$defs/CustomerMessage"
}