Twilio - two way SMS

Sarah_Wood
Level 1

Twilio - two way SMS

Hi everyone! 

 

We are working on setting up a Twilio integration. The outgoing webhook from Marketo to Twilio is working, so we've been able to send a few texts. 

 

We need to be able to store the responses to the texts in Marketo (Examples: Yes, No, Stop, Call Me, etc.). I've tried creating a webhook and mapping back to field locations, but I could be missing something. 

 

Has anyone successfully set up Twilio responses in Marketo?

 

Thank you, 

 

Sarah 

Tags (2)
5 REPLIES 5
SanfordWhiteman
Level 10 - Community Moderator

Re: Twilio - two way SMS


I've tried creating a webhook and mapping back to field locations, but I could be missing something. 

If you mean a webhook defined in Marketo, that certainly cannot be used to process Twilio responses!

 

Marketo webhook definitions are for outbound calls from Marketo to a webhook-compatible service - as indeed Twilio is, for the SMS sending part. SMS responses are transmitted separately, they are not known at/during the time the SMS is sent.

 

To process SMS responses, you

 

  1. set up a compatible web service that can translate Twilio notifications - those are outbound calls from Twilio, note - into Marketo REST API calls (or, sometimes more scalably, into Marketo form posts)
  2. define the webhook on the Twilio side so it sends notifications to your service (that service can be called an API Gateway)

 

It's not a complex setup but you have to understand the directions, definitions, and formats of the different HTTP requests.

 

Phillip_Wild
Level 10

Re: Twilio - two way SMS

Are you familiar with Zapier? As Sanford noted, you can't use Marketo webhooks for this purpose, but if you don't have access to a development team then you can do a "quick and dirty" reply handler using Zapier.

 

I believe with Twilio you can set up outgoing webhooks with the response from a user. In Zapier, create a new Zap based on "webhook is received", and copy that webhook URL given in Zapier into Twilio. Once you have an example that has been sent from Twilio to Zapier (just fake one in the short term by going to your browser, entering in the webhook URL and putting in the parameters - eg. https://zapierwebhookurlplaceholder.com?phone=+1606000000&messsage=stop), you can use the "email by Zapier" step to send yourself (or a common inbox) the details of what was sent. You can then process accordingly.

 

You could build in more smarts (scanning for opt out keywords etc etc, and updating this directly into Marketo) but given the variety of responses people could give you, if you can manually look at them via email that's easier. 

 

You could also push into Slack, into a Google Sheet, whatever you want.

 

Side note: I'm not certain of the security of this method, so if you are in a quite.....risk-averse corporate environment, get a proper developer to do it 🙂

SanfordWhiteman
Level 10 - Community Moderator

Re: Twilio - two way SMS

True, some freemium services can be used to translate the inbound payload from Twilio into an outbound payload formatted for Marketo, once you learn the ins and outs of those ostensibly zero-code services.

 

But you'll end up paying through the nose for something like 2-way SMS. That's how they get their money, after all, from people shifting into the suddenly costly paid tiers.  (Unless you're talking mere hundreds of SMSes per month - but most people interested in 2-way will do much higher volume.)

 

Whereas if you build the API gateway service once, at a cost of < $1K if the developer is honest, then you can run it for pennies per month thereafter. When it comes to simple API gateways like this, there's a major cost disjunction b/t a prefab IPaaS connector and your own custom code running in the cloud. Your code won't blink at a million requests per month, as that's child's play from a resource perspective. But tell Zapier you need a million invocations and they'll be like 🤑🤑🤑.

Victor_Herrero
Level 5

Re: Twilio - two way SMS

@SanfordWhiteman and @Phillip_Wild , 

 

Thanks for your responses. It's good to know we could perhaps build a two-way SMS service (maybe even some form of reporting) using Zapier if we can't get a developer to build it. But I was also thinking that the volume of calls may make it a worse investment than getting an in-house solution developed. 

 

Great insights!

Tyron_Pretorius
Level 9 - Champion

Re: Twilio - two way SMS

Hi Sarah,

 

As Sanford mentions you cannot do this in Marketo alone using webhooks.

 

As @Phillip_Wild  mentioned you can build an SMS responder using Zapier.

 

https://theworkflowpro.com/2-way-sms-marketo/

 

The post above will show you how to 

  • Parse the inbound SMS for keywords and choose an appropriate response
  • Send the SMS response to the customer and optional alerts to your team
  • Set the person's SMS subscription field in Marketo to TRUE or FALSE if the "STOP" or "START" keywords are present

You can easily modify this SMS responder Zap (i.e. the update lead action in Step 9) to store the inbound SMS message in a deep text field on the lead.

 

In terms of Sanford's points about millions of invocations to Zapier we barely get any responses when we use this 2 way SMS responder zap to support the SMS we send out for webinar confirmations and webinars (https://theworkflowpro.com/marketo-sms-integration/ ) so I do not think this will be a issue unless you are receiving thousands of SMS responses a day.

 

Happy to help out with the Zap if you have questions!

Tyron Pretorius