3

We need a way to mimic the BIM 360 Docs file manager in our custom integration and using Forge APIs for that do not do the trick. We are trying to retrieve a list of subfolders of a given folder using a single API call.

The way we are trying to do it right now is using this endpoint, with filters

/data/v1/projects/{{ProjectId}}/folders/{{FolderId}}/contents?filter[extension.type]=folders:autodesk.bim360:Folder

There is a problems with this approach though. Long story short, it's very ineffective. Since filters are applied after pagination (why?) one has to iterate over all pages in the resultset in order to find all subfolders in a given folder. This can take very long time and usually requires many of roundtrips to the server when querying folders with many items in them. Each call to this endpoint averages at 700ms, which is too long if we are to call this endpoint multiple times.

On the other hand, BIM 360 Docs web app internal API uses an endpoint which does just that in a single call and usually under 300ms.

GET https://docs.b360.autodesk.com/api/v1/projects/875bb618-ec50-4bd8-92c7-e7d7a145de58/folders/urn%3Aadsk.wipprod%3Afs.folder%3Aco.lQJO7gkbRKKF5EZcEFWF9g/folder_tree?include_permission=false

Two questions:

  1. Can BIM 360 Docs undocumented APIs from the https://docs.b360.autodesk.com/api/v1/ domain can be used in 3rd party integrations? Is there a documentation for these?
  2. If #1 is not an option, what is the best way to achieve what we need using current Forge/BIM360 public APIs?
Sebastian Zaklada
  • 2,308
  • 1
  • 14
  • 25

2 Answers2

0

Have you tried using page[limit] parameter? You can use up to 200 when listing folder, which should significantly reduce your need for additional calls.

From your question, based on the documentaiton, I tested with:

/data/v1/projects/:project_id/folders/:folder_id/contents?filter[extension.type]=folders:autodesk.bim360:Folder&page[limit]=200

And I would suggest NOT using undocumented endpoints, these can change without notice.

Augusto Goncalves
  • 8,493
  • 2
  • 17
  • 44
  • 1
    That does not help much. I believe that the default page size limit is set to 200, so mentioning it explicitly in the request does not change anything. Imagine a Plans folder with thousands of sheets in it and one subfolder. In my testing that folder can show up on any page of the resultset, in one particular testing use case that we have it's on the 6th page. Still requires recursive querying. – Sebastian Zaklada Jun 28 '18 at 12:30
  • 2
    Also, is there a specific reason why filters are applied after pagination? That's very confusing and leads to many empty or small pages. While consuming paginated payload I expect it to have an uniform page size and definitely no empty pages, otherwise querying the API becomes very inefficient. – Sebastian Zaklada Jun 28 '18 at 12:32
  • agree, I'm logging that so my development team can investigate how to improve it. thanks! – Augusto Goncalves Jun 28 '18 at 19:27
  • How can I know what's the status of this request/investigation and when it would be fixed? I appreciate your help Augusto! – Sebastian Zaklada Jul 03 '18 at 12:36
  • This issue is now tracked as **AUT-136** in our internal systems. – Sebastian Zaklada Jul 03 '18 at 13:08
  • @SebastianZaklada on our system is logged as FDM-1850 – Augusto Goncalves Jul 03 '18 at 14:55
  • It seems this is still under development (? or rejected?) as still does the pagination before filtering and imho it's not logical. also the search does not work, always returning 403 – Afshin Apr 13 '21 at 02:45
0

What I did in Workato, was create 2 recipe functions. THe first function I pass project and folder ID, this calls the second recursively and the enc returns the parent. In the first function I build up the folder path like that, and the process stops once the top level folder is reached.

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 31 '23 at 01:00