GetFile

Required for: Online iOS Android
GET /wopi/files/(file_id)/contents

The GetFile operation retrieves a file from a host.

Office Online Tip

By default, Office Online 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:

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.