Skip to content

Commit 6b45e20

Browse files
author
Luke Oliff
authored
Merge pull request Vonage#92 from 3t8/patch-2
Added send-signed-sms snippet
2 parents e8041a6 + 80bf088 commit 6b45e20

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

config.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ NEXMO_API_SECRET=${NEXMO_API_SECRET:-""}
44

55
NEXMO_APPLICATION_ID=${NEXMO_APPLICATION_ID:-""}
66
NEXMO_PRIVATE_KEY=${NEXMO_PRIVATE_KEY:-""}
7+
NEXMO_SIGNATURE_SECRET=${NEXMO_SIGNATURE_SECRET:-""}
78

89
TO_NUMBER=${TO_NUMBER:-""}
910
RECIPIENT_NUMBER=${RECIPIENT_NUMBER:-""}

messaging/sms/send-signed-sms.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
source "../../config.sh"
3+
4+
curl -X "POST" "https://rest.nexmo.com/sms/json" \
5+
-d "from=$FROM_NUMBER" \
6+
-d "text=A text message sent using the Nexmo SMS API" \
7+
-d "to=$TO_NUMBER" \
8+
-d "api_key=$NEXMO_API_KEY" \
9+
-d "sig=$NEXMO_SIGNATURE_SECRET"

0 commit comments

Comments
 (0)