Receiving messages
You need to create a service, that can receive POST requests to receive messages from Creatio. In the POST request’s body - JSON with information about the received message.
Currently, several types of messages are supported: with buttons, without buttons, file, picture, and location. The type is specified in the type parameter. If the message type is push-button, it may also contain text that comes before the buttons.
Request specification
Name | Description | Data type | Comments |
---|---|---|---|
channel_id | Channel Id in Creatio | string |
|
receiver_id | Id of user, tat receives messages in your channel | string |
|
type | Type of message sent | string | text, buttons, file, image, location, operator_info |
content | Buttons sent | Content |
|
Specification of Content class
Name | Description | Data type | Comments |
---|---|---|---|
text | Text before buttons | string | f the message type is a file or picture, then a link to the file or picture. If location, then location object |
buttons | Buttons text | string[] |
|
operatorInfo | Information about operator | OperatorInfo | If the request type is operator_info |
Specification of Location class
Name | Description | Data type | Comments |
---|---|---|---|
lat | Latitude | string |
|
lng | Longtitude | string |
|
Specification of OperatorInfo class
Name | Describtion | Date type | Comments |
OperatorPhotoLink | Link to the operator’s photo | string |
|
OperatorName | Operator name | string |
|
For correct operation, you must return 200 OK for each request to your Endpoint.
If the channel settings are ticked "Send information about the operator", then an operator_info type message will be sent.
An example of a received JSON message with text type
{
"channel_id" : "28528776-3130-4C66-E811-08D55CEAB346",
"receiver_id" : "123",
"type" : "text",
"content" :
{
"text" : "test",
"buttons" : []
},
"operatorInfo": ""
}