danielberkompas / ex_twilio

Twilio API client for Elixir
MIT License
336 stars 147 forks source link

Example of Notify usage #144

Open dchohfi opened 3 years ago

dchohfi commented 3 years ago

Hi, I'm trying to use the Notify service and I always get

{:error,
 %{
   "code" => 20404,
   "message" => "The requested resource /Notifications was not found",
   "more_info" => "https://www.twilio.com/docs/errors/20404",
   "status" => 404
 }, 404}

It works using cURL, the Messaging Services is created under console and I'm using the right SID.

Code used:

ExTwilio.Notify.Notification.create(%{sid: "#{sid}", to_binding: "{\"binding_type\":\"sms\", \"address\":\"#{phone}\"}", body: "Message"})

I've also tried to send the sid as service_sid but same results. Same 404 status code for Notify Binding resources too.

superchris commented 2 years ago

There is a second argument that you use to pass it as [service: service_id]. Wish this had been documented took awhile to figure out.