Quick Replies Template
Quick replies provide a way to present a set of up to 11 buttons in-conversation that contain a title and optional image, and appear prominently above the composer.
#
Request URI#
Example Request#
Request Detailsrecipient#
You can pass the user information you want to send the message to api in the recipient object.
Property | Type | Description | Mandatory |
---|---|---|---|
appCustomerId | String | Customer id in your system | Optional |
appStaffId | String | Your staff id. | Optional |
id | String | Unique DLG user id. | Optional |
You can pass the the user information that will receive your message with this object. Your request should only have one of the properties that appCustomerId, appStaffId or id.
There are two unique id for a single user in the DLG platform One of them is DLG user id. This id is created randomly when user registering to the system. Besides of this id, according to the user type, one of the customer id or staff id are stored for the user in DLG.
As a result, you can use one of the customer id or staff id and DLG id in order to send message.
If you know the DLG user id, you can use it for customor or staff.
Using customer id and staff id is more applicable than using DLG user id. Because if you want to use DLG id, you should store all DLG user ids in your system.
message#
Property | Type | Description | Mandatory |
---|---|---|---|
messageId | String | This is a unique id of your message. You should create it in your system and send it to api. If you don't create and sent it to api DLG will create it for you and send it to you in the response of your request. DLG platfrom will feed the events of the messages to your system by this id. You can use it to differenciate events by this id. Therefore, this id is important for following all events of your message by your system. | Optional |
text | String | Text that will send to your user. | Yes |
quickReplies | Array<quickReply> | This field is the old version, but since it is mandatory, it should be added to all requests as empty array like "quickReplies": [] . | Yes |
quickRepliesV2 | Array<quickReplyV2> | The array of quick reply buttons. You should add quickReplyV2 object for each quick reply button that you want to add. | Yes |
quickReply#
This is the old version of the quick reply button object. It has to be set as empty array ("quickReplies" : []).
quickReplyV2#
This is the new version of quick reply button object. It defines the quick reply button properties and behavior.
Property | Type | Description | Mandatory |
---|---|---|---|
contentType | String | This property should be set as "text". | Yes |
title | String | It is the title of the button. | Yes |
payload | String | The value of this property will turn bact to your application when pressed this button by user. | Yes |
payloadHidden | Boolean | The value of this field can be true or false. The default value of it is false. If it set as true, value of the payload will be signed in the user's mobile device by the key of your company before turn back to you. By this way you can be sure about the valid user pressed the button. For checking the signed payload is true or not, you should know the keys that used in signing payload in the mobile device. | Optional |
payloadSeenByUser | String | The value of this property will be displayed in the chat screen of the user when pressed the button. If it does not set, the value of the payload will be displayed in the chat screen. | Optional |
imageUrl | String | You can set icon image to the button by setting this property. You can set uri address of the button of the icon to it. | Optional |
#
ResponseSuccessful API requests return the json object with the answer code http-2XX.
Sample response