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

You are here

TO-MSISDN-TOO-LONG error

2 posts / 0 new
Last post

Warren's picture
by Warren

TO-MSISDN-TOO-LONG error
Trying to send to multiple "TOs" for the first time. Am getting error 400 "TO-MSISDN-TOO-LONG Refer to API docs at ...". That page lists that as a possible error but unhelpfully does not explain what the cause might be. Any clues?    

Michelle's picture
by Michelle

Resolved: TO-MSISDN-TOO-LONG error

Hi Warren,

I see you have resolved this issue, but thought I'd leave the resolution for the benefit of future users. Let me know if you found another way around it!

The reason you get the 400 TO-MSISDN-TOO-LONG  is that you are passing the multiple numbers on the "To" field using string format. See this example below.
     {
       "to": "+61412345678, +61487654321",           #incorrect use of string
       "body": "Sending multiple MSISDN",
       "from": "Telstra Test",
       "validity": 5,
       "scheduledDelivery": 1,
       "notifyURL": "http://www.example.com/",
       "replyRequest": false,
       "priority": true
     }

As Stated on the API documentation(https://dev.telstra.com/content/messaging-api#operation/sendSms), the multiple "To" numbers should be passed as an array of strings separated by a comma.

You can refer to this sample payload sample

     {
       "to": [
         "+61412345678", "+61487654321"
        ],                                                                    #correct use of array
        "body": "Sending multiple MSISDN",
        "from": "Telstra Test",
        "validity": 5,
        "scheduledDelivery": 1,
        "notifyURL": "http://www.example.com/",
        "replyRequest": false,
        "priority": true
     }

Please let us know if you have other questions or concerns.

Michelle from TelstraDev

Log in or register to post comments