As a client application of this API will likely make many requests in succession to synchronize its state with the app, a simple per-user locking mechanism was implemented to let clients know when a different client is currently making changes.
/public/rest/v2/lock
- synopsis
Acquire a lock for the authenticated user. This lock will be automatically released after a timeout of 30min. If the client requesting the lock needs longer than 30min it has to repeat the request.
10.0.0
- >json string status
success
orerror
Example:
http
POST /index.php/apps/bookmarks/public/rest/v2/lock HTTP/1.1 Host: example.com Accept: application/json
Response:
http
HTTP/1.1 200 OK Content-Type: application/json
- {
"status": "success",
}
Example:
http
POST /index.php/apps/bookmarks/public/rest/v2/lock HTTP/1.1 Host: example.com Accept: application/json
Response:
http
HTTP/1.1 423 Locked Content-Type: application/json
- {
"status": "error", "data": "Resource is already locked"
}
/public/rest/v2/lock
- synopsis
Release the lock for the authenticated user
10.0.0
- >json string status
success
orerror
Example:
http
DELETE /index.php/apps/bookmarks/public/rest/v2/lock HTTP/1.1 Host: example.com Accept: application/json
Response:
http
HTTP/1.1 200 OK Content-Type: application/json
- {
"status": "success",
}