Retrieving Options Values
IDs for option sets and option choices are used in the navigation criteria for options.
To retrieve these values, a sequence of GET requests is used to retrieve the following:
Retrieving an Option Set ID Value For a Part
The ID value for an option set is specified as the OverrideOptionSetRevision value. You can retrieve the ID for the option set that is currently assigned to a part by submitting a GET request to the following URL:
http://<Windchill Hostname>:<port>/Windchill/servlet/odata/ProdMgmt/Parts('<OID>')/AssignedOptionSet
The <OID> value in the URL is the OID for the part from which you are retrieving the option set that is currently assigned. To find the OID for the part, right-click on the part from a Structure tab in Windchill and select View Information. The OID is the at the end of the URL that is displayed in the browser bar, after oid=.
For example, in the following URL, OR:wt.part.WTPart:240484 is the OID:
https://<hostname>:<port>/Windchill/app/#ptc1/tcomp/infoPage?oid=OR:wt.part.WTPart:240484
In the returned code, the ID for the option set is the value for the root level ID element. For example:
{ "ID": "OR:come.ptc.windchill.option.model.OptionSet:273822" }
This option set ID is the value to be used as the value for the OverrideOptionSetRevision element in the navigation criteria for your JSON payload.
Retrieving the Option ID Values for an Option Set
The ID value for an option is used to retrieve the option choice ID values; it is not used in the JSON payload.
To retrieve the option ID values for a particular option set, submit a GET request to the following URL:
http://<Windchill Hostname>:<port>/Windchill/servlet/odata/ProdPlatformMgmt/OptionSets('<Option Set ID>')/Options
In the URL, the <Option Set ID> value is the ID for an option set found as described in Retrieving an Option Set ID Value For a Part.
In the returned code, each option in the option set is shown as a JSON object. Find the JSON object with the Name value for the particular option that you want to use. The ID element within that JSON object is the ID for the option.
Retrieving the Option Choice ID Values for an Option
The name and ID value for an option choice are specified in the options navigation criteria as an item within a ChoiceValues object array.
To retrieve the option choice ID values for a particular option, submit a GET request to the following URL:
http://<Windchill Hostname>:<port>/Windchill/servlet/odata/ProdPlatformMgmt/OptionSets('<Option Set ID>')/Options('<Option ID')/Choices
In the URL:
The <Option Set ID> value is the ID for an option set found as described in Retrieving an Option Set ID Value For a Part.
The <Option ID> value is the ID for an option in an option set found as described in Retrieving the Option ID Values for an Option Set.
In the returned code, each choice for an option is shown as a JSON object. Find the JSON object with the Name value for the particular option choice that you want to use. The ID element within that JSON object is the ID for the option choice. Use the ID and Name elements for the option choice as an item in the ChoiceValues object array.
Was this helpful?