WOPI REST API

WOPI REST API specifies a set of operations that enables a client to access and change files stored on a server.

ONLYOFFICE Docs uses the following WOPI operations:

  • CheckFileInfo - returns information about the file properties, access rights and editor settings.
  • GetFile - requests a message to retrieve a file for the HTTP://server/<…>/wopi*/files/<id>/contents operation.
  • Lock - locks file editing by an online office that requested the lock.
  • RefreshLock - refreshes the lock on a file by resetting its automatic expiration timer to 30 minutes.
  • Unlock - allows for file editing.
  • PutFile - requests a message to update a file for the HTTP://server/<…>/wopi*/files/<id>/contents operation.
  • PutRelativeFile - creates a new file on the host based on the current file.
  • RenameFile - renames a file.

Possible error codes and their description

Error codeDescription
200 OKSuccess
400 Bad RequestX-WOPI-Lock was not provided or was empty / Specified name is illegal
401 UnauthorizedInvalid access token
404 Not FoundResource not found/user unauthorized
409 ConflictLock mismatch/locked by another interface; the X-WOPI-Lock response header containing the value of the current lock on the file must always be included when using this response code
412 Precondition FailedFile is larger than X-WOPI-MaxExpectedSize
413 Request Entity Too LargeFile is too large; the maximum file size is host-specific
500 Internal Server ErrorServer error
501 Not ImplementedOperation not supported