1 Reply Latest reply on Jan 30, 2017 12:47 PM by sanford.whiteman

    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:

      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!