Unlock Item using REST API


Consider the scenario

1. User A has locked the Document from Innovator GUI and edited Name property but did not Save, unlock and Close

2. Same user using REST API (through Postman, does not matter though) unlock the Item. Rest call as below 

PATCH: http://<hostname>/odata/Document('8B07D4B0D3AF4376BC031336E2E0E216')


    "@aras.action" : "unlock"


The response status is 200 ok. 

3. Try to unlock Item again by firing the same REST API: Status 500 Internal Server Error "ItemIsNotLockedException" which is considering #2 above. This indicates Item is not locked.

4. Go to Innovator UI and access Item ( In this case above Document ), UI shows up Document as "Locked". Refresh, logout have no impact. Status on UI is "Locked". Even I cannot Unlock, "Save Unlock and Close" from Innovator UI for this Item.

I would like to know 

1. What is the problem in this scenario and why there is the discrepancy in REST API and Innovator UI behavior

2. Why dont    "@aras.action" : "unlock" checks if the document is in edit stage and not to unlock in this case

3. How to fetch the lock status of an Item using REST API. Instead of using locked_by_id property of Document Item Type

Any help / suggestions are greatly appreciated

- Gautam