Reputation: 11
I am having trouble with the GET endpoint for folder contents (https://forge.autodesk.com/en/docs/data/v2/reference/http/projects-project_id-folders-folder_id-contents-GET/). I am trying to retrieve item version IDs of >200 .rvt element models because I am uploading a coordination model, where these element models are links. The problem is that I can only retrieve the IDs for the first 200 elements because of the limit on the endpoint. When I then try to use the page number query parameter, I always get the same 200 elements returned. I am probably just using it wrong.
request.RequestUri = new Uri("https://developer.api.autodesk.com/data/v1/projects/" + projectID + "/folders/" + folderID + "/contents?page[" + pageNumber + "]");
The projectID and folderID are found earlier. The pageNumber is an optional method parameter and is default 0. If the return is then 200 elements long which is the limit, I recursively call the method again with an incremented counter. This all works just fine, but it just keeps returning the same 200 element regardless of the pagenumber and thus loops forever. How do I set this up properly?
Upvotes: 0
Views: 175
Reputation: 11
I was indeed using the query parameter wrong - I've never used Http requests before, so to other people who also haven't. The correct setup is to do "/contents?page[number]=" + pageNumber"
Upvotes: 0