Files

Preflight check before upload

Changed on

Performs a check to verify that a file will be accepted by Box before you upload the entire file.

options/files/content

Request

  • Base URL
    https://api.box.com/2.0
  • URL
    https://api.box.com/2.0/files/content
  • Auth
    OAuth 2
    Authorization code: https://account.box.com/api/oauth2/authorize
    Token URL: https://api.box.com/oauth2/token

Request body

namestring

The name for the file.

sizeinteger

The size of the file in bytes.

Example request

{
  "name": "File.mp4",
  "size": 1024,
  "parent": {
    "id": "123"
  }
}

Response

If the check passed, the response will include a session URL that can be used to upload the file to.

upload_urlstring

A URL for an upload session that can be used to upload the file.

upload_tokenstring

An optional access token to use to upload the file.

Example response

{
  "upload_url": "https://upload-las.app.box.com/api/2.0/files/content?upload_session_id=1234",
  "upload_token": "Pc3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQP"
}

Changes

    • warning

      added the new unprocessable_entity enum value to the / response property for the response status

    • warning

      added the new unprocessable_entity enum value to the response property for the response status