Greet

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 threadsClientIdclientId can be only used for authorized clients, threadsClientId can be used for all. If both parameters are used, clientId has the priority.
ParameterTypeDescription
textstring (optional)Bot’s reply to a client’s message
clientIdstring (optional)External client ID. The parameter has been deprecated, use threadsClientId instead.
threadsClientIdlong (optional)Internal client ID
receivedAtstring (optional)Time when the message was received. The date is in the UTC pattern: yyyy-MM-dd’T’HH:mm:ss.SSS’Z’
quickRepliesarray (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-repliesmessage.max-quick-reply-length
settingsobject (optional)Additional settings for the message
settings.blockInputboolean (optional)The value that defines whether the input field is blocked. Only works with quick replies.
quickRepliesHeaderFooterobject (optional)Header and footer. For WhatsApp only.
quickRepliesHeaderFooter.headerarray (optional)Fields:
• text – Header text, up to 61 characters.
• imageUrl – image URL
documentUrl – file URL
• documentName – filename
• videoUrl – video URL
You can send header parameters: text, an image, document, or video. You can use only one type of header in a message.
quickRepliesHeaderFooter.footerarray (optional)Fields:
• text – Footer text, up to 61 characters.
messageListPickerobject (optional)Interactive list. For WhatsApp only.
messageListPicker.headerobject (optional)Fields:
• text – Footer text, up to 60 characters.
messageListPicker.footerobject (optional)Fields:
• text – Footer text, up to 60 characters.
messageListPicker.titlestringName of a button in the interactive list, up to 20 characters
messageListPicker.sectionsarray (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.itemsarrayFields:
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