Re: Marketo Deleted Leads endpoint slow for everyone or just me?

Chad_Floyd
Level 1

Marketo Deleted Leads endpoint slow for everyone or just me?

I need help with the Marketo Deleted Leads API endpoint. If I am doing this correctly, then it is too slow to be useful and gives really strange results.

I followed the instructions from This page: 

https://developers.marketo.com/rest-api/endpoint-reference/lead-database-endpoint-reference/#/Activi... 

and supplied nextPageTokens using

https://developers.marketo.com/rest-api/paging-tokens/ 

I am trying to pull 10 days worth of deleted leads. 

The behavior that I am experiencing is that the response object success = True, and moreResult = true but there is no 'result' data. In looping over this endpoint feeding in the response nextPageToken, I currently am up to 53 total requests to the Get Deleted Leads endpoint, and 50 of the 53 responses have no 'result' data. 

This operation took ~25 mins to get 3 deleted leads. 

Is this expected behavior?

Tags (1)
1 REPLY 1
Tony_Mayse
Level 3

Re: Marketo Deleted Leads endpoint slow for everyone or just me?

Yes, this is expected behavior. Referring to https://developers.marketo.com/rest-api/lead-database/activities/#deleted_leads you will find the note:

In some cases, this endpoint may respond with fewer than 300 activity items, but also have the moreResult attribute set to true.  This indicates there are additional  activities that can be returned and that the endpoint can be queried for more recent activities by including the returned nextPageToken in a subsequent call.  Note that the nextPageToken needs to be URL Encoded in the request.

The empty pages you're getting represent 300 leads with updates that haven't been deleted, but were checked by the API to see if they were. The number of requests you need to make will be proportional to the number of leads with updates during the requested time period. It works this way in order to be able to return each result in a timely manner. There is no bulk extract for deleted leads, so this is the best method.