{"openapi":"3.0.3","info":{"description":"MS Office, Libre Office collaborative editing","title":"Online collaborative editing","version":"1.0.0"},"servers":[{"description":"Actual Server","url":"https://zer-qs-keep-8880.qs.hcllabs.net/api/wopi"},{"description":"Collaborative editing","url":"/wopi"}],"paths":{"/files/{file_id}":{"get":{"description":"The CheckFileInfo operation is one of the most important WOPI operations. CheckFileInfo must be implemented for all WOPI actions. This operation returns information about a file, a user’s permissions on that file, and general information about the capabilities that the WOPI host has on the file. Also, some CheckFileInfo properties can influence the appearance and behavior of WOPI clients.","operationId":"checkFileInfo","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckFileInfo"}}},"description":"OK"},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"404":{"$ref":"#/components/responses/404NotFound"},"500":{"$ref":"#/components/responses/500ServerError"}},"security":[{}],"summary":"Info about a shared file","tags":["wopi"],"x-MinimumAcl":"READER","x-keep-version":1},"parameters":[{"description":"Identifier as PK or scope|unid|fileName","examples":{"File ID":{"value":"demo%7C7DB65CAA14DBD71A00258C4D004636DE%7Csample.docx"}},"in":"path","name":"file_id","required":true,"schema":{"type":"string"}},{"description":"The value of the session context, if provided on the initial WOPI action URL.","in":"header","name":"X-WOPI-SessionContext","required":false,"schema":{"type":"string"}},{"description":"Volatile token for one user, one file resource","in":"query","name":"access_token","required":true,"schema":{"type":"string"}}],"post":{"description":"POST endpoint for a variety of WOPI operations.","operationId":"wopiOperation","parameters":[{"description":"Possible WOPI operations","in":"header","name":"X-WOPI-Override","schema":{"description":"WOPI Operations","enum":["DELETE","GET_LOCK","GET_SHARE_URL","LOCK","PUT","PUT_FILE","PUT_RELATIVE","PUT_USER_INFO","REFRESH_LOCK","RENAME_FILE","UNLOCK"],"type":"string"}}],"responses":{"200":{"description":"OK"},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"404":{"$ref":"#/components/responses/404NotFound"},"409":{"$ref":"#/components/responses/409Conflict"},"500":{"$ref":"#/components/responses/500ServerError"}},"security":[{}],"summary":"Perform a WOPI operation","tags":["wopi"],"x-MinimumAcl":"READER","x-keep-version":1}},"/files/{file_id}/contents":{"get":{"description":"The GetFile operation retrieves a file from a host.","operationId":"getFile","parameters":[{"description":"An integer specifying the upper bound of the expected size of the file being requested. Optional. The host should use the maximum value of a 4-byte integer if this value isn't set in the request. If the file requested is larger than this value, the host must respond with a[ 412 Precondition Failed](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.13).","in":"header","name":"X-WOPI-MaxExpectedSize","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/octet-stream":{}},"description":"OK"},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"404":{"$ref":"#/components/responses/404NotFound"},"412":{"$ref":"#/components/responses/412PreconditionFailed"},"500":{"$ref":"#/components/responses/500ServerError"}},"security":[{}],"summary":"Retrieves a file for web editors","tags":["wopi"],"x-MinimumAcl":"READER","x-keep-version":1},"parameters":[{"description":"Identifier as PK or scope|unid|fileName","examples":{"File ID":{"value":"demo%7C7DB65CAA14DBD71A00258C4D004636DE%7Csample.docx"}},"in":"path","name":"file_id","required":true,"schema":{"type":"string"}},{"description":"Volatile token for one user, one file resource","in":"query","name":"access_token","required":true,"schema":{"type":"string"}}],"post":{"description":"The PutFile operation updates a file’s binary contents.","operationId":"putFile","parameters":[{"description":"A comma-delimited string of UserId values representing all the users who contributed changes to the document in this PutFile request.","in":"header","name":"X-WOPI-Editors","required":false,"schema":{"type":"string"}},{"description":"A string provided by the WOPI client in a previous Lock request.","in":"header","name":"X-WOPI-Lock","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/octet-stream":{}},"description":"Binary content"},"responses":{"200":{"description":"OK","headers":{"X-WOPI-ItemVersion":{"$ref":"#/components/headers/X-WOPI-ItemVersion"},"X-WOPI-Lock":{"$ref":"#/components/headers/X-WOPI-Lock"},"X-WOPI-LockFailureReason":{"$ref":"#/components/headers/X-WOPI-LockFailureReason"}}},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"404":{"$ref":"#/components/responses/404NotFound"},"409":{"$ref":"#/components/responses/409Conflict"},"500":{"$ref":"#/components/responses/500ServerError"}},"security":[{}],"summary":"Posts a file from the web editors","tags":["wopi"],"x-MinimumAcl":"AUTHOR","x-keep-version":1}},"/filetoken":{"post":{"description":"Retrieves all necessary values to start a WOPI session.","operationId":"getFileToken","parameters":[{"description":"Scope name","examples":{"CustomApp":{"value":"demo"}},"in":"query","name":"dataSource","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"examples":{"Request file token for file":{"value":{"fileName":"sample.docx","unid":"7DB65CAA14DBD71A00258C4D004636DE"}}},"schema":{"$ref":"#/components/schemas/FileTokenRequest"}}},"required":true},"responses":{"200":{"$ref":"#/components/responses/FileTokenResponse"},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"404":{"$ref":"#/components/responses/404NotFound"},"500":{"$ref":"#/components/responses/500ServerError"}},"security":[{"jwt":[]}],"summary":"Get an access token for wopi operations","tags":["wopi"],"x-MinimumAcl":"READER","x-keep-version":1}}},"components":{"headers":{"X-WOPI-HostEndpoint":{"description":"A string that indicates the endpoint of the WOPI host handling the request. This is analogous to the X-WOPI-AppEndpoint request header and typically indicates geographic location, datacenter, and so on. This string mustn't be used for anything other than logging.","required":false,"schema":{"type":"string"}},"X-WOPI-ItemVersion":{"description":"An optional string value indicating the version of the file. Its value should be the same as Version value in CheckFileInfo.","required":false,"schema":{"type":"string"}},"X-WOPI-Lock":{"description":"A string value identifying the current lock on the file. You must always include this header when responding to the request with 409 Conflict. It shouldn't be included when responding to the request with 200 OK.","required":false,"schema":{"type":"string"}},"X-WOPI-LockFailureReason":{"description":"An optional string value indicating the cause of a lock failure. This header might be included when responding to the request with 409 Conflict. There's no standard for how this string is formatted, and it must only be used for logging purposes.","required":false,"schema":{"type":"string"}},"X-WOPI-MachineName":{"description":"A string indicating the name of the WOPI client machine making the request. This string mustn't be used for anything other than logging.","required":false,"schema":{"type":"string"}},"X-WOPI-OldLock":{"description":"A string provided by the WOPI client that is the existing lock on the file. Required. If X-WOPI-OldLock is not provided, the request is identical to a Lock request.","required":false,"schema":{"type":"string"}},"X-WOPI-PerfTrace":{"description":"This header is reserved for future use.","required":false,"schema":{"type":"string"}},"X-WOPI-ServerError":{"description":"A string indicating that an error occurred while processing the WOPI request. This header should be included in a WOPI response if the status code is [500 Internal Server Error](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1), but might be returned on any response with a non-200 status code. The value should contain details about the error. This string mustn't be used for anything other than logging.","required":false,"schema":{"type":"string"}},"X-WOPI-ServerVersion":{"description":"A string indicating the version of the WOPI host server handling the request. There's no standard for how this string is formatted, and it must not be used for anything other than logging.","required":false,"schema":{"type":"string"}}},"requestBodies":{"fileTokenRequestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileTokenRequest","description":"request a token and file_id for wopi"}}},"description":"An authenticated user requests an access token for an exisiting document","required":false}},"responses":{"400BadRequest":{"content":{"text":{"schema":{"type":"string"}}},"description":"Bad request parameters"},"401Unauthorized":{"content":{"text":{"schema":{"description":"Error message","type":"string"}}},"description":"Invalid Token"},"404NotFound":{"content":{"text":{"schema":{"description":"Not found","type":"string"}}},"description":"Resource don't exists (for that user)"},"409Conflict":{"content":{"text":{"schema":{"description":"You can't handle this","type":"string"}}},"description":"409 Conflict – Lock mismatch or locked by another interface. You must include an X-WOPI-Lock response header containing the value of the current lock on the file when using this response code."},"412PreconditionFailed":{"content":{"text":{"schema":{"description":"You can't handle this","type":"string"}}},"description":"412 Precondition Failed – File is larger than X-WOPI-MaxExpectedSize."},"413RequestEntityTooLarge":{"content":{"text":{"schema":{"description":"You can't handle this","type":"string"}}},"description":"413 Request Entity Too Large – File is too large. The maximum file size is host-specific."},"500ServerError":{"content":{"text":{"schema":{"description":"Sorry for that","type":"string"}}},"description":"Something went wrong","headers":{"X-WOPI-ServerError":{"$ref":"#/components/headers/X-WOPI-ServerError"}}},"CheckFileInfoResponse":{"content":{"application/json":{"examples":{"example1":{"value":{"BaseFileName":"Welcome to Nextcloud Hub.docx","DisableCopy":false,"DisableExport":false,"DisableInactiveMessages":false,"DisableInsertLocalImage":false,"DisablePresentation":false,"DisablePrint":false,"DownloadAsPostMessage":false,"EnableInsertRemoteFile":true,"EnableInsertRemoteImage":true,"EnableRemoteAIContent":false,"EnableRemoteLinkPicker":true,"EnableShare":true,"FileUrl":"","HideExportOption":false,"HidePrintOption":false,"HideRepairOption":false,"HideSaveOption":false,"HideUserList":"","IsOwner":true,"PostMessageOrigin":"http://192.168.0.173:8180/","SupportsRename":true,"UserCanNotWriteRelative":false,"UserCanRename":true,"UserCanWrite":true}}},"schema":{"$ref":"#/components/schemas/CheckFileInfo","description":"CheckFileInfo Response"}}},"description":"CheckFileInfo response"},"FileTokenResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileTokenResponse","description":"Token & fileId"}}},"description":"Provides a token and a file id"}},"schemas":{"CheckFileInfo":{"additionalProperties":false,"description":"A WOPI CheckFileInfo JSON response","example":{"BaseFileName":"sample.docx","IsAnonymousUser":false,"IsEduUser":false,"OwnerId":"CN=John Doe/O=ProjectKeep","Size":8520,"SupportsDeleteFile":false,"SupportsFolders":false,"SupportsGetLock":true,"SupportsLocks":true,"SupportsRename":false,"SupportsUpdate":true,"UserCanWrite":true,"UserFriendlyName":"John Doe","UserId":"CN=John Doe/O=ProjectKeep","Version":"1"},"properties":{"AccessTokenExpiry":{"type":"number"},"AllowAdditionalMicrosoftServices":{"type":"boolean"},"AllowEarlyFeatures":{"type":"boolean"},"AllowExternalMarketplace":{"type":"boolean"},"AppStateHistoryPostMessage":{"type":"boolean"},"BaseFileName":{"type":"string"},"BreadcrumbBrandName":{"type":"string"},"BreadcrumbBrandUrl":{"format":"uri","type":"string"},"BreadcrumbDocName":{"type":"string"},"BreadcrumbFolderName":{"type":"string"},"BreadcrumbFolderUrl":{"format":"uri","type":"string"},"ClosePostMessage":{"type":"boolean"},"CloseUrl":{"format":"uri","type":"string"},"ComplianceDomainPrefix":{"type":"string"},"CopyPasteRestrictions":{"enum":["BlockAll","CurrentDocumentOnly"],"type":"string"},"DisablePrint":{"type":"boolean"},"DisableTranslation":{"type":"boolean"},"DownloadUrl":{"type":"string"},"EditModePostMessage":{"type":"boolean"},"EditNotificationPostMessage":{"type":"boolean"},"FileExtension":{"type":"string"},"FileGeoLocationCode":{"type":"string"},"FileNameMaxLength":{"type":"integer"},"FileSharingPostMessage":{"type":"boolean"},"FileSharingUrl":{"format":"uri","type":"string"},"FileUrl":{"format":"uri","type":"string"},"FileVersionPostMessage":{"type":"boolean"},"FileVersionUrl":{"format":"uri","type":"string"},"HostEditUrl":{"format":"uri","type":"string"},"HostEmbeddedViewUrl":{"format":"uri","type":"string"},"HostViewUrl":{"format":"uri","type":"string"},"IsAnonymousUser":{"type":"boolean"},"IsEduUser":{"type":"boolean"},"LastModifiedTime":{"format":"date-time","type":"string"},"LicenseCheckForEditIsEnabled":{"type":"boolean"},"OfficeCollaborationServiceEndpointUrl":{"format":"uri","type":"string"},"OwnerId":{"type":"string"},"PostMessageOrigin":{"format":"uri","type":"string"},"ReadOnly":{"type":"boolean"},"RealTimeChannelEndpointUrl":{"format":"uri","type":"string"},"RestrictedWebViewOnly":{"type":"boolean"},"SHA256":{"type":"string"},"SequenceNumber":{"type":"number"},"ServerTime":{"type":"number"},"SharingStatus":{"enum":["Private","Shared"],"type":"string"},"SignInUrl":{"format":"uri","type":"string"},"SignoutUrl":{"format":"uri","type":"string"},"Size":{"type":"number"},"SupportedShareUrlTypes":{"items":{"enum":["ReadOnly","ReadWrite"],"type":"string"},"type":"array"},"SupportsAddActivities":{"type":"boolean"},"SupportsCoauth":{"type":"boolean"},"SupportsCobalt":{"type":"boolean"},"SupportsContainers":{"type":"boolean"},"SupportsDeleteFile":{"type":"boolean"},"SupportsEcosystem":{"type":"boolean"},"SupportsExtendedLockLength":{"type":"boolean"},"SupportsFolders":{"type":"boolean"},"SupportsGetActivities":{"type":"boolean"},"SupportsGetLock":{"type":"boolean"},"SupportsLocks":{"type":"boolean"},"SupportsRename":{"type":"boolean"},"SupportsUpdate":{"type":"boolean"},"SupportsUserAccess":{"type":"boolean"},"SupportsUserInfo":{"type":"boolean"},"UniqueContentId":{"type":"string"},"UserCanAttend":{"type":"boolean"},"UserCanNotWriteRelative":{"type":"boolean"},"UserCanPresent":{"type":"boolean"},"UserCanRename":{"type":"boolean"},"UserCanWrite":{"type":"boolean"},"UserFriendlyName":{"type":"string"},"UserId":{"type":"string"},"UserInfo":{"type":"string"},"Version":{"type":"string"},"WebEditingDisabled":{"type":"boolean"},"WorkflowPostMessage":{"type":"boolean"},"WorkflowType":{"items":{"enum":["Assign","Submit"],"type":"string"},"type":"array"},"WorkflowUrl":{"format":"uri","type":"string"}},"required":["BaseFileName","OwnerId","Size","UserFriendlyName","UserId","Version"],"title":"Full WOPI CheckFileInfo JSON Schema","type":"object"},"FileTokenRequest":{"description":"request access_token and file_id ","example":{"fileName":"sample.docx","unid":"7DB65CAA14DBD71A00258C4D004636DE"},"properties":{"fileName":{"description":"Full qualified file name with extensions","type":"string"},"unid":{"description":"Document UNID containing the attachment","type":"string"}},"required":["fileName","unid"],"type":"object"},"FileTokenResponse":{"description":"File id and access token for wopi operations","example":{"access_token":"0d0c557334ffaed9ce4085897aa0f4b269255dcd5e310faeca54b8cc0f4b063308fd78a986cdcee2eec09a8bc2b61d95de6184a25e004160ca190a5e0acacb4505d889dae3824ccea04450b1c5c0cbcd7dd2cbd4798bb631506896c36a7d9ef9712c124b","access_token_ttl":1742210574000,"dataSource":"demo","fileName":"sample.docx","file_id":"demo%7C7DB65CAA14DBD71A00258C4D004636DE%7Csample.docx","unid":"7DB65CAA14DBD71A00258C4D004636DE"},"properties":{"access_token":{"description":"Access token for wopi operations","type":"string"},"access_token_ttl":{"description":"Tells a WOPI client when an access token expires, represented as the number of milliseconds since January 1, 1970 UTC (the date epoch in JavaScript)","type":"integer"},"dataSource":{"description":"Scope representing the database","type":"string"},"fileName":{"description":"Full qualified file name with extensions","type":"string"},"file_id":{"description":"The wopi file id","type":"string"},"unid":{"description":"Document UNID containing the attachment","type":"string"}},"required":["access_token","access_token_ttl","dataSource","fileName","file_id","unid"],"type":"object"}},"securitySchemes":{"jwt":{"bearerFormat":"JWT","description":"JWT for endpoints","scheme":"bearer","type":"http"}}},"security":[{"jwt":[]},{}],"tags":[{"description":"Collaborative Editor","name":"wopi"}]}