AnsweredAssumed Answered

Questions about getting all unsubscribed leads

Question asked by a8f115c3e6319f8b69a4b3bdf9b4abfac4f6da00 on Jan 30, 2017
Latest reply on Jan 30, 2017 by sanford.whiteman

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:

https://<baseurl>/rest/v1/activities/pagingtoken.json?access_token=<***>&sinceDatetime=2017-01-01'T':01:01

 

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

http://<baseUrl>/v1/activities/leadchanges.json?access_token=****&nextPageToken=****&fields=unsubscribed,guid

 

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?

 

Thanks!

Outcomes