sample-code
sample-code copied to clipboard
Send an SMS Notification docs incorrect & failing?
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'
})
]
)
You are correct, I had the same problem, made the same modifications as you and it worked.
Twilio should review their documentation.
same in Python, issue affects all programming languages