Skip to main content
1-Visitor
May 23, 2019
Solved

How to retrieve documents information on WTPart using WTPart ID?

  • May 23, 2019
  • 3 replies
  • 5127 views

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? 

Best answer by amarsingh

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)

3 replies

1-Visitor
May 24, 2019

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

 

12-Amethyst
May 26, 2019

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

amarsingh12-AmethystAnswer
12-Amethyst
June 6, 2019

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)
17-Peridot
November 7, 2023

@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