Calling the Twilio Lookup API as a Marketo webhook

SanfordWhiteman
Level 10 - Community Moderator
Level 10 - Community Moderator

Twilio offers a pretty awesome Lookup API to enrich phone numbers with metadata: it can distinguish mobile and landline numbers (Sales will thank you!), determine carrier (which has demographic significance, like it or not), and even do reverse Caller ID lookup.

It's reasonably priced, and if anyone knows this stuff, it's Twilio.

The weird thing is that even though the Lookup API is 100% webhook-compatible, their docs don't show it being called as a simple webhook request. They only show it in the context of Java, PHP, or other code.

Anyway, here's what's needed to call it as a webhook.

Lookup requests are authenticated using HTTP Basic Auth. Your Twilio Account SID is the username; your Account Token is the password.

    So you just need to create an HTTP Authorization header and then add it to the webhook definition in Marketo. (Marketo supports Basic Auth just fine, but it doesn't present you with distinct username and password boxes.)

    An Authorization header for Basic Auth looks like

Authorization: Basic <base64(<username>:<password>)>

where <base64(<username>:<password>)> means

  • concatenate the username and the password with a colon : in-between
  • Base64-encode the concatenated string

 

 

Read the full post on TEKNKL :: Blog →​

2911
1
1 Comment