getMultipleLeads

Like getLead, this operation retrieves lead records from Marketo. Instead of data for a single lead, this call returns data for a batch of leads which match the criteria passed into the leadSelector parameter. The criteria can be a date range, such as the last updated date; an array of lead keys; or a static list.

Note: If you use an array of lead keys, you will be limited to 100 per batch; additional keys will be ignored.

If only a subset of the lead fields are required, the includeAttributes parameter should be used to specify the desired fields.

Each getMultipleLeads function call will return up to 1000 leads. If you need to retrieve more than 1000 leads, the result will return a stream position, which can be used in subsequent calls to retrieve the next batch of 1000 leads. The remaining count in the result tells you exactly how many leads remain. When fetching from a static list, the terminating condition is remainingCount == 0.

A common use case for this endpoint is to find leads that were updated on specific dates. The LastUpdateAtSelector lets you do this. Please see the “Find Leads Updated on Specific Date Ranges” article on the Marketo developer blog that describes how to do this.

Request

Field Name

Required/Optional

Description

leadSelector Required Can be one of the following 3 types:

  1. LeadKeySelector
  2. StaticListSelector
  3. LastUpdateAtSelector
LeadKeySelector: leadSelector->

keyType

Required The id type you wish to query. Values include IDNUM, COOKIE, EMAIL, LEADOWNEREMAIL, SFDCACCOUNTID, SFDCCONTACTID, SFDCLEADID, SFDCLEADOWNERID, SFDCOPPTYID.
LeadKeySelector: leadSelector->

keyValues->stringItem

Required List of key values. i.e. “lead@email.com”
LastUpdateAtSelector: leadSelector->oldestUpdatedAt Required The timestamp to specify the “since” criteria. i.e. Return all leads updated since the specified time. (W3C WSDL date-time format)
LastUpdateAtSelector: leadSelector->latestUpdatedAt Optional The timestamp to specify the “until” criteria. i.e. Return all leads updated up until the specified time. (W3C WSDL date-time format)
StaticListSelector: leadSelector->staticListName Optional when leadSelector->staticListId is present The name of the static list
StaticListSelector: leadSelector->staticListId Optional when leadSelector->staticListName is present The ID of the static list
lastUpdatedAt Deprecated Use LastUpdateAtSelector instead
includeAttributes Optional List of attributes you wish to fetch. Limiting the lead fields returned can improve the response time of the API.
batchSize Optional Maximum number of records to be returned. System will limit to 100 or batchSize, whichever is less
streamPosition Optional Used to paginate through large number lead responses. The streamPosition value is returned by the previous calls response field newStreamPosition

Request XML

Response XML

Sample Code – PHP

Sample Code – Java

Sample Code – Ruby