How to read whatsapp message (phone number + body content) with nodejs and twilio?

I am able to send the whatsapp message with Twilio API, the question is how do I read the whatsapp message content (body, phone number's sender) with nodejs and twilio api? any good example?

1 answer

  • answered 2018-11-08 06:56 philnash

    Twilio developer evangelist here.

    When you setup your WhatsApp API sandbox you are given a box to fill in with a URL for incoming messages. When a message is sent to the WhatsApp number Twilio will make a webhook, an HTTP request, to that URL with the body of the message and the sender's number.

    You can see how to use this in Node in my blog post on emoji translations of WhatsApp messages and it's the exact same process as receiving an incoming SMS message with Twilio too.

    Let me know if that helps at all.