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)
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?