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

Fetching Related Object of a Part

SOLVED
Participant

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Fetching Related Object of a Part

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"
},

...

View solution in original post

4 REPLIES 4
Highlighted

Re: Fetching Related Object of a Part

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"
},

...

View solution in original post

Highlighted

Re: Fetching Related Object of a Part

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?

Highlighted

Re: Fetching Related Object of a Part

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?

 

Highlighted

Re: Fetching Related Object of a Part

Got your point. We have Rest 1.1. We need to update it on Rest 1.6

Announcements