SOLVED

Twilio shortcode for webhook integration

Go to solution
j_borrelli
Level 1

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! 

1 ACCEPTED SOLUTION
SanfordWhiteman
Level 10 - Community Moderator

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 

View solution in original post

6 REPLIES 6
SanfordWhiteman
Level 10 - Community Moderator
(Also your link is to a file on your local machine that we can't access.)
j_borrelli
Level 1

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
Level 10 - Community Moderator

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

 

j_borrelli
Level 1

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. 

mkto_webhookexample_twilio.png

SanfordWhiteman
Level 10 - Community Moderator

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 

SanfordWhiteman
Level 10 - Community Moderator

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