Marketo
Authentication
To get a client ID and client secret you must login to your Marketo installation as an admin.
Go to Admin > LaunchPoint under the Integration menu.
Click on View Details under the service that you want to use. If no services are shown, create a new one.
Copy the client ID and client secret from the prompt.
Cyclr Setup
Setup your Marketo App within Cyclr:
Go to your Cyclr Console
Click the Connectors menu along the top
Choose Connector Library
Scroll down to Marketo
Click the Setup button
Enter the following values:
Client ID: Enter the client ID that we retrieved from LaunchPoint.
Client Secret: Enter the client secret that we retrieved from LaunchPoint.
API Subdomain: The subdomain from your api instance endpoint. For example, "https://{{subdomain}}.mktorest.com".
Your Marketo Connector is now setup! You can test it by installing it in one of your Cyclr accounts and executing one of the methods to confirm it can return some data.
Bulk Import/Export
You can import and export CSV, TSV or SSV files with methods from the Bulk Imports and Bulk Exports categories.
Import
To import data as a CSV or TSV file, you need to add custom fields for each column headers that you want to create to the method Create Import Job.
For example, if the desired outcome for the import file is as follows:
Your custom request fields should be created as:
Note: the [data]. prefix is required
Once the you configure your fields, you can map them.
Export
The following example shows the process for an export of type leads. The process for activities is identical but with export type changed to activities.
For this process, you need to install both the Generic Webhook and Generic File connectors from the Utility Connectors library.
To create a bulk export from Marketo, you need to create two cycles:
Create Cycle 1 to create the export job, add that job to the processing queue, and send the Export ID to Cycle 2
Create Cycle 2 with the first step as a webhook step so the cycle starts when it receives the Export ID from Cycle 1. Configure Cycle 2 to check the status of the export job, so if the status is
completed
, the cycle continues down thetrue
branch to retrieve the file content. If the status isn'tcompleted
, the cycle continues down thefalse
branch, waits for a specified amount of time, and then calls the starting webhook again to repeat the process of Cycle 2.
Follow the steps below for more detailed information on how to create the export cycles.
Set up Cycle 1
Select the Create Export Job method that you want to use, such as Activities, Leads, New Activities, or New Leads.
Define the fields you want the export file to include, such as
firstName
,lastName
, oremail
.Note: The method List Lead Fields from the Leads category retrieves a list of all fields available for interaction via the REST API, with their correct formatting.
Either select a file format, or leave the file format to default to CSV.
Note: The response from this method includes the status and the Export ID for use in subsequent methods
Add the export job you created to the processing queue with the method Enqueue Export Job, select the Export Type (
leads
oractivities
), and enter the Export ID. This changes the export job status toQueued
.From the Generic Webhook > HTTP Methods, drag POST onto the cycle builder.
The POST (and Webhook) method needs to be configured. To do so, go into the Generic Webhook's connector settings
Locate the POST method and add a custom request field, and set the Field Location and Display Name. This example uses
ExportId
as the Export ID is assigned to the field.Locate the Webhook method and add an identical custom request field.
In the cycle builder, select step setup on the POST step to see the field that you can map the custom request field to:
![create export job configuration](./images/marketo_export_14.png)
You also need a URL. The URL you can post the custom request field to is the URL of the webhook in Cycle 2.
Set up Cycle 2
Open the step setup for the webhook step to find the URL, and copy the URL into the POST step's URL field in Cycle 1
Map the custom request field to Get Export Job Status and Get Export File. You need to set the Export Type (
leads
oractivities
) for these methods.Use the Decision step, named Completed? in this example, to chedck the status of the export job. If the status is
completed
, the cycle continues down thetrue
branch, and if it's not complete, the cycle continues down thefalse
branch.To make the
true
branch lead to Read Delimited Text File from the Generic File connector, configure Read Delimited Text File so the Delimiter matches that of the export file. Set Has Headers totrue
and map Content from the Content field of Get Export File.Once the data has been retrieved and converted to JSON by Read Delimited Text File it's contents can be mapped to subsequent steps. (eg. MailChimp etc.)
To make the
false
branch repeat Cycle 2, add a Delay step from Logic Tools. The value should be greater than 60 secondsAdd another POST method and map it to the custom request field and the URL of the webhook at the beginning of Cycle 2.
Run the cycles
Now that both cycles are configured we can run them:
Run Cycle 2 first. Nothing happens because the cycle is on standby, ready to run when the webhook is triggered.
Run Cycle 1. This creates an export job, adds it to the processing queue, and sends the custom request field to the webhook of Cycle 2, to start the cycle.