Skip to main content
11-Garnet
February 9, 2023
Question

How to create WTDocument using Rest ODATA API?

  • February 9, 2023
  • 2 replies
  • 2371 views

Hello,

I want to create a WTDocument using windchill rest service there is an API under Document Management.

Could you please help me for the providing proper input.

The input JSON is below-

{
"Title": "",
"Number": "1234",
"Description": "Text",
"Name": "test",
"@odata.type": "#PTC.DocMgmt.EngDoc",
"SmallThumbnails@odata.bind": [
""
],
"PrimaryContent@odata.bind": "",
"Thumbnails@odata.bind": [
""
],
"Context@odata.bind": "Containers('OR:wt.pdmlink.PDMLinkProduct:188653')",
"Folder@odata.bind": "",
"Attachments@odata.bind": [
""
]
}

I am always getting "The binding link '' is malformed"  exception.

Thanks!!!

 

 

 

 

 

2 replies

avillanueva
23-Emerald I
23-Emerald I
February 10, 2023

Not an expert in REST here but is this your solution?

https://www.ptc.com/en/support/article/CS375783?source=search

 

Pushpak11-GarnetAuthor
11-Garnet
February 13, 2023

Thanks for response @avillanueva .

Tried this way also but still facing the same issue.

Pushpak_Bannore_0-1676262395394.png

 

12-Amethyst
February 28, 2023

I have not been active in Windchill REST Services but at a glance, I can see a few possible problems:

  • Navigation binds like Folder should have the entity type mentioned like "Folder@odata.bind": "Folders('<folder_id>')".
  • I am not sure if you can add other Navigation types like SmallThumbnails, PrimaryContent, Thumbnails, Attachments. Check them in your metadata. But I am sure that Context and Folder are allowed & required.

This does should work

{
"Name": "test",
"Description": "Text",
"Title": "Test1 Title",

"Context@odata.bind": "Containers('OR:wt.pdmlink.PDMLinkProduct:188653')",
"Folder@odata.bind" : "Folders('<folder_id>')"
}