Marketo Text Messaging with the Telnyx API

Take the first steps towards 2 way Marketo text messaging and sending text notifications by learning how to build outbound text messaging into your Marketo campaigns using webhooks to call the Telnyx messaging API.

Take the first steps towards 2 way Marketo text messaging and sending text notifications by learning how to build outbound text messaging into your Marketo campaigns using webhooks to call the Telnyx messaging API.

If you are looking for an introduction to the Telnyx CPaas platform and why they should be your messaging provider take a look at the Marketo SMS Marketing with Telnyx post where I explain the pricing and features of Telnyx messaging. Also if you want a sneak peek at the cool things you can do once you have set up Marketo text messaging then check out the Marketo SMS Integration: Webinar Reminders post.

The first step to Marketo test messaging is to set up your Telnyx account. This Messaging Quickstart Portal Setup Guide will walk you through the steps below.

N.B. Make sure to sign up using this referral link to get a sweet, sweet $20 in free credit.

  1. Create a free Telnyx portal account
  2. Buy a messaging capable phone number
  3. Create a messaging profile
  4. Associate your number with this messaging profile

Creating the Webhook

Next login to Marketo and navigate to the “Webhooks” section in “Admin”

  1. Select “New Webhook”
  2. Name the webhook
  3. Paste https://api.telnyx.com/v2/messages into the “URL” field
  4. Leave the “Request Type” as “POST”
  5. Paste the code below into the “Template” field
{
"from": "+12345678910",
"to": "{{lead.Form - Marketing Phone}}",
"text": "Hello Workflow Pro"
}

Notice how a lead token is used to pull in the phone number of the person the message will be sent to. You will need to swap in your own lead phone number field in here and replace the “+12345678910” number above with the messaging-enabled phone number you purchased before.

  1. Leave “Request Token Encoding” as “None”
  2. Set “Response Format” to “JSON”
  3. Click “Create”
Marketo text messaging webhook configuration
Marketo text messaging webhook configuration

Authorizing the Webhook

Navigate to the Auth section of your Telnyx account and create a new API Key following the steps below:

  1. Select “Create API Key”
  2. Click “Create”
  3. Copy the “API Key”

Next follow these steps in Marketo to set up the Authorization header:

  1. Click on “Webhook Actions”
  2. Select “Set Custom Header”
  3. Click “Add”
  4. Put “Authorization” in the header column
  5. Put the word “Bearer” followed by a space in the “Value” column
  6. Paste your Telnyx API key in the “Value” column
  7. Click “Add”
  8. Put “Content-Type” in the header column
  9. Put the word “application/json” in the “Value” column
  10. Click “Save”
Marketo text messaging webhook custom header
Marketo text messaging webhook custom header

Marketo Text Messaging with Number Pooling

Telnyx offers the ability to distribute outbound text messages over the numbers associated with a messaging profile with a feature called “Number Pooling”. If you want to learn about how number pooling can help you increase throughput and deliverability rates as well as an explanation of the features like “Sticky Sender” check out the Marketo SMS Marketing with Telnyx post.

Number pool settings in the Telnyx portal
Number pool settings in the Telnyx portal

The setup and custom header of the webhook will be the exact same with the only changes being that the URL must be updated to the number pool endpoint and the payload must be updated to specify the messaging profile id instead of the “From” phone number.

https://api.telnyx.com/v2/messages/number_pool
{
    "messaging_profile_id": "5569779b-06a9-442e-9153-4c366be5a2c0",
    "to": "{{lead.Form - Marketing Phone}}",
    "text": "Hello Workflow Pro"
  }
Marketo text messaging with Number Pool
Marketo text messaging with Number Pool

Marketo 2 Way Text Messaging

As with email marketing, it is important to adhere to regulations governing text message communications. Take a look at the Marketo 2 Way SMS using Telnyx and Zapier post to see how you can auto-respond to inbound text messages like “HELP” and “STOP” to comply with text message regulations.

Once you have implemented 2 way text messaging you are now ready to start using text messages in your smart campaigns for examples such as webinar reminders.


Tyron Pretorius

Automating with APIs, Python, Zapier, and Google Scripts 

Former engineer turned marketing operations lead who loves to get down and dirty with the Marketo API, Python, Zapier, and Google Scripts.

Post a comment