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 message |
clientId | string (optional) | External client ID. The parameter has been deprecated, use threadsClientId instead. |
threadsClientId | long (optional) | Internal client ID |
attachments | array of object (optional) | Fields: • url – File URL, a string up to 4,000 characters• name – File name, a string up to 1,000 characters• type – File MIME type, a string up to 256 characters• size – File size in bytes, an integer |
formattedText | string (optional) | Bot’s message. The message might contain Markdown syntax. It is recommended to pass the text representation of the response to the text field for display in the user interface. |
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 – The quick reply type. Possible values are: TEXT for text messages, WEBVIEW for webviews.• text – Text content, a string up to 4,000 characters.• shown_text – Text content, optional parameter, a string up to 2000 characters. It’s used only in the combination with the text parameter. If the 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. |
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