Skip to content

Instantly share code, notes, and snippets.

@taf2
Created July 13, 2022 15:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taf2/b46061ff9d836f9b62d2c76b57fd9a6a to your computer and use it in GitHub Desktop.
Save taf2/b46061ff9d836f9b62d2c76b57fd9a6a to your computer and use it in GitHub Desktop.
#!/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