GET Lead Activities API

Anonymous
Not applicable

GET Lead Activities API

Hi,  We are using Marketo REST APIs in order to get lead activities. On the first step we are using "GET Activity Type API"  In order to find the activity_type_id and the attributes of each. Then, we are using "GET Paging Token API" in order to get nextPageToken (which is mandatory parameter in "GET Lead Activities API") Finally, we are using "GET Lead Activities API" and  sending a request including the nextPageToken and the relevant activity_type_id.  For example (request for Get Lead Activity API) : https://891-VEY-973.mktorest.com/rest/v1/activities.json?access_token=25e14f7f-8afe-420e-8d02-8698786b26ff:lon&nextPageToken=WQV2VQVPPCKHC6AQYVK7JDSA3KGQBPRXP2GHRSCI4WEBV5XZF4GQ====&activityTypeIds=39  There are some activity types (looks like activity type id above 38) that returns response as following (example):   {"requestId":"9a5a#14be3933a56","success":true,"nextPageToken":"WQV2VQVPPCKHC6AQYVK7JDSA3KAHI6PT4KCUMBA4LHTP6JLRRLPQ====", "moreResult":true}  It looks like there should be a results,moreover, it looks like there are more results (morResults attribute is true) . However, there is no "result" attribute in the response.  Can you please advise?  Thanks, Shiran
Tags (1)
3 REPLIES 3
Anonymous
Not applicable

Re: GET Lead Activities API

You would need to keep iterating through using the nextPageToken. The moreResult flag is true because there are more results, but none for that given time period. As you iterate through, you will see the other results.
Anonymous
Not applicable

Re: GET Lead Activities API

Thanks for your reply 🙂
I kept the iterations using the nextPageToken (until the morResult attribute returned false), and there were no results in all iterations...
What am I missing?  
Anonymous
Not applicable

Re: GET Lead Activities API

The API does not know if there are results for the unsearched timeranger. The moreResult attribute says there could be more results in a later timerange, but that timerange has not been searched yet. So you have to keep iterating through the results to find out if there are results. The API was designed this way to more efficiently return results by searching through a specific range, rather than searching entire db until results are found.