SOLVED

Re: Folders Bulk API giving incomplete result

Go to solution
Anonymous
Not applicable

Folders Bulk API giving incomplete result

I am trying to retrieve the folders in bulk using the following API:

http://developers.marketo.com/rest-api/endpoint-reference/asset-endpoint-reference/#!/Folders/getFol...

But no matter what I give the maxDepth (greater than 2), the maximum number of folders in the result never exceeds 20, i.e. does not return all the folders to the given depth.

Is this the limitation of API?

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Folders Bulk API giving incomplete result

You want maxReturn=200​.

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Re: Folders Bulk API giving incomplete result

Hello,

Read here: http://developers.marketo.com/rest-api/paging-tokens/   under Position-Based.

So, in your request are you getting a nextPageToken value? If you do, you have to create an additional request adding nextPageToken=valueReceived, so you will get the next 20 folders.

Anonymous
Not applicable

Re: Folders Bulk API giving incomplete result

Hi Luis,

I am not getting any nextPageToken value in the response.

SanfordWhiteman
Level 10 - Community Moderator

Re: Folders Bulk API giving incomplete result

You want maxReturn=200​.

Anonymous
Not applicable

Re: Folders Bulk API giving incomplete result

You are right, by adding maxReturn=200, it increases the returned folders on the request.

This should be added to the documentation. Do you mind sending a feedback clicking on the bottom link on this page: http://developers.marketo.com/rest-api/assets/folders/

Also, would be nice to know in that same documentation the maximum number allowed for maxDepth parameter.

Anonymous
Not applicable

Re: Folders Bulk API giving incomplete result

I have two more questions related to this:

1. What if I want more folders to be fetched? I didn't find any nextPageToken even after adding maxReturn=200

2. Can we have a filter on the folderType to fetch the directory structure? (Eg: Fetch only folders of type 'Program')

SanfordWhiteman
Level 10 - Community Moderator

Re: Folders Bulk API giving incomplete result

1. Use offset for these APIs, not nextPageToken.

2. I don't think there's a direct filter here, but you can use the Programs API in concert with the Folders API to build out what you want.