Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X
Version: Windchill 12.1
Use Case: I want to create a Document with Windchil REST Services 2.5. I used the PTC Document Management Domain with POST /Documents.
Description:
By using the Body of the example from Creating a Document (ptc.com)
{
"Name": "TestDoc1",
"Description": "TestDoc1_Description",
"Title": "TestDoc1_Title",
"Context@odata.bind": "Containers('OR:wt.pdmlink.PDMLinkProduct:48788507')"
}
i recieve
Error: 403
{ "error": { "code": null, "message": "Windchill type is not instantiable" } }
Any ideas that can help?
Solved! Go to Solution.
@DK_9661096 Not ObjectType but wcType and it should take the full qualified name e.g. "wcType": "wt.document.MyDocumentType".
If it does not work, then you should extend or customize the domain, whenever you create a soft type, it will generate its specific get endpoint but not post, so needs an extension.
Is the type instantiable on type and attribute management?
That seems the right hint, that brings me to the next question.
The main type "Document" is not instantiable, but the subtype I want to create is instantiable. So how do i create a subtype of a document? I tried to specify the "ObjectType" that is used by exiting subdocuments but it doesn't work and results in the same error.
{
"ObjectType": "MyDocumentType",
"Name": "TestDoc1",
"Description": "TestDoc1_Description",
"Title": "TestDoc1_Title",
"Context@odata.bind": "Containers('OR:wt.pdmlink.PDMLinkProduct:48788507')"
}
@DK_9661096 Not ObjectType but wcType and it should take the full qualified name e.g. "wcType": "wt.document.MyDocumentType".
If it does not work, then you should extend or customize the domain, whenever you create a soft type, it will generate its specific get endpoint but not post, so needs an extension.
Thank you very much for that hint! It works fine with "@odata.type": "#PTC.DocMgmt.MyDocumentType".