Marketo REST API returns Empty result

Subigya
Level 1

Marketo REST API returns Empty result

I have been trying to access user activity using the Marketo API. But when I enable the filter for my form using the assetIds property, I get an empty result, even though the moreResult parameter is true. 
I have tried sending subsequent requests using the nextPageToken from the response using a script 40+ times. Still I don't get any results even though i can see there are activities for that form via the Marketo UI.

{
    "requestId": "cff5#194afe31292",
    "success": true,
    "nextPageToken": "V54QFQASDKUGS7WTQJFWFEQV3LEYG5A4FQ4BZGTUE7ZDQMS3U5MA====",
    "moreResult": true
}
2 REPLIES 2
SanfordWhiteman
Level 10 - Community Moderator

Re: Marketo REST API returns Empty result

You have to poll until moreResult is false, 40 pages may not be enough because you're cursoring through lots of other activities.

Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Marketo REST API returns Empty result

@Subigya, I think you'd also need to set the "activityTypeIds" (and mention the activity type ID corresponding to the "Fill out Form" activity). You can get your instance's activity types and IDs using the GET Activity Types API endpoint. The documentation says the "assetIds" parameter should only be used when a single activity type is set.