Escalation – from SMS/Email to voice call
This example shows two linked-alerts, the 1st uses a stored contact group to send to a number of SMS and emails (in fact using a contact-set), the 2nd, scheduled for 1 hour later then calls any of the original contact-set who did not respond to the SMS or email (either via a direct reply or by the clicking on the embedded shortlink). Note that this example would be a perfect fit for using the /sendalerts API wherein both the 1st and 2nd alert could be specified in a single API call.
First alert
{
"version" : "latest",
"apiKey" : "abcdefghijklmnopqrstuvwxyz",
"clientRef" : "my-reference",
"contactGroup" : {
"storedContactGroup" : "e42b1fd0-70fc-4697-b646-9f0fab7306d0"
},
"linkedAlerts": {
"linkRef": "sms-then-call"
},
"alert" : [
{
"alertType" : "sms",
"tag" : "tag1",
"contactSets" : [ "all" ],
"content" : "A message for {firstname} {lastname}. Click {shortlink} to let us know you've seen this.",
"contentEncoding" : "utf8",
"sender" : "My Company",
"lookups": {
"performLookups": true,
"shortlink": {
"reference": "a-reference",
"url": "https://my-companies-url.com/alertinghub-click-through"
}
}
},
{
"alertType": "email",
"tag": "t2",
"to": "All staff",
"sender": "ACME Trading",
"replyTo": "ACME Trading",
"subject": "Important message",
"contactSets" : [ "all" ],
"content": "An email for {firstname} {lastname}. Click {shortlink} to let us know you've seen this.\n",
"contentEncoding": "utf8",
"lookups": {
"performLookups": true,
"shortlink": {
"reference": "a-reference",
"url": "https://my-companies-url.com/alertinghub-click-through"
}
}
}
]
}
Second alert
{
"version" : "latest",
"apiKey" : "abcdefghijklmnopqrstuvwxyz",
"clientRef" : "my-reference",
"linkedAlerts": {
"linkRef": "sms-then-call"
},
"alert" : [
{
"alertType": "call",
"sender": "+447777100100",
"options": {
"schedule": {
"start": "now",
"delay": "1h"
}
},
"linkedAlertModifiers": {
"except": {
"previouslySeen": "sms,email,shortlink"
}
},
"contactSets" : [ "all" ],
"tag": "t1",
"voiceFormat": "tts",
"content": "Hello, this is a message for {firstname} {lastname}. Please press any key and then hangup. Thank you.",
"contentEncoding": "utf8",
"ivrControl":
"ivrRequireResponse": true,
"ivrAttempts" : 3
},
"lookups": {
"performLookups": true,
"uniqueLookups": true
}
}
]
}
