api-snippets icon indicating copy to clipboard operation
api-snippets copied to clipboard

"ToBinding" does not work as shown in the CURL example

Open Vaccano opened this issue 6 years ago • 0 comments

I cannot get his example to work: notifications/sms-quickstart/send-notification-to-number/send-notification-to-number.curl

Here is what my call looks like:

 curl -X POST "https://notify.twilio.com/v1/Services/IS<My Private Value Here>/Notifications" --data-urlencode 'ToBinding={"binding_type":"sms", "address":"+18011234567"}' --data-urlencode 'Body=Test Message' -u 'AC1828d273602b76952c34368876b889a9:<My Token Here>'

When I run that, I get this 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
}

The key part there is "Parameter 'ToBinding' is invalid". But I have checked it letter by letter so many times. It is exactly like the example.

NOTE: I tried it first using "bindings" stored by Twilio. I seem to have no problems with that method. This command sends the text message just fine:

curl -X POST "https://notify.twilio.com/v1/Services/IS<My Private Value Here/Notifications" --data-urlencode 'Identity=00000001' --data-urlencode 'Body=Test Message' -u 'AC1828d273602b76952c34368876b889a9:<My Token Here>'

Note: I posted this on Stack Overflow and someone there suggested I ask the Twilio developers.

Vaccano avatar Sep 03 '19 17:09 Vaccano