user1740742
user1740742

Reputation: 37

marketo rest api - filtertype unsubscribed

I am trying to use the REST API to export leads that have not unsubscribed. I have tried 'unsubscribed' as the filter type as well as some other spellings (from downloading/exporting the fields and checking their rest api spellings).

The error is 1011: Lookup field 'xyz...' is not supported. The api endpoint used (to which 'unsubscribed' or Unsubscribed is a filter type ):

StringBuilder url = new StringBuilder(host + "/rest/v1/leads.json?   access_token=" + getToken() + "&filterType=" + filterType + "&filterValues=" + csvString(filterValues));

Can you let me know if it is possible to export leads based on unsubscribed status, using the REST API (ive seen some references that point to using the MultiLeads SOAP API but surely REST should be as capable); and also recommend a way of doing so?

Thanks!

Upvotes: 2

Views: 322

Answers (1)

Jep
Jep

Reputation: 384

You cannot directly export Leads that are NOT unsubscribed. More broadly, you can't really export any Leads based on field criteria because the Get Leads by Filter Type API call does not return more than 1,000 records in total, by design.

Additionally, it is likely that this API call does not work for the Unsubscribed field, but even if it would, you'd run into the above limitation.

I would ask your Marketo Power User to create a Smart Campaign that adds the Leads that are NOT unsubscribed to a Static List. You can then use the Get Leads by List ID API to retrieve all Leads on that List.

Upvotes: 1

Related Questions