Created
July 13, 2022 15:56
-
-
Save taf2/b46061ff9d836f9b62d2c76b57fd9a6a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# make a phone call to a given number, play a message and hangup. | |
# export CTM_API_KEY, CTM_API_SECRET and CTM_ENDPOINT you can get them from either /accounts/edit or /agencies/{id}/edit pages | |
# export CTM_ACCOUNT_ID=your account id | |
read -r -d '' request_body << request-json-body | |
{ | |
"call_number": "${TO_NUMBER}", | |
"from_number": "${FROM_NUMBER}", | |
"route": "hangup", | |
"play_message": "say:alice:en-US:hello {{name}} it's time to call back for that super cool thing" | |
} | |
request-json-body | |
curl -XPOST -H'Content-Type:application/json' \ | |
-u $CTM_API_KEY:$CTM_API_SECRET \ | |
$CTM_ENDPOINT/api/v1/accounts/$CTM_ACCOUNT_ID/calls.json \ | |
-d "$request_body" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment