Category: Actions

Create a Zendesk Ticket with Customer.io

If you don’t already have a Zendesk account, sign up here. To create tickets via the Zendesk API, you need:

  • An Agent role or higher
  • Password Access enabled under Settings – Channels – API:
  • Your Zendesk subdomain. This can be found in the URL when you open Zendesk. In our example, in our URL, https://customeriohelp.zendesk.com/agent/admin/overview, the subdomain is customeriohelp.
Create your campaign

Inside your Customer.io account, create a new campaign— it can be event triggered or segment triggered depending on what should trigger the Zendesk ticket creation.

In our example we’ll use the event account_cancelled with an event attribute filter “feedback exists” as a trigger for our campaign:

Add a webhook

Add a webhook action to your workflow, and give it a name.

We’ll call our webhook “Account cancellation: Feedback provided”

After adding the webhook, click Add Request.

Compose your webhook’s headers

In the composer, next to POST, you’ll add a URL that consists of your Zendesk login email and password followed by the ticket endpoint:

https://[YOUR-EMAIL-ADDRESS]:[YOUR-PASSWORD]@[YOUR-ZENDESK-SUBDOMAIN].zendesk.com/api/v2/tickets.json

Ours looks like this:

https://win@customer.io:BoogieAmi@customeriohelp.zendesk.com/api/v2/tickets.json

With that done, your composer should now look something like this:

Compose your webhook’s body

For our new ticket we’ll use this content:

Adapt it to your needs; only the comment is mandatory, the other fields are at your discretion. You can find more information here on what fields are available.

Send Request

When you’re ready to test, you can click “Send Request”. Customer.io will show you the response from the Zendesk API.

If you’re successful you’ll see a 201 Created Response.

Success!

In Zendesk you will see a ticket created.

We’re excited to hear how you end up using Zendesk with Customer.io’s Webhook Action. If you have any trouble, let us know! We’re happy to help.

Send Data to Zapier

If you don’t have a Zapier account, start by creating one over at Zapier.com.

Zapier is one of the most flexible integrations we and you might want to use it to do things like:

  • Add data to a google sheet
  • Follow a person on twitter when they enter the segment “Has twitter name”
  • Add a ticket in Jira when a user does the event “bug_reported”
  • Send new paid accounts an invitation to review your service on Trustpilot
Get started: create your webhook in Zapier

In your Zapier account, create a new Zap. Choose the “Webhooks” Trigger App and then select “Catch Hook.”

We don’t need to set any options, so click continue if you see that screen. Then copy and paste the Webhook URL.

Create your campaign in Customer.io

If you’re starting a new campaign, you can create one now.

Inside your Customer.io account, create your campaign— it can be event triggered or segment triggered.

Add and name your webhook

In Customer.io, add a new webhook action in the campaign’s workflow and give it a name.

You then need to customize it. To do so, click Add Request to enter the composer.

Customize your webhook

Next to POST, add in the API endpoint we want to send our request to. Paste in the URL you copied from Zapier. It should look something like:

https://hooks.zapier.com/hooks/catch/xxxxx/xxxxx

If you’re doing a segment triggered campaign, the easiest way to send a webhook to zapier is to just send the entire Customer object:

{% raw %}{ "customer": {{ customer | to_json }} }{% endraw %}

With an event triggered campaign, you can send over both the event object and customer object:

{% raw %}{ "event": {{ event | to_json }}, "customer": {{ customer | to_json }} }{% endraw %}
Send Request

When you’re ready to test, you can click Send Request. Customer.io will show you the response from the Zapier API.

If you’re successful, you’ll see a 200 OK. Then, in Zapier, you’ll also see a Test Successful response.

Then, create your action in Zapier!

Now that your data is flowing in to Zapier, you can complete the rest of their process and hook Customer.io data up to any one of their integrations.

We’re excited to hear how you end up using Zapier with Customer.io’s Webhook Action.

Create a Trello Card with Customer.io

If you don’t have a Trello account, you can create one here. Then, after you log in, retrieve your developer API key.

Get your token

You’ll also need a token. To get one, paste your own API key into the URL below: code

https://trello.com/1/authorize?expiration=never&scope=read,write,account&response_type=token&name=Server%20Token&key=YourAPIKeyHere
Allow access

Click the Allow button to give access to your boards and teams. If you’re successful, you’ll see a white page with the following content… blockquote You have granted access to your Trello information.
To complete the process, please give this token:

…and your token should be there!

Find the List ID

There is one more piece of data you need: the id of the list where you want to post your cards. To find this ID:

  1. Open the board that contains your chosen list.
  2. Add one card to that list (if one does not exist already).
  3. Open the card and copy the URL that you see in the address bar.
  4. It should be short URL that looks like https://trello.com/c/DcqBrqdx/1-target-card
  5. Take that URL and add “.json” to the end, like this: https://trello.com/c/DcqBrqdx/1-target-card.json
  6. Go to this URL. In the code, you will see a field called idList.
  7. Copy the idList:
Create your campaign

Inside your Customer.io account, create a new campaign (event triggered or segment triggered depending on what should trigger the Trello card creation.

In our example we’ll use the event FeedbackRequest with an attribute filter “Accepted is equal to true”.

Add a webhook action

Add a webhook action to your workflow, and give it a name. We’ll call our webhook “Contact customer”:

After adding the webhook, click Add Request.

Set your endpoint in the composer

Next to POST add the Trello endpoint, with your API key and token pasted into it:

https://api.trello.com/1/cards?key=YOUR-API-KEY&token=YOUR-TOKEN

Be careful not to add any extra spaces before or after this URL.

Customize your webhook body

For the body of our new card we’ll use this sample content:

idList needs to be replaced with the idList we retrieved from Trello. Only the due and idList attributes are mandatory. You can find more information about other attributes here.

Send Request

When you’re ready to test, you can click Send Request. Customer.io will show you the response from the Trello API.

If you’re successful you’ll see a 200 OK Response.

Success!

In Trello you will see this card created.

We’re excited to hear how you end up using Trello with Customer.io’s Webhook Action. If you have any trouble, let us know! We’re happy to help.

Start mailing Lob postcards with Customer.io

Get your Lob API key

If you don’t have a Lob account, start by creating one over at Lob.com. In your Lob account, you’ll want the API Key from your account. We recommend starting with your “Test API Key” from your settings.

Create your campaign

Create a campaign in Customer.io where you want to add the webhook action. For our example, we’re using a segment triggered campaign with the segment “Paid 3 times” as our trigger.

Add your webhook action to the workflow

Add a new webhook action in the campaign’s workflow, and give it a name. Then click Add Request.

You’ll then be brought to the Webhook composer.

Add your webhook headers

Next to POST, add in the API key and the postcard API endpoint in this format:https://[API-KEY]:@api.lob.com/v1/postcards, so the API key followed by a colon : and an @ sign.

Note: If you’re trying to send a letter or a check, more endpoints are in the Lob documentation.

Your headers should look something like:

Customize your postcard

Copy and paste this example code in to the content area for your webhook.

You’ll want to adjust the liquid for mailing addresses to match your custom attribute names in Customer.io.

For details on customizing the front or back of the postcard, take a look at Lob’s documentation.

When you’re done, you’ll have a finished webhook that looks something like:

Send Request

When you’re ready to test, you can click Send Request. Customer.io will show you the response from the Lob API.

If you’re successful, you’ll see a 200 OK.

Success!

In Lob, you should now see your postcard successfully created.

Track Conversions

Conversions in Customer.io are credited to the last message sent before a person enters or leaves a segment. Webhooks work a little differently.  We give you the option to enable conversion tracking just on the webhook actions you chose. For this campaign, we recommend enabling conversions for this webhook, since it triggers a customer-facing message.

We’re excited to hear how you end up using Lob with Customer.io’s Webhook Action. If you have any trouble, let us know! We’re happy to help.

Start sending data with IFTTT

If you don’t have an IFTTT account, start by creating one over at IFTTT.com.

IFTTT is a great option for connecting to devices, web apps, or services for things like:

  • Turn on a light in your office when you get a new “plan_enterprise” user
  • Create a calendar event to follow up users who enter the “Signed Up” segment
  • Email to your success team when a user triggers “payment_failed”
Create your recipe

In your IFTTT account, create a new recipe. Select the “Maker” channel and select “Receive a web request”.

Give your event a descriptive title, like user_upgraded_plan.

Choose a service to connect to

Pick which of the 300+ services should be activated by this event.

Format your data and create your action

If your recipe allows you to pass along data, take this opportunity to configure it.

Once you’re done, you can create your action and your recipe.

Create your campaign in Customer.io

If you’re starting a new campaign, you can create one now.

Inside your Customer.io account, create your campaign— it can be event triggered or segment triggered.

Add and name your webhook

In Customer.io, add a new webhook action in the campaign’s workflow and give it a name.

You then need to customize it. To do so, click Add Request to enter the composer.

Find your key, and customize webhook action

Next to POST, add in the API endpoint we want to send our request to. You can find your Maker request url and key here, under “How to Trigger Events”

The key should look something like

https://maker.ifttt.com/trigger/{event}/with/key/XXXXXXXXXXXXXX

Replace {event} with the event name you picked earlier.

Your webhook composer should look something like this:

IFTTT allows you to send up to 3 custom data values along with your request which you can customize with liquid variables.

In the body of your request you could add something like:

Send Request

When you’re ready to test, you can click Send Request. Customer.io will show you the response from the IFTTT API.

If you’re successful, you’ll see a 200 OK. If your recipe was configured correctly, you should also have triggered it to complete!

Create a Help Scout conversation with Customer.io

If you don’t have a Help Scout account, you can create one here.

Get your Help Scout API key
  • Go to Your Profile (top right corner).
  • Select API Keys.
  • Click Generate an API Key.
  • Add a label to easily recognize the API key used inside Customer.io.

Please be aware that free plans don’t allow API access, and only owners and administrators are able to create API keys.

Get your Mailbox ID:
  • Open the mailbox where you want to create your conversations.
  • Go to Edit Mailbox (bottom left of the screen):
  • Copy the mailbox id from the URL. It will be something like:
https://secure.helpscout.net/settings/mailbox/[MAILBOX-ID]/
Create your campaign

Inside your Customer.io account, create a new campaign (event triggered or segment triggered depending on what should trigger the creation of a new conversation in Help Scout. In our example we’ll use the segment “Low NPS Rating” to target customers dissatisfied with our service.

Add a webhook action

Add a webhook action to your workflow, and give it a name. We’ll call our webhook “Low NPS Rating.”

After adding the webhook, click Add Request.

Compose your webhook

Next to POST add the Help Scout endpoint in this format:

https://[API-KEY]: @api.helpscout.net/v1/conversations.json

The result should look like:

https://7f7f8766b8a098b696c40a0c0e9034xXxXxXxXxX:X@api.helpscout.net/v1/conversations.json

At this point, you should see something like this:

Customize your webhook body

Grab the sample JSON content from https://gist.github.com/LiviaSarban/2e0b200f85926dc13f8e6922046c52e9.

Replace MAILBOX-ID with your own and adapt any attributes to your own data.

customer, subject, mailbox, and threads are mandatory fields. The rest are optional. You can read more about the options here: http://developer.helpscout.net/help-desk-api/conversations/create/

Our webhook body now looks something like this:

Send Request

Press Send Request to send a test webhook to your Help Scout mailbox.

If everything went well, you should see a 201 Created result.

Success!

Our new conversation was created in Help Scout!

Send an NPS survey using Delighted

If you don’t already have an account, you can sign up at https://delighted.com/.

Get your API Key

To send NPS surveys via API, you will need your API key. Your API key can be found in your Delighted account under Integrations > API. Only admins on your Delighted account can view the API key. If you’re not the admin, reach out to the person in charge with the Delighted account in your company.

Create a new campaign

Inside your Customer.io account, create a new campaign— event triggered or segment triggered depending on what should trigger the Delighted NPS survey sending.

In our example we’ll use the “Upgraded” trigger segment and a 7 day delay.

Customize your campaign

We start by adding a delay to your Workflow to make sure our emails go out 7 days after a customer upgraded.

Also, because we’re looking to get higher open rates, we only want to send emails when our customers are likely to still be at work – Monday to Friday between 7 a.m. and 7 p.m. EST time. We achieve this by adding a time window:

Add your webhook action

Now that we set the stage, we’re ready to add the webhook action. We’ll call our webhook “Upgraded: 7 days survey.”

After adding the webhook, click Add Request.

Customize your webhook headers

Next to POST add your Delighted API key followed by the People endpoint. The format needs to be:

https://[API-key]@api.delighted.com/v1/people.json

For example:

https://CMj7SuKdy4w0oVdAqXsE5hxXxXxXxXxX@api.delighted.com/v1/people.json
Customize your webhook body

For our survey we’ll use the content from

Customize the fields however you like; only the email is mandatory. The others are at your discretion, and you can find more information about them in the Delighted API docs.

At this point, your webhook should look like this:

Send Request

When you’re ready to test, you can click Send Request. Customer.io will show you the response from the Delighted API.

If you’re successful you’ll see a 200 OK Response.

Success!

You will see the surveys sent in your Delighted account under People:

Our survey (sent in German because that was the language we chose) looks like this:

We’re excited to hear how you end up using Delighted with Customer.io’s Webhook Action. If you have any trouble, let us know! We’re happy to help.

Send Request

Create a Lead in Close.io

Close.io is a streamlined sales platform that helps you close more deals. With built-in calling and automatic email tracking, you can focus on selling rather than data entry. In our example, we’re going to show you how to send leads from Customer.io into Close.io, using our segment triggers.

If you don’t already have an account, you can create one at Close.io.

At any point, you can read all about adding a lead to Close.io via their API. Their docs include details on custom fields, give you example data, and more.

Get your Close.io API key

Once you have a Close.io account, go to your settings page and then click Your API Keys.

Once there, click Generate New API Key.

Create your campaign

The simplest case is to push a lead into Close.io for every signup that enters Customer.io. For your trigger, you can simply use the “Signed Up” segment that comes by default when setting up Customer.io, but you can create more sophisticated behaviors by using Customer.io segments.

You’ll want to use a segment triggered campaign to ensure that the campaign is entered once per profile. This will prevent duplicate leads from being generated (which could happen with an event triggered campaign).

Add your webhook action to the workflow

Click “Webhook” to add a new webhook action in the campaign’s workflow. We’ll call our webhook “Send a lead to Close.io”.

Create your webhook

Next, click “Add Request” to configure the details of your webhook.

To fill in the request URL, you’ll use your API Key as the username. For example, if your API Key is abcdef0123456789, your URL will look like this:

https://abcdef0123456789@app.close.io/api/v1/lead/
Compose your webhook’s body

Generally, a lead in Close.io will map to a profile in Customer.io. You’ll like store a subset of the data contained within a user profile attribute in Customer.io.

In order to create a lead in Close.io, you’ll likely want to send details like name, URL, contacts, and possibly custom data if you’ve created custom fields in Close.io. Below is a JSON example showing an example. Note: name in Close.io refers to the name of the lead (i.e. the company), not the contact name.

Using Liquid, we’ll insert the values from Customer.io into the required JSON format to add a lead to Close.io. If some values may not exist in Customer.io, but are required in Close.io, use fallbacks to provide a value.

Using the Composer Preview pane, verify that the JSON data is formatted correctly. Note: you can use a tool like JSON Lint to help find errors in your JSON.

At this point, your webhook composer should look something like this:

Send test request

Test out the mapping of your data into Close.io to ensure that the required fields and formatting work as expected.

Use the “Send Request” button to send your previewed request to Close.io. A 200 OK message will confirm that the request was received.

Success!

We’re excited to hear how you end up using Slack with Customer.io’s Webhook Action. If you have any trouble, let us know! We’re happy to help.

Once the campaign action is turned from Queue Draft to Send Automatically, leads will flow into Close.io based on the trigger conditions of your campaign. You’re all done!