Skip to main content
May 23, 2019 4:48 PM UTC
Solved

How to retrieve documents information on WTPart using WTPart ID?

I have a WTPart ID "OR:wt.part.WTPart:4911695"

I have DescribedBy and Reference Documents associated with it. How to retrieve the documents information using the part id or WTPartDescribeLink or  WTPartReferenceLink? What does the EndPoint URL look like? 

amarsinghAnswer
Jun 6, 2019 12:30 PM UTC

This REST call will give what you are looking for

GET <windchill_server>:<port>/Windchill/servlet/odata/ProdMgmt/Parts('part_id')?$expand=DescribedBy($expand=DescribedBy),References($expand=References)

4 replies

May 24, 2019 12:19 PM UTC

Hello,

 

I'm not sure if I understood well your question. To retrieve the described by/reference documents you can access the 'Related Objects' tab, tables: Described By/Reference Documents of the Part you want.

No URL will give you that type of information. On the other hand, you could create a SQL statement to pass your WTPart ID and join the describe by and reference tables to retrieve such information.  

 

Best regards,

Diogo Martins

 

May 26, 2019 10:25 AM UTC

Hi

The Windchill REST API can be used to retrieve all drawings of a particular part.

Example

https://windchill.acme.com/Windchill/servlet/rest/structure/drawings/OR%3Awt.part.WTPart%3A102799?useParts=true

Result

{
"items": [{
"id": "OR:wt.epm.EPMDocument:102871",
"typeId": "WCTYPE|wt.epm.EPMDocument"
}]
}

Currently, I do not know if there is a way to get other documents than drawings with REST.

Kurt

amarsinghAnswer
Jun 6, 2019 12:30 PM UTC

This REST call will give what you are looking for

GET <windchill_server>:<port>/Windchill/servlet/odata/ProdMgmt/Parts('part_id')?$expand=DescribedBy($expand=DescribedBy),References($expand=References)
Nov 7, 2023 8:36 PM UTC

@amarsingh  @rgurram 

Amar, it has been a long time and I am on WC 12.0.2 but maybe this can still work. However, I am getting an error:

Windchill/servlet/odata/ProdMgmt/Parts('OR:wt.part.WTPart:4299999929')?$expand=DescribedBy($expand=DescribedBy),References($expand=References) <Response [500]>
Warn: {"error":{"code":null,"message":"JS Error ReferenceError -- \"SessionHelper\" is not defined"}}

What is going wrong? How can I define SessionHelper for this?

thanks

Rick