sample-code icon indicating copy to clipboard operation
sample-code copied to clipboard

Send an SMS Notification docs incorrect & failing?

Open phaseOne opened this issue 6 years ago • 2 comments

https://github.com/twilio/sample-code/blob/8778483e064ba571523fa5cc32e677fe5844e7a5/notify/v1/notification/create-send-notification-to-number/create-send-notification-to-number.3.x.js#L9-L16

The above fails with an error in Node:

Error: Direct notifications and query notifications can not be requested together

Which is undocumented behavior...

I believe the above example should omit the identity object, unless something is broken elsewhere, or I'm missing something:

.create({ 
  body: 'Knok-Knok! This is your first Notify SMS', 
  toBinding: [
    JSON.stringify({ 
      binding_type: 'sms', 
      address: '+1651000000000' 
    })
  ]
)

phaseOne avatar Jul 05 '18 18:07 phaseOne

You are correct, I had the same problem, made the same modifications as you and it worked.

Twilio should review their documentation.

ezequieltejada avatar Nov 08 '18 23:11 ezequieltejada

same in Python, issue affects all programming languages

dmitrij-schmidt avatar Dec 03 '18 20:12 dmitrij-schmidt