Skip to content

Commit 6e8200d

Browse files
authored
Merge pull request Vonage#29 from Nexmo/tony-mms
Support for US LVN in MMS
2 parents d20a860 + bbf4ecc commit 6e8200d

File tree

3 files changed

+39
-3
lines changed

3 files changed

+39
-3
lines changed

config.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ INSIGHT_NUMBER=${INSIGHT_NUMBER:-""}
3939
WEBHOOK_URL=${WEBHOOK_URL:-""}
4040

4141
# MMS
42-
US_SHORT_CODE=${US_SHORT_CODE:-""}
4342
IMG_URL=${IMG_URL:-""}
4443

4544
# Reporting

dispatch/send-mms-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": "mms", "number": '$FROM_NUMBER' },
15+
"to": { "type": "mms", "number": '$TO_NUMBER' },
16+
"message": {
17+
"content": {
18+
"type": "img",
19+
"image": { "url": "$IMG_URL" }
20+
}
21+
},
22+
"failover":{
23+
"expiry_time": 600,
24+
"condition_status": "read"
25+
}
26+
},
27+
{
28+
"from": {"type": "sms", "number": '$FROM_NUMBER'},
29+
"to": { "type": "sms", "number": '$TO_NUMBER'},
30+
"message": {
31+
"content": {
32+
"type": "text",
33+
"text": "This is an SMS sent via the Dispatch API"
34+
}
35+
}
36+
}
37+
]
38+
}'

messages/send-mms-basic-auth.sh renamed to messages/send-mms.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env bash
22

33
source "../config.sh"
4-
source "../jwt.sh"
54

65
curl -X POST https://api.nexmo.com/v0.1/messages \
76
-u "$NEXMO_API_KEY:$NEXMO_API_SECRET" \
@@ -10,7 +9,7 @@ curl -X POST https://api.nexmo.com/v0.1/messages \
109
-d '{
1110
"from":{
1211
"type": "mms",
13-
"number": "$US_SHORT_CODE"
12+
"number": "$FROM_NUMBER"
1413
},
1514
"to":{
1615
"type": "mms",

0 commit comments

Comments
 (0)