Skip to main content
11-Garnet
March 31, 2023
Question

ODATA Create Folder

  • March 31, 2023
  • 3 replies
  • 1748 views

Hello,

can anybody have a hint of what am I doing wrong? I am trying to create subfolder in the Windchill, using Postman application but all I got is the message "The syntax of the JSON document is not valid.".

The query is POST:

https://<myserver>/Windchill/servlet/odata/v5/DataAdmin/Containers('OR:wt.pdmlink.PDMLinkProduct:169546')/Folders('OR:wt.folder.Cabinet:169590')/Folders('OR:wt.folder.SubFolder:248107')/Folders

 

and the body is: (the example is from WIndchill REST Guide 2.4 page 466.

{
 "Name": "NewFolder", 
 "Description" : "Desc",
}
 
the headers are:
nbojcetic_0-1680266646500.png

 

Also, Authorization is done using wcadmin account.

I tried different data in json body but without luck.

Does anyone have a clue what is the problem?

 

Best regards!

 

 

 

 

3 replies

4-Participant
July 25, 2024

Hello,
I'm facing similar issue.
Using curl function I need to add \before each " of the body (it is working for checkout)
But with a normal send it is not working.
Did you solve it

HelesicPetr
22-Sapphire II
22-Sapphire II
July 26, 2024

Hi @nbojcetic 

Try to create the folder from a Windchill restApi documentation UI.

You can try it from the UI and you can find if the json is well formatted.

https://serverAdress.com/Windchill/netmarkets/html/wrs/doc.html

HelesicPetr_0-1721976275333.png

HelesicPetr_1-1721976370432.png

examples

"Folder@odata.bind": "Folders('OR:wt.folder.SubFolder:199456')"

"@odata.type": "#PTC.NavCriteria.WTPartStandardConfigSpec",

 

for the type I would try to find a type for the SubFolder. I guess it could be something like

"#PTC.Folder.SubFolder" but I don't know exactly. 

PetrH

 

14-Alexandrite
July 26, 2024

@nbojcetic , @VB_2025784 Please use the Swagger UI to run endpoints, your payload does not contain all necessary data as @HelesicPetr explained.

 

Also, it could be a permission issue, try to create the folder on the exact context with the same user on the UI; but I guess it's not the root cause.

12-Amethyst
August 22, 2024

You must enter the default folder ID under the product

POST /Windchill/servlet/odata/DataAdmin/Containers(<oid>)/Folders(<oid>)/Folders

Folders(<oid>) : This is the default folder ID

EX) Containers('OR:wt.pdmlink.PDMLinkProduct:131308')/Folders('OR:wt.folder.Cabinet:131359')/Folders('OR:wt.folder.SubFolder:146353')/Folders"
sample VBA CODE

Please! tell me how to create wtpart       T.T . . .