The GetLock operation retrieves a lock on a file. Note that this operation does not create a new lock. Rather, this operation always returns the current lock value in the X-WOPI-Lock response header. Because of this, its semantics differ slightly from the other lock-related operations.
If the file is currently not locked, the host must return a 200 OK and include an X-WOPI-Lock response header set to the empty string.
If the file is currently locked, the host should return a 200 OK and include an X-WOPI-Lock response header containing the value of the current lock on the file. If the current lock ID is not representable as a WOPI lock (for example, it is longer than the maximum lock length), the host should return a 409 Conflict and set the X-WOPI-Lock response header to the empty string or omit it completely.
See Lock for more general information regarding locks.
file_id (string) – A string that specifies a file ID of a file managed by host. This string must be URL safe.
- Query Parameters
access_token (string) – An access token that the host will use to determine whether the request is authorized.
- Request Headers
X-WOPI-Override – The string
- Response Headers
X-WOPI-LockFailureReason – An optional string value indicating the cause of a lock failure. This header may be included when responding to the request with 409 Conflict. There is no standard for how this string is formatted, and it must only be used for logging purposes.
Deprecated since version 2015-12-15: This header is deprecated and should be ignored by WOPI clients.
- Status Codes
200 OK – Success; an X-WOPI-Lock response header containing the value of the current lock on the file must always be included when using this response code
404 Not Found – Resource not found/user unauthorized
409 Conflict – Lock mismatch/locked by another interface; an X-WOPI-Lock response header containing the value of the current lock on the file must always be included when using this response code
500 Internal Server Error – Server error
501 Not Implemented – Operation not supported