Guide: Twilio WhatsApp Message API WebHook with Appsheet Bot

Here is the guide on setup your webhook with Twilio REST API

URL: https://api.twilio.com/2010-04-01/Accounts/#yourAccountSid#/Messages.json

Body: To=whatsapp:%2B60xxxxxxx&From=whatsapp:%2B14xxxxxxxBody=TestTest
Header: Authorization: “Basic QUM3OTVjxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”

Example: Authorization: "Basic " + Base64Encoded(TwilioAccountSID + “:” + TwilioAuthToken)
URL Encode and Decode - Online (urlencoder.org)

6 5 2,402
5 REPLIES 5

Feel free to share if anyone found other better method of doing this.

Is it working? I’ll be following what you’ve showed here and I’ll probably comment back… I am currently using whatsapp public api, building the link with one killer expression and using action to send the order to my clients. When they confirm, I manually change status on the app. Not perfect, but better than what was before. But if I can get the chatbot to work for me here on appsheet, that’s seems to be a good solution for speed things up on production.

I don’t know which part I did wrong, it’s not working. If it is okay with you, will you please help me out?
Thanks!
From Bot Monitor:
“Exception”: "Webhook HTTP post request failed with exception The remote server returned an error: (401) Unauthorized. "
I provided my own Twilio SID and Auth Token, what else did I miss?

Task Properties
{
“Exception”: "Webhook HTTP post request failed with exception The remote server returned an error: (400) Bad Request. ",
“Task Type”: “Webhook”,
“Task Name”: “Twilio Whatsapp Webhook”,
“Url”: “https://api.twilio.com/2010-04-01/Accounts/ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/Messages.json”,
“Verb”: “Post”,
“MimeType”: “application/json”,
“Headers”: “Authorization:Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”,
“Payload”: "{“to”: “whatsapp:+91xxxxxxxxxx”,“from”: “whatsapp:+1xxxxxxxxxx”,“body”: "Your Yummy Cupcakes Company order of 1 dozen frosted cupcakes has shipped and should be delivered on July 10, 2019. Details: http://www.yummycupcakes.com/"}"
}

And with URL Encode

Task Properties
{
“Exception”: "Webhook HTTP post request failed with exception The remote server returned an error: (400) Bad Request. ",
“Task Type”: “Webhook”,
“Task Name”: “Twilio Whatsapp Webhook”,
“Url”: “https://api.twilio.com/2010-04-01/Accounts/ACxxxxxxxxxxxxxxxxxxxxxxxxx/Messages.json”,
“Verb”: “Post”,
“MimeType”: “application/x-www-form-urlencoded”,
“Headers”: “Authorization:Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”,
“Payload”: “To=whatsapp:%291xxxxxxxxxx&From=whatsapp:%2B1xxxxxxxxxxBody=TestTest”
}

Twilio Help:
400 : Bad Request There was an error with the request. The body of the response will have more info

Will this help in semding automated messages through whatsapp? Like of i want to send same message to 100s of my customers, will it let me do it?

Top Labels in this Space