Skip to main content
1-Visitor
Jan 22, 2020 5:09 AM UTC
Solved

Fetching Related Object of a Part

Hi,

     I am using Windchill Rest API and TwxIEWebService SOAP API. Using these APIs I am consuming CAD Documents and Change Request. But I am not getting any information of related part. Say Change Request "CR001" is related to Part "P0001", or CAD Document "CAD0001" is related to Part "P0002". How could I get the related Part information using REST or SOAP API?

12-Amethyst
Jan 23, 2020 2:59 AM UTC

Not sure what TwxIEWebService is but this will fetch your your affected objects in a JSON format given a CR

 

https://{HOST}/Windchill/servlet/odata/v3/ChangeMgmt/ChangeRequests('OR:wt.change2.WTChangeRequest2:{YOUROBID}')?$expand=AffectedObjects

 

It returns something like below

...

"AffectedObjects": [
{
"ChangeStatus": {
"Path": "https://{HOST}/Windchill/netmarkets/images/chg_pending9x9.gif",
"Tooltip": "Pending change exists"
},
"CreatedBy": "Some Name",
"CreatedOn": "2019-05-02T00:55:00Z",
"HasHangingChange": false,
"HasPendingChange": true,
"HasResultingChange": false,
"HasVariance": false,
"ID": "OR:wt.doc.WTDocument:54630",
"Identity": "Document name, 5.G",
"LastModified": "2019-05-08T23:27:11Z",
"Latest": true,
"LifeCycleTemplateName": "Lifecycle Name",
"Location": "/folder/location",
"ModifiedBy": "Some Name",
"Name": "Document name",
"Number": "1111111",
"ObjectType": "Subtype name",
"Revision": "5",
"State": {
"Value": "RELEASED",
"Display": "Released"
},
"TypeIcon": {
"Path": "https://{HOST}/Windchill/wt/clients/images/generic.gif",
"Tooltip": "Subtype"
},
"Version": "5.G",
"VersionID": "VR:wt.doc.WTDocument:38438"
},

...

4 replies

12-Amethyst
Jan 23, 2020 2:59 AM UTC

Not sure what TwxIEWebService is but this will fetch your your affected objects in a JSON format given a CR

 

https://{HOST}/Windchill/servlet/odata/v3/ChangeMgmt/ChangeRequests('OR:wt.change2.WTChangeRequest2:{YOUROBID}')?$expand=AffectedObjects

 

It returns something like below

...

"AffectedObjects": [
{
"ChangeStatus": {
"Path": "https://{HOST}/Windchill/netmarkets/images/chg_pending9x9.gif",
"Tooltip": "Pending change exists"
},
"CreatedBy": "Some Name",
"CreatedOn": "2019-05-02T00:55:00Z",
"HasHangingChange": false,
"HasPendingChange": true,
"HasResultingChange": false,
"HasVariance": false,
"ID": "OR:wt.doc.WTDocument:54630",
"Identity": "Document name, 5.G",
"LastModified": "2019-05-08T23:27:11Z",
"Latest": true,
"LifeCycleTemplateName": "Lifecycle Name",
"Location": "/folder/location",
"ModifiedBy": "Some Name",
"Name": "Document name",
"Number": "1111111",
"ObjectType": "Subtype name",
"Revision": "5",
"State": {
"Value": "RELEASED",
"Display": "Released"
},
"TypeIcon": {
"Path": "https://{HOST}/Windchill/wt/clients/images/generic.gif",
"Tooltip": "Subtype"
},
"Version": "5.G",
"VersionID": "VR:wt.doc.WTDocument:38438"
},

...

Translate
jbhatt1-VisitorAuthor
1-Visitor
Jan 23, 2020 9:29 AM UTC

I am getting 404 Not Found error for  "servlet/odata/v3" endpoint, but "servlet/rest" is working. Is there any configuration by which we can enable "odata" REST API?

Translate
12-Amethyst
Jan 23, 2020 10:01 PM UTC

I don't know when this was introduced, but we don't have it on windchill 1.1 REST Services but have it on windchill 1.6 REST Services. If you have it, it will show up here:

 
What is your Windchill version?

 

Translate