cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

How to create WTDocument using Rest ODATA API?

Pushpak
11-Garnet

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 3
avillanueva
22-Sapphire II
(To:Pushpak)

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

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

 

Thanks for response @avillanueva .

Tried this way also but still facing the same issue.

Pushpak_Bannore_0-1676262395394.png

 

amarsingh
12-Amethyst
(To:Pushpak)

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

Announcements

Top Tags