Hi,
I was trying to test the following query described in this documentation - https://developers.arcgis.com/rest/services-reference/enterprise/lr-acquire-locks/.
/MapServer/exts/LRServer/locks/acquire
The problems I've faces is:
First of all it seems that this query is a POST query rather than GET as pointed in the header of the link.
Second, acquireLocks parameter is pointed as "Optional", which in fact is wrong and when I remove it it returns following response:
{"error":{"code":400,"message":"'acquireLocks' parameter not specified.","details":[]}}
When I pass it as follows:
[{"routeId": "{myRouteUniqueID}", "layerId": 1}]
I get following response:
{"error":{"code":400,"message":"'lineId' parameter not specified.","details":[]}}
When I pass following acquireLocks parameter:
[{"routeId": "{myRouteUniqueID}", "layerId": 1}, {"lineId": "{myCenterlineUniqueId}", "layerId": 2}]
I STILL get following response:
{"error":{"code":400,"message":"'lineId' parameter not specified.","details":[]}}
My ultimate goal is to load calibration points through applyEdits query (https://developers.arcgis.com/rest/services-reference/enterprise/apply-edits/)
To do this I should get exclusive locks on the routes I want to add calibration points to. My questions are - what should I pass as "routeId","lineId" and "layerId" and how should I do this? in the documentation it is pointed that JSON should be like this:
[ { "routeId": "<routeId>", "layerId": <layerId> } | { "lineId": "<lineId>", "layerId": <layerId> }, ... ]
Which is nonsense as "|" doesn'rt work in JSON. And returns error.
So, I put my routeId as routeId, my CenterlineID as lineID and layerId my centerlines and routes published layers Ids.
Can anyone show the working example of JSON I should pass as acquireLocks parameter in /MapServer/exts/LRServer/locks/acquire query which create locks on multiple routes to allow to further load calibration points for these routes?
Thank you in advance!
Solved! Go to Solution.
Here are some samples from my sandbox environment intended to demonstrate the REST API calls. User specific LRS model, LRS attributes need to be factored in and modify parameters to make it work.
First attempt executed but no locks acquire as reconcile was needed.
Reconciled versions and acquired locks
@Sergio have you tried the format below (one of the samples in the Acquire Locks documentation):
https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/locks/acquire?f=json&editVer...[{"routeId":"I90","layerId":3},{"lineId":"NWS Line A","layerId":4}]
Hi @AyanPalit , Yes I did. The problem is that it is unclear what is the routeId and lineId in terms of APR and LRS? routeID is the OBJECTID (seems like that according to your example)?
Whatever I put into lineId parameter, I get:
{"error":{"code":400,"message":"'lineId' parameter not specified.","details":[]}}
Couple more additions to what I've discovered. The final goal is to create calibration points using applyEdits query (that's why I'm trying to acquire locks), so when it comes to this query it returns following response:
Here are some samples from my sandbox environment intended to demonstrate the REST API calls. User specific LRS model, LRS attributes need to be factored in and modify parameters to make it work.
First attempt executed but no locks acquire as reconcile was needed.
Reconciled versions and acquired locks