Retrieving the Part Structure Using Path Filters
You can retrieve the bill of materials for a part specified in the request URI using a single or multiple path filters.
You can retrieve the bill of materials using a path filter by specifying the RootIdentifier part, appropriate odata.type, InternalPath of the part usage or occurrence to which you want to apply the path filter, and other required attributes in the request body.
* 
InternalPath of a part indicates the path of the part usage or occurrence from its top-level part in a structure.
To retrieve the part structure using a path filter on an occurrence, the value of InternalPath of the occurrence is specified same as the value of its PVTreeId.
You can use the following API to get PVTreeId of an occurrence to which you want to apply the path filter:
POST /Windchill/servlet/odata/ProdMgmt/Parts('<TopLevelPartOID>')/PTC.ProdMgmt.GetPartStructure?$expand=Components($expand=Part($select=Identity;$expand=Representations($select=CreoViewURL)),Occurrence($select=ReferenceDesignator);$levels=max)
If an invalid InternalPath is specified, the path filter is not applied, and the entire part structure is returned.
You can also retrieve the bill of materials using a path filter along with the PathFilterWithSiblings attribute specified as true in the request body.
* 
The part specified as RootIdentifier must be the same as the top-level part specified in the request URI.
It is not required to expand on Occurrence or Uses while retrieving a part structure using the occurrence or usage path filters.
When you specify multiple path filters, you must use the same type of path filters.
When you specify multiple usage or occurrence paths, DisplayPath is a required attribute. You can specify any value, including an empty string (""), for this attribute.
Example: Retrieving the Part Structure by Using a Path Filter for a Usage
The following example demonstrates how to retrieve the part structure using a path filter for a usage. Use the following POST URI with the request body:
URI
POST /Windchill/servlet/odata/ProdMgmt/Parts('OR:wt.part.WTPart:190468')/PTC.ProdMgmt.GetPartStructure?$expand=Components($select=PartName,PathId;$expand=Part($select=Identity;$expand=Representations($select=CreoViewURL));$levels=max)
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"NavigationCriteria": {
"ApplicableType": "PTC.ProdMgmt.Part",
"Filters": [
{
"@odata.type": "#PTC.NavCriteria.UsagePathFilter",
"RootIdentifier": "wt.part.WTPart:190468",
"Paths": [
{
"InternalPath": "5a357da1-1fee-444b-acc7-98a868ca6eb9"
}
]
}
]
}
}
The request returns the structure for the specified usage.
Example: Retrieving the Part Structure by Using a Path Filter for a Usage Along with "PathFilterWithSiblings" Specified as "True"
The following example demonstrates how to retrieve the part structure using a path filter for a usage along with PathFilterWithSiblings specified as true in the request body. Use the following POST URI with the request body:
URI
POST /Windchill/servlet/odata/ProdMgmt/Parts('OR:wt.part.WTPart:190468')/PTC.ProdMgmt.GetPartStructure?$expand=Components($select=PartName,PathId;$expand=Part($select=Identity;$expand=Representations($select=CreoViewURL));$levels=max)
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"NavigationCriteria": {
"ApplicableType": "PTC.ProdMgmt.Part",
"Filters": [
{
"@odata.type": "#PTC.NavCriteria.UsagePathFilter",
"RootIdentifier": "wt.part.WTPart:190468",
"Paths": [
{
"InternalPath": "929932d8-3ffb-452f-b704-06c1551c8f15|7259c67a-2663-400d-9558-5e1bfb96dfea|e0186ddf-f77d-4032-9c05-4e62042a6b52"
}
]
}
]
},
"PathFilterWithSiblings": true
}
The request returns the structure for the specified usage path including the sibling parts of the usage. The request also returns the sibling parts of the usage’s parent. The request does not return the children of the siblings.
* 
In a tree structure, siblings are the parts that belong to the same parent part.
Example: Retrieving the Part Structure by Using a Path Filter for Multiple Usages Along with "PathFilterWithSiblings" Specified as "True"
The following example demonstrates how to retrieve the part structure using a path filter for two usages along with PathFilterWithSiblings specified as true in the request body. Use the following POST URI with the request body:
URI
POST /Windchill/servlet/odata/ProdMgmt/Parts('OR:wt.part.WTPart:196954')/PTC.ProdMgmt.GetPartStructure?$expand=Components($select=PartName,HasChildren,PathId,Resolved;$expand=Part($select=Identity;$expand=Representations($select=CreoViewURL));$levels=max)
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"NavigationCriteria": {
"ApplicableType": "PTC.ProdMgmt.Part",
"Filters": [
{
"@odata.type": "#PTC.NavCriteria.UsagePathFilter",
"RootIdentifier": "wt.part.WTPart:196954",
"Paths": [
{
"DisplayPath": "",
"InternalPath": "ebf2b8fb-b4bf-4689-9c71-f6ac28b17b1f"
},
{
"DisplayPath": "",
"InternalPath": "929932d8-3ffb-452f-b704-06c1551c8f15|7259c67a-2663-400d-9558-5e1bfb96dfea"
}
]
}
]
},
"PathFilterWithSiblings": true
}
Example: Retrieving the Part Structure by Using a Path Filter on an Occurrence
The following example demonstrates how to retrieve the part structure using a path filter on an occurrence. Use the following POST URI with the request body:
URI
POST /Windchill/servlet/odata/ProdMgmt/Parts('OR:wt.part.WTPart:190468')/PTC.ProdMgmt.GetPartStructure?$expand=Components($expand=Part($select=Identity;$expand=Representations($select=CreoViewURL)),Occurrence($select=ReferenceDesignator);$levels=max)
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"NavigationCriteria": {
"ApplicableType": "PTC.ProdMgmt.Part",
"Filters": [
{
"@odata.type": "#PTC.NavCriteria.OccurrencePathFilter",
"RootIdentifier": "wt.part.WTPart:190468",
"Paths": [
{
"InternalPath": "/1355"
}
]
}
]
}
}
The request returns the structure for the specified occurrence.
Example: Retrieving the Part Structure by Using a Path Filter on an Occurrence Along with "PathFilterWithSiblings" Specified as "True"
The following example demonstrates how to retrieve the part structure using a path filter on an occurrence along with PathFilterWithSiblings specified as true in the request body. Use the following POST URI with the request body:
URI
POST /Windchill/servlet/odata/ProdMgmt/Parts('OR:wt.part.WTPart:190468')/PTC.ProdMgmt.GetPartStructure?$expand=Components($select=PartName;$expand=Part($select=Identity;$expand=Representations($select=CreoViewURL)),Occurrence($select=ReferenceDesignator);$levels=max)
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"NavigationCriteria": {
"ApplicableType": "PTC.ProdMgmt.Part",
"Filters": [
{
"@odata.type": "#PTC.NavCriteria.OccurrencePathFilter",
"RootIdentifier": "wt.part.WTPart:190468",
"Paths": [
{
"InternalPath": "/1355"
}
]
}
]
},
"PathFilterWithSiblings": true
}
The request returns the structure for the specified occurrence path including the sibling parts of the occurrence. The request also returns the sibling parts of the occurrence’s parent. The request does not return the children of the siblings.
* 
In a tree structure, siblings are the parts that belong to the same parent part.
Example: Retrieving the Part Structure by Using a Path Filter on Multiple Occurrences Along with "PathFilterWithSiblings" Specified as "True"
The following example demonstrates how to retrieve the part structure using a path filter on two occurrences along with PathFilterWithSiblings specified as true in the request body. Use the following POST URI with the request body:
URI
POST /Windchill/servlet/odata/ProdMgmt/Parts('OR:wt.part.WTPart:196954')/PTC.ProdMgmt.GetPartStructure?$expand=Components($select=PartName;$expand=Part($select=Identity;$expand=Representations($select=CreoViewURL)),Occurrence($select=ReferenceDesignator);$levels=max)
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"NavigationCriteria": {
"ApplicableType": "PTC.ProdMgmt.Part",
"Filters": [
{
"@odata.type": "#PTC.NavCriteria.OccurrencePathFilter",
"RootIdentifier": "wt.part.WTPart:196954",
"Paths": [
{
"DisplayPath": "",
"InternalPath": "/1355"
},
{
"DisplayPath": "",
"InternalPath": "/1377"
}
]
}
]
},
"PathFilterWithSiblings": true
}