Permalink
Switch branches/tags
Find file Copy path
6af199a Oct 23, 2018
2 contributors

Users who have contributed to this file

@tbedford @gahag
executable file 39 lines (36 sloc) 1009 Bytes
#!/usr/bin/env bash
source "../config.sh"
source "../jwt.sh"
curl -X POST https://api.nexmo.com/v0.1/dispatch \
-u "$NEXMO_API_KEY:$NEXMO_API_SECRET" \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d $'{
"template":"failover",
"workflow": [
{
"from": { "type": "messenger", "id": '$FB_SENDER_ID' },
"to": { "type": "messenger", "id": '$FB_RECIPIENT_ID' },
"message": {
"content": {
"type": "text",
"text": "This is a Facebook Messenger Message sent from the Dispatch API"
}
},
"failover":{
"expiry_time": 600,
"condition_status": "read"
}
},
{
"from": {"type": "sms", "number": '$FROM_NUMBER'},
"to": { "type": "sms", "number": '$TO_NUMBER'},
"message": {
"content": {
"type": "text",
"text": "This is an SMS sent from the Dispatch API"
}
}
}
]
}'