0

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 Answer 1

0

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.