mirror of
https://github.com/therootcompany/golib.git
synced 2026-03-02 23:57:59 +00:00
feat(cmd/sendsms): add back curl script for testing
This commit is contained in:
parent
de8630c136
commit
c08f7e342a
@ -3,3 +3,4 @@
|
|||||||
export SMSGW_BASEURL=https://smsgateway.example.com
|
export SMSGW_BASEURL=https://smsgateway.example.com
|
||||||
export SMSGW_USERNAME=sms
|
export SMSGW_USERNAME=sms
|
||||||
export SMSGW_PASSWORD=xxxx-xxxx-xxxx-xxxx
|
export SMSGW_PASSWORD=xxxx-xxxx-xxxx-xxxx
|
||||||
|
export SMSGW_TEST_NUMBER=+18005551234
|
||||||
|
|||||||
18
cmd/sendsms/sms-curl.sh
Executable file
18
cmd/sendsms/sms-curl.sh
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# 2020-02-20 02:20:22
|
||||||
|
g_ts=$(date '+%F %T')
|
||||||
|
. ./.env
|
||||||
|
|
||||||
|
curl --fail-with-body -X POST "${SMSGW_BASEURL}/messages" \
|
||||||
|
--user "${SMSGW_USERNAME}:${SMSGW_PASSWORD}" \
|
||||||
|
-H 'Content-Type: application/json' \
|
||||||
|
--data-binary '
|
||||||
|
{
|
||||||
|
"textMessage":{
|
||||||
|
"text": "Test message. It'\''s '"${g_ts}"'"
|
||||||
|
},
|
||||||
|
"phoneNumbers": ["'"${SMSGW_TEST_NUMBER}"'"],
|
||||||
|
"priority":65
|
||||||
|
}
|
||||||
|
'
|
||||||
Loading…
x
Reference in New Issue
Block a user