DeleteFile
Optional for:
The DeleteFile
operation deletes a file from a host.
Note
This WOPI operation isn't required to integrate with Office for the web or Microsoft 365 for mobile at this time.
POST /wopi/files/(file_id)
The DeleteFile
operation deletes a file from a host.
If the file is currently locked, the host should return a 409 Conflict 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's 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.
Parameters
- 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 uses to determine whether the request is authorized.
Request headers
- X-WOPI-Override – The string
DELETE
. Required.
Status codes
200 OK – Success.
401 Unauthorized – Invalid access token.
404 Not Found – Resource not found or user unauthorized.
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.
500 Internal Server Error – Server error.
501 Not Implemented – Operation not supported.
In addition to the request and response headers listed here, this operation might also use the Standard WOPI request and response headers. For more information see Standard WOPI request and response headers.