Skip to content

Commit db8a707

Browse files
author
Tony Bedford
authored
Merge pull request Vonage#64 from Nexmo/tony-whatsapp-button-links
button links
2 parents 47c8dcc + 7019819 commit db8a707

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
#!/usr/bin/env bash
2+
3+
source "../../config.sh"
4+
source "../../jwt.sh"
5+
6+
curl -X POST \
7+
https://api.nexmo.com/v0.1/messages \
8+
-H 'Authorization: Bearer' $JWT \
9+
-H 'Content-Type: application/json' \
10+
-d '{
11+
"from": {
12+
"type": "whatsapp",
13+
"number": "'$WHATSAPP_NUMBER'"
14+
},
15+
"to": {
16+
"type": "whatsapp",
17+
"number": "'$TO_NUMBER'"
18+
},
19+
"message": {
20+
"content": {
21+
"type": "custom",
22+
"custom": {
23+
"type": "template",
24+
"template": {
25+
"namespace": "88b39973_f0d5_54e1_29cf_e80f1e3da4f2",
26+
"name": "oculus_shipment_update",
27+
"language": {
28+
"code": "en",
29+
"policy": "deterministic"
30+
},
31+
"components": [
32+
{
33+
"type": "header",
34+
"parameters": [
35+
{
36+
"type": "image",
37+
"image": {
38+
"link": "'$HEADER_IMAGE_LINK'"
39+
}
40+
}
41+
]
42+
},
43+
{
44+
"type": "body",
45+
"parameters": [
46+
{
47+
"type": "text",
48+
"text": "Anand"
49+
},
50+
{
51+
"type": "text",
52+
"text": "Quest"
53+
},
54+
{
55+
"type": "text",
56+
"text": "113-0921387"
57+
},
58+
{
59+
"type": "text",
60+
"text": "23rd Nov 2019"
61+
}
62+
]
63+
},
64+
{
65+
"type": "button",
66+
"index": "0",
67+
"sub_type": "url",
68+
"parameters": [
69+
{
70+
"type": "text",
71+
"text": "1Z999AA10123456784"
72+
}
73+
]
74+
}
75+
]
76+
}
77+
}
78+
}
79+
}
80+
}'

0 commit comments

Comments
 (0)