Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do i get the list of all the leads in Marketo

Tags:

rest

marketo

I want to get all leads in Marketo using their Rest Apis. Is there a way to do this? I have already tried the getLeadChanges api, however that only returns leads with changed fields.

like image 891
user1999086 Avatar asked Jan 28 '15 04:01

user1999086


1 Answers

Leads in Marketo are assigned lead ids in sequential order starting with 1. Using the Get Multiple Leads by Filter Type REST API endpoint, you can query 300 leads by lead id with each call.

You will have to specify id as the filterType and the lead ids as the filterValues with each call to this endpoint. To get all leads, you would iterate through the total number of leads 300 at a time.

The first API call would be (replace ... with all the values in between):

/rest/v1/leads.json?filterType=Id&filterValues=1,2,3,...,298,299,300

The second API call, and each subsequent API call would follow the same pattern:

/rest/v1/leads.json?filterType=Id&filterValues=301,302,303,...,598,599,600
like image 171
Murtza Manzur Avatar answered Oct 13 '22 03:10

Murtza Manzur