0

I have tried to send bulk sms in Twillio for a while.

Which I done things; Firstly, I created a service in Messaging Services page. And then, I created a notify services with message service sid in Notify Services page.

After those, I requested with Postman following cURL code.

How to do this? Do I definitely have to create binding before I send bulk sms?

    curl --location --request POST 'https://notify.twilio.com/v1/Services/IS1111111111111111/Notifications' \
--header 'Authorization: Basic ZmRnZGZnZGY6ZmRnZGZn' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'Body=xyz message' \
--data-urlencode 'ToBinding=[{"binding_type":"sms", "address":"+12345"},{"binding_type":"sms", "address":"+123456"}]'

Response:

{
    "code": 20001,
    "message": "Can not convert incoming parameters to Notification object: Parameter 'ToBinding' is invalid",
    "more_info": "https://www.twilio.com/docs/errors/20001",
    "status": 400
}
Fatma Seda
  • 19
  • 6

1 Answers1

2

Twilio developer evangelist here.

Have you seen this StackOverflow question and answers?

This Postman setup works: Postman for bulk SMS

Under Body > Form-data, enter a ToBinding key value pair for each number. In the key field, enter "ToBinding" and in the value field, enter the following syntax for a phone number:

{"binding_type":"sms", "address":"YOUR-PHONE-NUMBER"}
lizziepika
  • 3,231
  • 1
  • 14
  • 23
  • Actually, I haven't seen this page. I have tried this code before. Probably, some information wasn't true and upon this, when I see comments of Twillio's video( https://www.youtube.com/watch?v=EMOYY58jyKk&ab_channel=Twilio ), I thought it was right of my last request. But now, I was able to make request as succes. Just, sms dosen't trasmitted for some telephone operator.( Even if it seem transmitted in Twillio logs) Likely, this problem is related with telephone operator. Thank you for comment. Have a nice day. – Fatma Seda Oct 24 '22 at 14:13