Using the Marketo REST API with Boomi Part 2: Getting Leads from a Static List

John_M
Marketo Employee
Marketo Employee

In Part 1 of this series, I discussed how it was possible to start using the REST API through Boomi with the Boomi HTTP connector, specifically getting the authentication token needed to access the REST API, and storing it in a Process Variable.

Next up, we’ll begin making calls into Marketo, and in this installment, I’ll show you how you can Get Multiple Leads By List ID and next I'll show you how to Remove Leads from List​ (in bulk, which is tricky).

boomi1

For this installment and the next we’ll be looking at the second highlighted area.

As a review, I’ve included the JSON response we’ll be needing below. Recall that to create a JSON profile in Boomi, all you need to do is create a profile component of type JSON, and click “import” and select the file. Boomi does the rest, extrapolating things like if there should be multiple IDs allowed.

Example JSON for Get Multiple Leads By List ID

{ "requestId": "", "success": true, "nextPageToken": "", "result": [ { "id": 0, "email": "", "firstName": "", "lastName": "" }, { "id": 0, "email": "", "firstName": "", "lastName": "" }, { "id": 0, "email": "", "firstName": "", "lastName": "" } ] }

Step 1: The Get Multiple Leads by List ID

Drop another connector (Get) into your process, using the same connection as defined in the previous article.

Create a new operation called “Get Multiple Leads by List ID” (I’m a stickler for consistency) It’s attributes are as follows
– Request Profile: None (this one uses the request URL)
– Response Profile Type: jSON
– Response Profile: Create a new profile based on the Get Multiple Leads by List ID Response above.

Note that you can change it so that it returns the fields you want, not just the ones listed. Its important to remember that the JSON response profile should really match the list of fields you’re asking for from the REST API, and you should request only the fields you need. In the Process Properties object, we defined a property called “fields” which is a comma separated list of the fields you want REST to return.. and that’s the list that has to match the profile.
Content Type: text/plain (this is just a URL request)
HTTP Method: GET (you look this up in the REST API docs, its always listed)
Resource Path (add 5)
rest/v1/list/
listID (replacement variable)
/leads.json?access_token=
access_token (replacement variable)
&fields=
fields (replacement variable)

booomi2

Then in the parameters tab on the connector, you can enter the variable values, all of which we previously populated into the process properties. In the next section I’ll talk about how you can avoid populating these manually

boomi3

Im going to skip the part of the process where I map the response for Get Multiple Leads by List Id into a flat file profile and stick it on an FTP server because that’s straightforward Boomi functionality.

Part 3 is below!

Using the Marketo REST API with Boomi Part 3: Removing Leads from a Static List

1303
0