Trigger App Message
Trigger App Message is a message type that allows you to send a command to your main application. The text you forward in this message template is displayed on both the notification and dialog list screens. When the mobile user clicks on this notification or this message from the dialog list, the command and data you pass in the message to your main application will be triggered as an event.
This message type allows you to initiate an action remotely from the device of the relevant mobile user. For example, you can open a confirmation screen with this message you sent to your customer. The command and data fields in this message are completely parametric. This command and data information must be mutually determined between your mobile application and the application sending the message, and codes that will initiate the necessary action in the mobile client must be developed according to this information.
#
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 |
trigger | Object | trigger object that has content of the message. | Yes |
quickReplies | Array<quickReply> | It should be set as empty array. ("quickReplies" : []) | Yes |
quickRepliesV2 | Array<quickReplyV2> | It should be set as empty array. ("quickRepliesV2" : []) | Yes |
trigger#
trigger is an object that contains commands and data parameters that tell you what action to take in your main application. The commands and data transmitted within the trigger object are transmitted to the main application in an event
Property | Type | Description | Mandatory |
---|---|---|---|
command | String | It is the command information you want to pass to your main application. | Yes |
data | String | You can use this field to transmit the data related to the command along with the command to your main application. You can use this field to transmit the data related to this command along with the command to your main application. Even if you are not going to send any data, it should be given as empty string. | Yes |
#
ResponseSuccessful API requests return the json object with the answer code http-2XX.
Sample response