post https://message-dev.aylanetworks.com/messageservice/v1/destinations.json
This API creates a message service destination. The following types are supported:
Type | Provider | Required Fields |
---|---|---|
smtp | type, body or message_template_id, deliver_to | |
sms | twilio, yunpian | type, body, country_code, deliver_to |
push | fcm, apns | type, app_id, body, deliver_to, meta_data |
{
"destination": {
"type": "email",
"body": "Your downstairs leak detector at 1234 Ayla Avenue has a low battery",
"message_template_id": "TestTemplateId",
"deliver_to": nulla,
"contact_id" : 123,
"title": "Hello Ayla User",
"provider": "smtp",
"user_message": "Hello Ayla User",
"user_name": "Methew Hedan",
"repeat_freq": 30
}
}
{
"destination": {
"type": "sms",
"body": "Leak detector battery is low.",
"country_code": "+91",
"deliver_to": "9100008888",
"provider": "twilio",
"repeat_freq": 30
}
}
{
"destination": {
"app_id": "app_XXXXXX_0-sA-id",
"body": "Your downstairs leak detector at 1234 Ayla Avenue has a low battery",
"deliver_to": "18610E3F420EXXXXXXXXXXXXXXXXXXBAC80FC9A529FF48C2ADE28EC892",
"meta_data": "{\"metadata\":\"push metadata\",\"attributes.fcm\":{\"priority\":\"normal\",\"ttl\":20}}",
"provider": "fcm",
"sound": "chime",
"title": "Auro-App Notification",
"type": "push"
}
}
{
"destination": {
"type": "push",
"app_id": "app_XXXXX_01-sA-id",
"body": "Your downstairs leak detector at 1234 Ayla Avenue has a low battery",
"deliver_to": "18610E3F42XXXXXXXXXXXXXXXXXXXXXXXXXC80FC9A529FF48C2ADE28EC892",
"meta_data": "{\"metadata\":\"push metadata\",\"attributes.apns\":{\"priority\":10,\"ttl\":501}}",
"provider": "apns",
"repeat_freq": 30,
"sound": "chime",
"title": "Auro-App Notification"
}
}
The following table describes the parameters related to the email destination type:
Parameter name | Mandatory/optional | Description |
---|---|---|
type | Mandatory | Type of the destination you want to create. |
body | Optional if messge_template_id is passed, otherwise mandatory. | The content of the email message. |
message_template_id | Optional if body is passed, otherwise mandatory. | Unique identifier of the template to be used. The specified template will be used to show the email message to the endusers. |
deliver_to | Optional if contact_id is passed, otherwise mandatory. | Email address of the user. |
contact_id | Optional if deliver_to is passed, otherwise mandatory. | Contact ID of the user. |
title | Optional | Subject of email. |
provider | Optional | Indicates the networking standard used to send the email. Possible value: smtp |
user_message | Optional | |
user_name | Optional | user name. |
repeat_freq | Optional | Repeat frequency for destinations in seconds. |