Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
Hi,
Is there a REST API or Swagger where I can input the Part number and know if it has a part structure?
Use Case: If a part has a part structure, display the part structure in Thingworx Dashboard, or else display just the part info.
For this use case, I need to know if there is an API, I can ping and understand if the Part has structure or not.
Thanks,
Solved! Go to Solution.
Hello,
I found the simplest way to know if a part has the structure or not; below is the implementation:
In the JSON, if HasChildren is true, there is structure to the Part. If not, there is no structure to it.
If you need the whole structure to the Part, then add the below to the expand:
$expand: "Components($expand=Part,PartUse;$levels=1)",
Thanks,
If you have Thingworx Navigate Configured, you can use the 'getPartStructureByID' service ( service will be available in Windchill ODataConnector ) to fetch part structure windchill using Part ID ( not part Name )
If the 'Components' array is empty you can consider your part doesn't have any structure
If your part has structure result will look something like this
In WRS, you can use the below endpoint to fetch the part structure
/VR
Hello,
I found the simplest way to know if a part has the structure or not; below is the implementation:
In the JSON, if HasChildren is true, there is structure to the Part. If not, there is no structure to it.
If you need the whole structure to the Part, then add the below to the expand:
$expand: "Components($expand=Part,PartUse;$levels=1)",
Thanks,