Re: Customer.io Integration

Jenn_DiMaria2
Level 10

Customer.io Integration

Has anyone connected customer.io and Marketo before? We're looking to pass customer.io unsubscribes to our Marketo database and are thinking a webhook would be the best way to go about this, but I'd like to hear what others did if there's a better/cleaner way.

Thanks in advance!

Tags (2)
5 REPLIES 5
Josh_Hill13
Level 10 - Champion Alumni

Re: Customer.io Integration

i would think API is much easier in the long run.

Jenn_DiMaria2
Level 10

Re: Customer.io Integration

Thanks, Josh! I've been playing around with using the REST API endpoint url, so I'm hoping to test it this afternoon. I think you're right.

SanfordWhiteman
Level 10 - Community Moderator

Re: Customer.io Integration

Pushing individual "messages" (in Customer.io parlance) via the Marketo REST API is going to drain your API calls dry.

It would be better to use a Forms API form post for this action.

Jenn_DiMaria2
Level 10

Re: Customer.io Integration

Thanks, Sanford!

So the only option I have in customer.io to enter any endpoint URL is the below:

pastedImage_0.png

Is this where I'd tell it to post to the form API? And is this the URL I'd use?

/rest/asset/v1/form/{id}/field/{fieldId}.json

SanfordWhiteman
Level 10 - Community Moderator

Re: Customer.io Integration

Is this where I'd tell it to post to the form API? And is this the URL I'd use?

/rest/asset/v1/form/{id}/field/{fieldId}.json

Nope... that's the Marketo REST API endpoint for ​managing ​fields on forms (not populating them).

The Forms API endpoint is /index.php/leadCapture/save* on your pod.

The problem here is going to be that their webhook (like many "think they're cool" modern-era webhooks) posts only JSON-encoded data, as opposed to form-encoded data. For a very brief, example that means they send a payload like:

{

  "data" : {

    "event_name" : "unsubscribed",

    "email_address" : "customer@example.com"

  }

}

but we need

  munchkinId=123-AAA-456&formid=7890&Email=customer%40example.com

on the form side.

This means you need to translate ​the data from (incoming) JSON to (outbound) form encoding by going through an intermediate server. This doesn't have to cost you anything to run -- you can use Amazon API Gatway, and most likely for your load it would cost only pennies per month -- but someone needs to set up the mapping.

Note there's no direct route to Marketo here. You can't post the the JSON data directly to Marketo, either. It would still need to be translated, in this case from one JSON structure to another JSON structure (not to mention authenticated).  It would be far easier to build the JSON-to-form than the JSON-to-OAuth-to-JSON (and like I mentioned the latter has major API limits).