Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X
Version: Windchill 12.1
Use Case: I need to traverse the folder structure in a Windchill Library via the REST API's
Description:
I see there are a few relevant API's.
"/v6/DataAdmin/Containers('"+containerId+"')/Folders" provides us with a way to get the root folder, which I believe is pretty much always "/Default", but how do I get the list of folders in that folder, to recursively traverse the folder structure?
I see there is "/v6/DataAdmin/Containers('"+containerId+"')/Folders('"+folderId+"')" but that only gives me the information about the folder I already have the ID for and does not tell me what subfolders exist in that folder.
Solved! Go to Solution.
In order to get the subfolder in a given folder via the WRS REST API's, include the $expand parameter with a value of "Folders".
This causes the API to include a Folders objects as part of the JSON response and fills in each of the subfolders.
Search the PTC Support site for Windchill REST Services User Guide for more information on the expand parameter.
Hi,
You need to use the '$expand' param. You need to build the expand param based on the level of the folder structure.
Example:
In this case the folder path is "/default/MyFolder"
Thanks,
Thiagarajan
I am guessing you are right about the expand parameter, but what you suggested is not working for me. I get a URI is malformed error.
That helped me get to the solution. Thanks Thiagarajan.
Hi @AdamElkins,
I wanted to see if you got the help you needed.
If so, please mark the appropriate reply as the Accepted Solution. It will help other members who may have the same question.
Of course, if you have more to share on your issue, please pursue the conversation.
Thanks,
Anurag
Still looking into it, thanks.
In order to get the subfolder in a given folder via the WRS REST API's, include the $expand parameter with a value of "Folders".
This causes the API to include a Folders objects as part of the JSON response and fills in each of the subfolders.
Search the PTC Support site for Windchill REST Services User Guide for more information on the expand parameter.
It isn't obvious at all what needs to be done if you need to create a subfolder in one of these nested folders. The Create Folder json request appears not to work no matter what I try,