Questions about getting all unsubscribed leads

Not applicable

Questions about getting all unsubscribed leads

Hi everyone!

I am using the Marketo REST API.

I would like to get all the leads that have been unsubscribed since specific date

So the first api call looks like that:


Then in the response i get the "nextPageToken", so i sent another API call to get specific fields:


In the response I'm NOT getting the guid field(custom field)


  "id" : 123456,

  "leadId" : 235987,

  "activityDate" : "2017-01-10T16:07:48Z",

  "activityTypeId" : 13,

  "fields" : [{

  "id" : 75,

  "name" : "unsubscribed",

  "newValue" : "true",

  "oldValue" : "false"



  "attributes" : [{

  "name" : "Reason",

  "value" : "Manual lead edit"

  }, {

  "name" : "Source",

  "value" : "Lead update"




Additional questions:

1. How can I fetch all the leads which their unsubscribed field has 'true' value?

2. How can I fetch custom fields?


Tags (2)
Level 10 - Community Moderator

Re: Questions about getting all unsubscribed leads

The fields param refers to the fields whose updates will be shown.  If there weren't any changes to that field in the timeframe, there wouldn't be any matching results.

You can't directly fetch all leads who have Unsubscribed = true because the cardinality is too low. See this other recent thread for pointers: export leads that have not unsubscribed using rest api