You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Diyalog Messenger Platform Messaging API Reference
1. Sending Messages
Many types of content can be sent with Diyalog Messenger Platform including text, audio, images, video, files.
There are also some pre-defined messages templates available. You can send structured messages for a good user experience. All these messaging templates are copied from Facebook Messenger 😃 in order to compatibility with fb messenger. Therefore, you can directly integrate your as is facebook bot application to Diyalog Messenger platform.
It declares the recipient of the message. Request must include one of id, appCustomerId
Property
Type
Description
Required
recipient.id
String
It is id of user in Diyalog platform. If you know it, you can directly use Diyalog user id.
Optional
receipient.appCustomerId
String
You can use direct customer id of your system. But Diyalog seesion should be created with this customer id. If you are using Token base authentication of DiyalogSDK in your client application, system will create user and save the customer id.
Optional
message
Property
Type
Description
Required
message.messaging_type
String
Not Appicable - It is fb messenger default. It will be used later version of Diyalog Platform.
No
message.tag
String
Not Appicable - It is fb messenger default. It will be used later version of Diyalog Platform.
No
message.text
String
it is text message that will send to recipient. If you send text message you should set it, for other type of messages, you shoud set attachment property instead of text.
Optional
message.attachment
Object
it is used to define message content other than text messages. If you want to send message other than text you should set attachment property instead of text.
Unique user id that message sent in Diyalog platform
message_id
Object
Unique id of the sent message in Diyalog Platform
2.Template Reference
2.1 Generic Template Reference
The generic template allows you to send a structured message that includes an image, text and buttons. A generic template with multiple templates described in the elements array will send a horizontally scrollable carousel of items, each composed of an image, text and buttons. For complete implementation details, see Generic Template.
It declares the recipient of the message. Request must include one of id, appCustomerId
Property
Type
Description
Required
id
String
It is id of user in Diyalog platform. If you know it, you can directly use Diyalog user id.
Optional
appCustomerId
String
You can use direct customer id of your system. But Diyalog seesion should be created with this customer id. If you are using Token base authentication of DiyalogSDK in your client application, system will create user and save the customer id.
Optional
message
Property
Type
Description
Required
attachment
Object
It contains payload od the generic template content
An array of element objects that describe instances of the generic template to be sent. Specifying multiple elements will send a horizontally scrollable carousel of templates. A maximum of 10 elements is supported.
An array of buttons to append to the template. A maximum of 3 buttons per element is supported. If you don't add any button you should set empty array [].
yes
default_action
Property
Type
Description
Required
type
String
Default action is only support url button. Value must be "web_url".
yes
url
String
The url address that will open when tapped to content
yes
webview_height_ratio
String
Value must be *FULL"
yes
button
Property
Type
Description
Required
type
String
Type of the button. It can be web_url and postback
yes
title
String
Button title that will show in the button text.
yes
payload_hidden
Boolean
This flag is valid for postback type button. You may want to signed your postback data by client application secrets. If you set this flag is true, Diyalog client sdk will signed postback by calling your application extension that has signData method.
Optional
payload
String
Payload data that you want to turn back to your application. This will only return, if button type is postback. In web url you can set it to empty string.
yes
2.2 Button Template Reference
The button template allows you to send a structured message that includes text and buttons.
The button template sends a text message with up to three attached buttons. This template is useful for offering the message recipient options to choose from, such as pre-determined responses to a question, or actions to take.
It declares the recipient of the message. Request must include one of id, appCustomerId
Property
Type
Description
Required
id
String
It is id of user in Diyalog platform. If you know it, you can directly use Diyalog user id.
Optional
appCustomerId
String
You can use direct customer id of your system. But Diyalog seesion should be created with this customer id. If you are using Token base authentication of DiyalogSDK in your client application, system will create user and save the customer id.
Optional
message
Property
Type
Description
Required
attachment
Object
It contains payload od the button template content
yes
quick_replies
Array<quick_reply>
This property will not used in generic template. It should be set empty array. []
yes
message.attachment
Property
Type
Description
Required
type
String
Value must be template
yes
payload
Object
Payload of the generic template
yes
message.attachment.payload
Property
Type
Description
Required
template_type
String
Value must be button
yes
text
String
Message text that will show on top of the template
This property will not used in generic template. It should be set empty array. []
yes
2.3 Quick Reply Template Reference
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.
It declares the recipient of the message. Request must include one of id, appCustomerId
Property
Type
Description
Required
id
String
It is id of user in Diyalog platform. If you know it, you can directly use Diyalog user id.
Optional
appCustomerId
String
You can use direct customer id of your system. But Diyalog seesion should be created with this customer id. If you are using Token base authentication of DiyalogSDK in your client application, system will create user and save the customer id.
Optional
message
Property
Type
Description
Required
text
String
Message text that will show on top of the template