ChrisPalmer
ChrisPalmer

Reputation: 295

Rails Twilio callback event listener

In Twilio, once you send a text message, it fires a few POST requests to the statusCallbackUrl. How do I listen for this callback in my angular/rails app? I see the posts being made in the console. I would simply like to just trigger a notification alert( without refreshing the page preferably) once a post request has been made by twilio. Any suggestions on this?

Upvotes: 0

Views: 111

Answers (1)

philnash
philnash

Reputation: 73055

Twilio developer evangelist here.

I would recommend looking into Server Sent Events (SSE) and ActionController::Live::SSE.

SSE are a way of sending data from a server to your front end. The data is then received in your front end JavaScript and you can update your view that way without reloading the page.

There are some good blog posts that show how to use SSE with Rails, take a look at:

Let me know if that helps at all.

Upvotes: 1

Related Questions