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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

17273118 - Is it possible to use REST API to output part's ”Iteration“

EvaPeng
14-Alexandrite

17273118 - Is it possible to use REST API to output part's ”Iteration“

In this example, customer wants to output ”Iteration“:1,

like the ”Revision“ 

 

EvaPeng_1-1710757219659.png

 

But seems attribute "Iteration" is not in Parts.json,  is it possible to output "Iteration"?

 

Thanks,

Eva

ACCEPTED SOLUTION

Accepted Solutions
HelesicPetr
22-Sapphire I
(To:EvaPeng)

Hi @EvaPeng 

Then you need to customize the RestAPI and add what you need if it can not be set OOTB. 

PetrH

View solution in original post

7 REPLIES 7
HelesicPetr
22-Sapphire I
(To:EvaPeng)

Hi @EvaPeng 

Yes you can substring the version attribute.

PetrH

EvaPeng
14-Alexandrite
(To:HelesicPetr)

Hi @HelesicPetr 

Thanks for your Reply~

 

Do you mean by modifying the Parts.js or Parts.json under Windchill\codebase\rest\ptc\domain\ProdMgmt\v6\entity?
Sorry I still don't know how to achieve it.
Could you please teach me more in details?

 

Thanks in advance,

Eva

HelesicPetr
22-Sapphire I
(To:EvaPeng)

Hi @EvaPeng 

I don't know where you call the rest api but you can just change the result in your application so you read the version output and you just grab the value after dot in your target application. . 

 

PetrH

EvaPeng
14-Alexandrite
(To:HelesicPetr)

Hi @HelesicPetr 

 

I understand what you mean.

There seems to be no application involved, in this case customer run below URI on postman or other tools, and want to get one row that only output "Iteration".
<host>/Windchill/servlet/odata/ProdMgmt/Parts('OR:wt.part.WTPart:7078102')

 

Regards,

Eva

HelesicPetr
22-Sapphire I
(To:EvaPeng)

Hi @EvaPeng 

Then you need to customize the RestAPI and add what you need if it can not be set OOTB. 

PetrH

EvaPeng
14-Alexandrite
(To:HelesicPetr)

Hi @HelesicPetr 


Sorry I'm asking this but could you please tell me specifically how to do customize the RestAPI to output "Iteration"?

 

Thanks,

Eva

HelesicPetr
22-Sapphire I
(To:EvaPeng)

Hi @EvaPeng 

You can try to add an attribute to the json definition

...\Windchill\codebase\rest\ptc\domain\ProdMgmt\v5\entity\Parts.json

Domain JSON File

 

restapi knowledge hub

https://www.ptc.com/en/support/article/CS254366

 

Here are the sources that can help you to customize the restapi

https://www.ptc.com/en/support/article/CS183488

 

PetrH

Announcements

Top Tags