Skip to content

Instantly share code, notes, and snippets.

@thiagomr
Created June 28, 2016 17:56
Show Gist options
  • Select an option

  • Save thiagomr/a9f82b8570407f8ee9b9039078958f08 to your computer and use it in GitHub Desktop.

Select an option

Save thiagomr/a9f82b8570407f8ee9b9039078958f08 to your computer and use it in GitHub Desktop.
#!/bin/bash
export server="https://sms-api-pointer.pontaltech.com.br/v1/single-sms"
export token="$1"
export number="$2"
export message="$3"
export numbers=(${number//,/ })
for i in "${!numbers[@]}"
do
curl -s -X POST -H "Authorization: Basic '$token'" \
-H "Cache-Control: no-cache" \
-d '{ "to": '${numbers[i]}', "message": '"\"$message\""' }' \
'"'$server'"'
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment