2

Does Autodesk Forge Data Management API have a tool for getting a list of folders?

I have only found a Search within Folders API that gets files, not folders... What's the best approach to get this list? Is it to iterate through the folders hierarchy making new requests for each folder level?

1
  • As I know, it is not available yet. We have had a wish ticket # FDM-3540: Expose API endpoint to get/create folder hierarchy for external customer. Commented Nov 5, 2021 at 9:44

1 Answer 1

1

You should be able to use the Get Top-Level Project Folders endpoint to retrieve the folders within a project at the top-level, and from there you can use the Get Folder Contents endpoint to retrieve the content of that folder (including any sub-folders).

Sign up to request clarification or add additional context in comments.

6 Comments

Get Folder Contents is only retrieving the first level under folder_id, not including it's sub-folders. So I have to iterate thought the hierarchy with multiple calls. Is there any parameter I am missing to get the folder content and it's sub-folders content, with only one API call?
That's interesting, the documentation states that the Get Folder Contents endpoint "Returns a collection of items and folders within a folder". Can you update your question with the code that looks at the response data of the Get Folder Contents request?
Get Folder Contents returns first-level sub-folders only. It does not return the descendent folders. While with my understanding, what @anthip is looking for is get hierarchy of folders by one call. It is not available yet unless you iterate recursively. We have had a wish ticket # FDM-3540: Expose API endpoint to get/create folder hierarchy for external customer. Sorry for the bad news.
Thanks Xiadong. That's the answer to my question. The problem is when we are dealing with projects with hundreds of folders and we get the error "to many requests" while iterating. I'll have to deal with it, someway, maybe with a delay when that error occurs, and continue after that.
When trying to get all the hierarchy, if you have a lot of differents levels with a lot of folders, you get sometimes too many requests errors. To deal with that you can try to make a queue system to limit the number of simultaneous requests. Also when you get these errors, try it again after waited the time you received in this error.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.