Twilio shortcode for webhook integration | Community
Skip to main content
Level 2
Jan 18, 2021 8:35 PM UTC
Solved

Twilio shortcode for webhook integration

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.
SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
Jan 25, 2021 10:04 PM UTC

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 

6 replies

SanfordWhiteman
Level 10
Jan 19, 2021 5:18 AM UTC
(Also your link is to a file on your local machine that we can't access.)
Translate
Level 2
Jan 20, 2021 3:08 PM UTC

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 

 

 

Translate
SanfordWhiteman
Level 10
Jan 20, 2021 9:04 PM UTC

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

 

Translate
SanfordWhiteman
Level 10
Jan 19, 2021 5:17 AM UTC

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

Translate