Create destination

This API creates a message service destination. The following types are supported:

TypeProviderRequired Fields
emailsmtptype, body or message_template_id, deliver_to
smstwilio, yunpiantype, body, country_code, deliver_to
pushfcm, apnstype, 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 nameMandatory/optionalDescription
typeMandatoryType of the destination you want to create.
bodyOptional if messge_template_id is passed, otherwise mandatory.The content of the email message.
message_template_idOptional 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_toOptional if contact_id is passed, otherwise mandatory.Email address of the user.
contact_idOptional if deliver_to is passed, otherwise mandatory.Contact ID of the user.
titleOptionalSubject of email.
providerOptionalIndicates the networking standard used to send the email.
Possible value: smtp
user_messageOptional
user_nameOptionaluser name.
repeat_freqOptionalRepeat frequency for destinations in seconds.
Language
Authorization
Header
Click Try It! to start a request and see the response here!