GetFileΒΆ
- Required for
Online iOS Android
-
GET/wopi/files/(file_id)/contentsΒΆ The GetFile operation retrieves a file from a host.
Office for the web Tip
By default, Office for the web will use the GetFile WOPI request to retrieve files from the host. However, hosts can override this behavior by providing a direct URL to the file using the FileUrl property in the CheckFileInfo response.
- 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 will use to determine whether the request is authorized.
- Request Headers
X-WOPI-MaxExpectedSize β 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 is not set in the request. If the file requested is larger than this value, the host must respond with a 412 Precondition Failed.
- Response Headers
X-WOPI-ItemVersion β An optional string value indicating the version of the file. Its value should be the same as Version value in CheckFileInfo.
- Response Body
The response body must be the full binary contents of the file.
- Status Codes
200 OK β Success
401 Unauthorized β Invalid access token
404 Not Found β Resource not found/user unauthorized
412 Precondition Failed β File is larger than X-WOPI-MaxExpectedSize
500 Internal Server Error β Server error
See also
- Standard WOPI request and response headers
In addition to the request/response headers listed here, this operation may also use the Standard WOPI request and response headers.