getLeadChanges

This API is just like getLeadActivity except that it operates on multiple leads at once. The operation checks for new leads created, lead field updates and other activities.

The result contains activities that caused the change along with a stream position to paginate through large result sets.

You must include an input parameter identifying which activity filters you wish to be returned in the result. If you want all activities, a blank value may be passed. For more than one activity filter, pass in a list of activity filters. The complete list of activity filter values can be found here.

Some example activity types are: ‘Visit Webpage’, ‘Fill Out Form’, and ‘Click Link’.

After SOAP API version 2_2 you can include a leadSelector.

For LastUpdateAtSelector, the oldestUpdatedAt value would correspond to the oldestCreatedAt value in the startPosition. And the latestUpdatedAt value would corresponds to the latestCreatedAt value in the startPosition.

Note: The limit number of leads supported in a LeadKeySelector is 100. If the number of leads exceeds 100, the API will throw a bad parameter exception and return a SOAP fault.

Request

Field Name

Required/Optional

Description

activityFilter->includeAttributes->activityType Optional (deprecated)

Use activityNameFilter instead

Limits the response to include only those activity types specified. See WSDL for all activity types.
activityFilter->excludeAttributes->activityType Optional Limits the response to exclude those activity types specified. See WSDL for all activity types

NOTE: You cannot specify both includeAttributes and excludeAttributes within the same call.

activityNameFilter Optional Limits the response to include only those activity filters specified. See all activity filter values.
batchSize Optional Maximum number of records to be returned. System will limit to 1,000 or batchSize, whichever is less.
startPosition Required Used to paginate through large number of activity responses.
startPosition->offset Optional The offset value is returned by the previous calls response field newStartPosition->offset.
startPosition->

oldestCreatedAt

Optional The timestamp used to filter results to only include leads created since the oldestCreatedAt. NOTE: You can use LastUpdateAtSelector->oldestUpdatedAt timestamp to specify oldestCreatedAt.
startPosition->

activityCreatedAt

Optional The timestamp used to filter results to only include leads with activity since activityCreatedAt. NOTE: You can use LastUpdateAtSelector->latestUpdatedAt timestamp to specify activityCreatedAt.
leadSelector Optional 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”
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

Request XML

Response XML

Note that within <leadChangeRecord> elements, the <id> element is being replaced by the <marketoGUID> element as unique identifier.  This change will occur in Spring 2017 release.  For additional information, please see this post.

Sample Code – PHP

Sample Code – Java

Sample Code – Ruby