ptc-windchill

Windchill - Add Related object to part using REST API


I'm currently aware on how to create a Part and how to create a Document using the REST API. I'm currently on V11M30. What I need to reproduce using the API are the following steps:

1- Check out the part: enter image description here

2- Create a new Document with attachments

enter image description here enter image description here

3- Add the document to the part

enter image description here

Using the REST API I know how to:

1- Check out the part

/ProdMgmt/Parts('WTPartID')/PTC.ProdMgmt.CheckOut

2- Create the document

/DocMgmt/Documents

3- Check out the document

/DocMgmt/Documents('WTDocumentID')/PTC.DocMgmt.CheckOut

4- Upload content from local file or URL to the new document (Attachments/Primary content)

5- Check in the document

6- Check in the part

What I don't know is how to relate / associate the document to the part. This means that the document will be created, but it won't show up in the "Related Objects" [Image 3] section of the part.


Solution

  • To create a WTPartDescribeLink have a look on:

    /ProdMgmt/Documents('WTDocumentID')/Describes
    

    with body

    "Describes@odata.bind" : "Parts('WTPartID')"
    

    Please refer to this helpful article : https://www.ptc.com/en/support/article/CS285572