Skip to main content
12-Amethyst
June 14, 2019
Solved

REST call on WTPart Checkout results in Error

  • June 14, 2019
  • 1 reply
  • 5105 views

Hello,

I did some REST 1.5 API tests in Postman and things do look good.

However, I found some problems which I cannot explain. For example, I am unable to do Checkout/Checkin on WTpart.

I created new WTPart and tried to do Checkout via REST call, someting like that:

http://tomazj-wnc11.audax2.local/Windchill/servlet/odata/ProdMgmt/Parts('OR:wt.part.WTPart:1462146')/PTC.CheckOut

Exactly like in Windchill REST Services Userโ€™s Guide v1.5, page 167.

I used POST call, I got current CSRF_NONCE.

Return JSON is :

{
"error": {
"code": null,
"message": "The type of the type cast 'PTC.CheckOut' is not defined."
}
}

MS log error is:

2019-06-14 10:58:43,931 ERROR [ajp-nio-127.0.0.1-8010-exec-2] com.ptc.odata.windchill.servlet.WcRestServlet wcadmin - An unexpected REST error occured
Type 'PTC.CheckOut' not found.

 

It looks like there is something wrong with my REST implementation in Windchill. I got v1.5 via 11.0 M030 CPS 15 install.

I authenticate in Windchill as wcadmin.

Any ideas?

Regards.

2019-06-14 13_39_30-Postman.png2019-06-14 13_40_06-Part - WTPART-00099391, TestRestWTPart_001, 1.1 - Internet Explorer.png2019-06-14 13_40_21-10.0.0.170 - Remote Desktop Connection.png

 

Best answer by amarsingh

@TomazJeras this is a documentation error, this should be addressed in the next document release. The correct API to use is

http://tomazj-wnc11.audax2.local/Windchill/servlet/odata/ProdMgmt/Parts('OR:wt.part.WTPart:1462146')/PTC.ProdMgmt.CheckOut

1 reply

amarsingh12-AmethystAnswer
12-Amethyst
June 17, 2019

@TomazJeras this is a documentation error, this should be addressed in the next document release. The correct API to use is

http://tomazj-wnc11.audax2.local/Windchill/servlet/odata/ProdMgmt/Parts('OR:wt.part.WTPart:1462146')/PTC.ProdMgmt.CheckOut
12-Amethyst
June 17, 2019

Thanks.

 

Regards,

Tomaz