Skip to main content
Feb 9, 2023 9:46 AM UTC
Question

How to create WTDocument using Rest ODATA API?

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!!!

 

 

 

 

 

3 replies

Feb 10, 2023 2:33 PM UTC

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

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

 

PushpakAuthor
Feb 13, 2023 4:27 AM UTC

Thanks for response @avillanueva .

Tried this way also but still facing the same issue.

Pushpak_Bannore_0-1676262395394.png

 

Feb 28, 2023 7:05 PM UTC

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>')"
}