Windchill REST Services Domain Capabilities > Examples for Basic REST Operations > Examples for the PTC BOM Transformation Domain > Example: Retrieving Made from Part Information for a Collection of Parts
Example: Retrieving Made from Part Information for a Collection of Parts
You can retrieve the ‘Made from Part” or raw material part information for a single part or a collection of parts. Use the following POST URI with the request body and expand the PartMadeFrom navigation.
URI
POST /Windchill/servlet/odata/BomTransformation/GetRawMaterialsForParts?$expand=PartMadeFrom
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"parts": [
{
"ID": "OR:wt.part.WTPart:201999"
},
{
"ID": "OR:wt.part.WTPart:202045"
}
],
"navigationCriteriaId": "OR:wt.filter.NavigationCriteria:240686"
}
The request returns the raw material part objects in the response with the odata type RMPart (Raw Material Part). You can specify a value for Navigation Criteria ID to filter the parts.
You can expand further with the PartMadeFrom navigation to retrieve the child raw material parts, of the raw material parts as shown in the following URI:
URI
POST /Windchill/servlet/odata/BomTransformation/GetRawMaterialsForParts?$expand=PartMadeFrom($expand=PartMadeFrom)
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"parts": [
{
"ID": "OR:wt.part.WTPart:201999"
}
],
"navigationCriteriaId": "OR:wt.filter.NavigationCriteria:240686"
}
Retrieving the Raw Material Link Information for a Set of Parts
You can also retrieve the Raw Material Link information for a collection of parts using the MadeFromLink navigation. Use the following URI with a POST method and the request body.
You can additionally expand with the navigation MadeFrom to retrieve the “Made From” information which is the Raw Material Part information, that is linked to the root part via the Raw Material Link.
URI
POST /Windchill/servlet/odata/BomTransformation/GetRawMaterialsForParts?$expand=MadeFromLink($expand=MadeFrom)
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"parts": [
{
"ID": "OR:wt.part.WTPart:201999"
},
{
"ID": "OR:wt.part.WTPart:202045"
}
],
"navigationCriteriaId": "OR:wt.filter.NavigationCriteria:240686"
}
Retrieving Made from Part Information for a Collection of Part OIDs with Inline Navigation Criteria
You can retrieve the ‘Made from Part” or raw material part information for a single part or a collection of parts using the GetRawMaterialsForPartsWithInlineNavCriteria action. Use the following POST URI with the request body and expand the PartMadeFrom navigation. Include the navigation criteria within the request body.
URI
POST /Windchill/servlet/odata/BomTransformation/GetRawMaterialsForPartsWithInlineNavCriteria?$expand=PartMadeFrom
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"parts": [
{
"ID": "OR:wt.part.WTPart:201999"
},
{
"ID": "OR:wt.part.WTPart:202045"
}
],
"NavigationCriteria": {
"ApplicableType": "PTC.ProdMgmt.Part",
"ApplicationName": null,
"ApplyToTopLevelObject": false,
"Centricity": false,
"ConfigSpecs": [
{}
],
"Filters": [
{}
],
"HideUnresolvedDependents": false,
"SharedToAll": false,
"UseDefaultForUnresolved": false
}
}
The request returns the raw material part objects in the response with the odata type RMPart (Raw Material Part).
Retrieving Raw Material Link Information for a Collection of Part OIDs with Inline Navigation Criteria
You can also retrieve the Raw Material Link information for a collection of parts using the MadeFromLink navigation. Use the following URI with a POST method and the request body.
URI
POST /Windchill/servlet/odata/BomTransformation/GetRawMaterialsForPartsWithInlineNavCriteria?$expand=MadeFromLink($expand=MadeFrom)
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"parts": [
{
"ID": "OR:wt.part.WTPart:201999"
},
{
"ID": "OR:wt.part.WTPart:202045"
}
],
"NavigationCriteria": {
"ApplicableType": "PTC.ProdMgmt.Part",
"ApplicationName": null,
"ApplyToTopLevelObject": false,
"Centricity": false,
"ConfigSpecs": [
{}
],
"Filters": [
{}
],
"HideUnresolvedDependents": false,
"SharedToAll": false,
"UseDefaultForUnresolved": false
}
}