Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
Hi,
I am new to using Windchill REST API, therefore, I'm just playing around for now.
But I would like to know how to GET all the xml documents from a specific folder. How can I do this?
I tried the following:
eg.
GET /DynamicDocuments
$filter @odata.type eq #PTC.DynamicDocMgmt.DynamicDocument
Error:
"message": "The system query option '$filter' has the not-allowed value '@odata.type eq #PTC.DynamicDocMgmt.DynamicDocument'."
try this :
It kinda worked. However, I just realized that our xmls and organized in sub folders. Hence why I trying to work with the type. E,.g downlaod all xml documents with a certain subtype of DynamicDocument.
I scrolled down to our subtype in WRS, e.g. GET /DynamicDocuments/PTC.DynamicDocMgmt.Condition
But all I get is metadata. How can I get the latest version of the full xml document?
Can you share some screenshot , I don't follow you
We have a folder within Products and then a bunch of sub-folders which contain the xml dita files. If I use the folder $filter would I have to use a filter for every sub-folder? If I use the type $filter, can it extract the full xml file based on the object type, e.g. Condition?
Essentially, I want all the xml files within the /ma_conditions folder, not just the metadata, we want the content.
you have to do it in 2 steps :
1- Get the ID of dynamic documents within the given folder, not sure if this can be done using REST https://www.ptc.com/en/support/article/CS328649
2- Get the content ,I'm using below :
https://PP-2112171334VE.portal.ptc.io:443/Windchill/servlet/odata/v5/DynamicDocMgmt/DynamicDocuments('OR%3Awt.epm.EPMDocument%3A5662935')/PrimaryContent
Note this will return the url to XML not the content directly as xml
Try something like ?$expand=Folders($levels=max)
page 26 and 35 in https://www.ptc.com/support/-/media/support/refdocs/Windchill_REST_Services/2,-d-,5/wrs.pdf?sc_lang=en
(and search in this document for 'folder', it occurs many times here)
then filter on folder name.
?$filter=Folder/Name eq ''<name>"
I have not done this myself. Good luck!
Looks like we will try a different route. Perhaps content will be exported, uploaded to AWS and use API from AWS. I'm not a developer therefore I struggled getting the above suggestions to work. I'm sure they are all good options, but I don't know API 😞