Processes the welcome message from the bot (a proactive greeting).
A greeting message can be a text, a text with an attachment, just an attachments (with no text), or a text in Markdown.
The request must have
clientId
or threadsClientId
. clientId
can be only used for authorized clients, threadsClientId
can be used for all. If both parameters are used, clientId
has the priority. Parameter | Type | Description |
text | string (optional) | Bot’s reply to a client’s message |
clientId | string (optional) | External client ID. The parameter has been deprecated, use threadsClientId instead. |
threadsClientId | long (optional) | Internal client ID |
receivedAt | string (optional) | Time when the message was received. The date is in the UTC pattern: yyyy-MM-dd’T’HH:mm:ss.SSS’Z’ |
quickReplies | array (optional) | Fields: • type – Quick reply type. Possible values are: TEXT for text messages.• text – Text content, a string up to 4,000 characters.• shown_text – Text content, optional parameter, a string up to 2,000 characters. It’s used only in the combination with the text parameter. If this parameter is specified, it’s sent as a client message after clicking the quick reply button.• callback_data – Text content, optional parameter, a string up to 255 characters. The name of the event that will be passed when the JS SDK API is called for subsequent processing by the customer on the site side.• imageUrl – Button icon URL, a string up to 4,000 characters.• url – Link to an attached file, string up to 4000 characters.The length and number of quick replies are customized in the database: message.max-quick-replies , message.max-quick-reply-length |
settings | object (optional) | Additional settings for the message |
settings.blockInput | boolean (optional) | The value that defines whether the input field is blocked. Only works with quick replies. |
quickRepliesHeaderFooter | object (optional) | Header and footer. For WhatsApp only. |
quickRepliesHeaderFooter.header | array (optional) | Fields: • text – Header text, up to 61 characters.• imageUrl – image URL• documentUrl – file URL• documentName – filename• videoUrl – video URLYou can send header parameters: text, an image, document, or video. You can use only one type of header in a message. |
quickRepliesHeaderFooter.footer | array (optional) | Fields: • text – Footer text, up to 61 characters. |
messageListPicker | object (optional) | Interactive list. For WhatsApp only. |
messageListPicker.header | object (optional) | Fields: • text – Footer text, up to 60 characters. |
messageListPicker.footer | object (optional) | Fields: • text – Footer text, up to 60 characters. |
messageListPicker.title | string | Name of a button in the interactive list, up to 20 characters |
messageListPicker.sections | array (up to 10 elements in all items) | Fields: • title (string) – Interactive list title, up to 24 characters• title (array) – an array of interactive list elements |
messageListPicker.section.items | array | Fields: • title (string) – Item name, up to 24 characters• subTitle (string) – Optional. Item subtitle, up to 72 characters• identifier (string) – element ID that is returned in the client’s reply |
Curl example
$ curl 'http: //localhost:8080/api/v1/chatbot/greet' -i -X POST \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer <token>' \ -d '{ "clientId": "1", "threadsClientId": 1, "text": "greeting" }'
HTTP Request
POST /api/v1/chatbot/greet HTTP/1.1 Content-Type: application/json Authorization: Bearer <token> Content-Length: 70 Host: localhost: 8080 { "clientId": "1", "threadsClientId": 1, "text": "greeting" }
Example of a Successful HTTP Response
HTTP/1.1 200 OK
Example for a Message with Quick Reply
Curl example
$ curl 'http: //localhost:8080/api/v1/chatbot/stub/greet' -i -X POST \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer <token>' \ -d '{ "action": "INIT_CHAT", "clientId": "1", "threadsClientId": 1, "sessionId": "1", "questionId": 43, "receivedAt": "2022-05-18T08:45:07.259Z", "quickReplies": [ { "type": "TEXT", "text": "quick reply 1", "imageUrl": null, "url": null, "shown_text": null, "callback_data": null }, { "type": "TEXT", "text": "quick reply 2", "imageUrl": null, "url": null, "shown_text": null, "callback_data": null } ], "settings": { "blockInput": true, "masked": false } }'
HTTP Request
POST /api/v1/chatbot/stub/greet HTTP/1.1 Content-Type: application/json Authorization: Bearer <token> Content-Length: 553 Host: localhost: 8080 { "action": "INIT_CHAT", "clientId": "1", "threadsClientId": 1, "sessionId": "1", "questionId": 43, "receivedAt": "2022-05-18T08:45:07.259Z", "quickReplies": [ { "type": "TEXT", "text": "quick reply 1", "imageUrl": null, "url": null, "shown_text": null, "callback_data": null }, { "type": "TEXT", "text": "quick reply 2", "imageUrl": null, "url": null, "shown_text": null, "callback_data": null } ], "settings": { "blockInput": true, "masked": false } }
Example of a Successful HTTP Response
HTTP/1.1 200 OK