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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Add an ODATA REST endpoint for a custom Document Subtype

BH_10195712
4-Participant

Add an ODATA REST endpoint for a custom Document Subtype

I've added a custom subtype to Document called MyDocument. It has three additional string fields. I'd like to create a batch of MyDocument in the same or similar way I can create a batch of documents by POSTing to 

/Windchill/servlet/odata/v5/DocMgmt/CreateDocuments
I've tried to post an array of MyDocuments to the above endpoint that look like this:
'Title': "Default Title",
'Number': var.document_number,
'Description': "Default Description",
'Name': var.document_number,
'@data.type': "#PTC.DocMgmt.MyDocument",
'CustomAttrOne': var.customOne,
'CustomAttrTwo': var.customTwo,
'CustomAttrThree': var.customThree,
'Context@odata.bind': `Containers('${var.containerId}')`,
'Folder@odata.bind': `Folders('${var.folderId}')`,
'Thumbnails@odata.bind': [],
'SmallThumbnails@odata.bind': [],
'Attachments@odata.bind': []
 
But I'm getting a 400 rejection. In fact, I get a 400 error any time I try to set the @data.type field. I've tried dropping the leading pound symbol, using the PTC variant, and my com.orgname variant. Is there a way for me to use CreateDocuments to create a group of custom Document subtypes in this way or will I need to publish a custom endpoint?

 

0 REPLIES 0
Announcements

Top Tags