Skip to content

Commit 8f99662

Browse files
author
Tony Bedford
authored
Merge pull request Vonage#77 from Nexmo/tony-add-sms-failover
Add sms to sms failover snippet
2 parents 0e0114a + b8ae905 commit 8f99662

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

dispatch/send-sms-with-failover.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/env bash
2+
3+
source "../config.sh"
4+
source "../jwt.sh"
5+
6+
curl -X POST https://api.nexmo.com/v0.1/dispatch \
7+
-H 'Authorization: Bearer '$JWT\
8+
-H 'Content-Type: application/json' \
9+
-H 'Accept: application/json' \
10+
-d $'{
11+
"template":"failover",
12+
"workflow": [
13+
{
14+
"from": { "type": "sms", "number": '$FROM_NUMBER' },
15+
"to": { "type": "sms", "number": '$TO_NUMBER_1' },
16+
"message": {
17+
"content": {
18+
"type": "text",
19+
"text": "Dispatch API: Message 1"
20+
}
21+
},
22+
"failover":{
23+
"expiry_time": 60,
24+
"condition_status": "read"
25+
}
26+
},
27+
{
28+
"from": {"type": "sms", "number": '$FROM_NUMBER'},
29+
"to": { "type": "sms", "number": '$TO_NUMBER_2'},
30+
"message": {
31+
"content": {
32+
"type": "text",
33+
"text": "Dispatch API: Message 2"
34+
}
35+
}
36+
}
37+
]
38+
}'

0 commit comments

Comments
 (0)