Skip to content

Commit 6696cf7

Browse files
committed
Updating SMS API snippets
1 parent 3fbde1f commit 6696cf7

File tree

8 files changed

+45
-45
lines changed

8 files changed

+45
-45
lines changed

messages/rcs/send-text.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ source "../../config.sh"
44
source "../../jwt.sh"
55

66
curl -X POST $MESSAGES_API_URL \
7-
-H 'Authorization: Bearer '$JWT\
8-
-H 'Content-Type: application/json' \
9-
-H 'Accept: application/json' \
10-
-d $'{
11-
"message_type": "text",
12-
"text": "This is an RCS text message sent via the Vonage Messages API",
13-
"to": "'$TO_NUMBER'",
14-
"from": "'$RCS_SENDER_ID'",
15-
"channel": "rcs"
16-
}'
7+
-H 'Authorization: Bearer '$JWT\
8+
-H 'Content-Type: application/json' \
9+
-H 'Accept: application/json' \
10+
-d $'{
11+
"to": "'$TO_NUMBER'",
12+
"from": "'$RCS_SENDER_ID'",
13+
"channel": "rcs",
14+
"message_type": "text",
15+
"text": "This is an RCS text message sent via the Vonage Messages API"
16+
}'

messages/sms/send-sms.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ curl -X POST https://api.nexmo.com/v1/messages \
88
-H 'Content-Type: application/json' \
99
-H 'Accept: application/json' \
1010
-d $'{
11-
"message_type": "text",
12-
"text": "Nexmo Verification code: 12345. Valid for 10 minutes.",
13-
"to": "'$TO_NUMBER'",
14-
"from": "'$FROM_NUMBER'",
15-
"channel": "sms"
16-
}'
11+
"to": "'$TO_NUMBER'",
12+
"from": "'$FROM_NUMBER'",
13+
"channel": "sms",
14+
"message_type": "text",
15+
"text": "This is an SMS sent using the Vonage Messages API."
16+
}'

messaging/sms/send-an-sms-with-unicode.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

messaging/sms/send-an-sms.sh

Lines changed: 0 additions & 9 deletions
This file was deleted.

messaging/sms/send-signed-sms.sh

Lines changed: 0 additions & 9 deletions
This file was deleted.

sms/send-an-sms-with-unicode.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
source '../config.sh'
3+
4+
curl -X POST 'https://rest.nexmo.com/sms/json' \
5+
-d "from=${SMS_SENDER_ID}" \
6+
-d "to=${SMS_TO_NUMBER}" \
7+
-d 'text=こんにちは世界' \
8+
-d "type=unicode" \
9+
-d "api_key=${VONAGE_API_KEY}" \
10+
-d "api_secret=${VONAGE_API_SECRET}"
11+

sms/send-an-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=${SMS_SENDER_ID}" \
6+
-d "to=${SMS_TO_NUMBER}" \
7+
-d 'text=A text message sent using the Vonage SMS API' \
8+
-d "api_key=${VONAGE_API_KEY}" \
9+
-d "api_secret=${VONAGE_API_SECRET}"

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=${SMS_SENDER_ID}" \
6+
-d "to=${SMS_TO_NUMBER}" \
7+
-d 'text=A text message sent using a signed request to the Vonage SMS API' \
8+
-d "api_key=${VONAGE_API_KEY}" \
9+
-d "sig=${SMS_SIGNATURE}"

0 commit comments

Comments
 (0)