Setting Up Webhook on Hubspot

68 Views Asked by At

How do I set up an API endpoint call to send an SMS from Twilio on Hubspot's Webhook? I tried to set it up on Zapier Webhook action and I was able to make it work but can't seem to make it work on Hubspot. Please help! :(

I've used this endpoint:

https://api.twilio.com/2010-04-01/Accounts/{account_sid}/Messages.json

with these key-value pairs:

"To": "+1862319####",
"From": "+1848276####",
"Body": "Testing CJJ"
"Authorization": "Basic {base64 encoded accountSID:AuthToken}"
1

There are 1 best solutions below

0
On

This might be a better issue for HubSpot - especially if they offer a connector for Twilio.

To send a text message, here is what the CURL request would look like:

curl -X POST "https://api.twilio.com/2010-04-01/Accounts/$TWILIO_ACCOUNT_SID/Messages.json" \
--data-urlencode "From=+15557122661" \
--data-urlencode "Body=Hi there" \
--data-urlencode "To=+15558675310" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN

Your sample code looks like it is posting JSON to the https://api.twilio.com/2010-04-01/Accounts/$TWILIO_ACCOUNT_SID/Messages.json endpoint. It should actually be url encoded parameters. Does HubSpot allow sending the Body as a url encoded string?

Twilio has this blog article on Making API Requests using cURL.

One suggestion is to translate the cURL request into the format required by HubSpot to post data. It might just be setting the http POST payload (and making sure it is not sending application/json) to be: body=testingcjjj&from=+1848276####&to=+1862319####

Here is another StackOverflow post explaining that Twilio will not accept application/json.