Search code examples
autodesk-forgeautodeskautodesk-bim360autodesk-data-management

APS Data Management API Folder Search endpoint


I'm trying to find all Cloud Models in a specific project using the search endpoint

I have two issues:

  • filter[attributes.extension.type]=items:autodesk.bim360:C4RModel is not working at all, it returns nothing, but getting the contents of a specific folder returns such items
  • filter[attributes.extension.type]=versions:autodesk.bim360:C4RModel finally returns something, but I can't understand why I have to specify page[number] in the request, when some pages have only a few returned items, or even none. The page limit seems to be applied on the source data rather than the filtered data. With this behaviour how can I know how much pages do I need to iterate through, if I have to expect empty results? What's the point of the filter parameter if it works like this?

Solution

  • Yes, pagination has complicated the functionality of the original API.

    Specifically:

    1. "Most of the endpoints that support filtering support pagination. However, filtering can cause the following unexpected behavior" ref: https://aps.autodesk.com/en/docs/data/v2/developers_guide/filtering/

    2. "The only true indication that you have reached the last page is if a link for the next page meta.links.next is missing from the end of the page"

    See here for details: https://aps.autodesk.com/en/docs/data/v2/developers_guide/filtering/#pagination

    Finally,

    1. "Note: that when pagination is combined with filtering, the pagination parameters are applied before filtering. This may result in fewer records per page than expected. Always check for the existence of a links.next.href element to determine if additional pages are available.

    https://aps.autodesk.com/en/docs/data/v2/developers_guide/pagination/#project-and-data-service-pagination

    We are working on improving this experience using GraphQL via the newer AEC Data Model.