Sorry, you need to enable JavaScript to visit this website.

You are here

Unable to send SMS to multiple numbers

2 posts / 0 new
Last post

Gunter's picture
by Gunter

Unable to send SMS to multiple numbers
I have converted my scripts to use the new v2 API.  Using the free plan for now until I get everything working. I can send a SMS to a single number, but when I try to send a test message to multiple numbers it fails.  Using the following curl command in a BASH script: Using a single destination number works:
curl -X POST -H "Authorization: Bearer <my_access_token_here>" -H "Content-Type: application/json" -d '{ "to":"+61419876543", "body":"Test Message" }' https://tapi.telstra.com/v2/messages/sms
However, using multiple numbers fails:
curl -X POST -H "Authorization: Bearer <my_access_token_here>" -H "Content-Type: application/json" -d '{ "to":"+61419876543, +61401234567", "body":"Test Message" }' https://tapi.telstra.com/v2/messages/sms
The response I get back is:
{   "status":"400",   "code":"TECH-ERR",   "message":"Request flagged as containing invalid body. Request has been refused." }
I also tried it with the "from":"+61472876123" (my provisioned number) included in the -d '{...}' part of the command with the same results. What am I missing here?

DeveloperSteve's picture
by DeveloperSteve

Hi CSCUnixTeam

Ah it needs to be an array, Try the mulitple to: numbers as an array.

Just noticed the docs say to use a string, ill get that updated as it needs to be an array (just tested it).  

Log in or register to post comments