Twilio shortcode for webhook integration | Community
Skip to main content
New Participant
January 18, 2021
Solved

Twilio shortcode for webhook integration

  • January 18, 2021
  • 2 replies
  • 4061 views

I am trying to set up the integration between Twilio SMS and Marketo using the webhook documentation.

We also use a shortcode to currently send messages. I followed the documentation and received the following error: url must not contain invalid chars or json

Is this because we are using a shortcode versus a full phone number? Thanks in advanced! 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

Here is how the webhook is currently set up in Marketo. When I go to trigger a campaign I get the 404 error: URL not found. 


Can't say that's so easy to read, but it looks like you're trying to embed basic auth credentials in the URL.  Don't do it that way: add a proper Authorization: header instead, and set your URL to simply

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

 

I described an easy method for generating the header in this post way back when:

 

Calling the Twilio Lookup API as a Marketo webhook 

2 replies

SanfordWhiteman
New Participant
January 19, 2021
(Also your link is to a file on your local machine that we can't access.)
New Participant
January 20, 2021

https://[ACCOUNT_SID]:[AUTH_TOKEN]@API.TWILIO.COM/2010-04-
01/ACCOUNTS/[ACCOUNT_SID]/SMS/MESSAGES.XML

 

From=%2B1[MY_TWILIO_NUMBER]&To=%2B1{{lead.Mobile Phone Number:default=edit me}}&Body=YOUR
MESSAGE

 

These are the two urls I used for the webhook 

 

We use a shortcode:  95578  instead of a 9 digit number 

 

 

SanfordWhiteman
New Participant
January 20, 2021

These are the two urls I used for the webhook

Only one of those is a URL, the second is presumably your webhook request payload.

 

What do you have set as the request and response encodings in the webhook definition? And the method (GET or POST)?

 

SanfordWhiteman
New Participant
January 19, 2021

Please show your exact webhook setup, preferably copying-and-pasting the Payload contents and highlighting them as JavaScript using the Insert Code Sample feature here on the community.

 

(You may also include a screenshot, but please provide the actual text so we can inspect it including all original whitespace.)