Sample - Box Platform API
PUT/files/upload_sessions/{upload_session_id}

Upload a file part

Uploads one binary part of a file to an existing upload session. Send the part contents with the required digest and content-range headers, using the exact part size defined by the session except for the final part. Upload parts without overlapping previously uploaded ranges, then commit the completed session.

3 parameters
upload_session_idstringrequired
The unique identifier of the upload session.
digeststringrequired
The RFC 3230 message digest for the uploaded chunk, using a base64-encoded SHA-1 value in the format `sha=BASE64_ENCODED_DIGEST`.
content-rangestringrequired
The byte range of the chunk. The lower bound must align to the session part size, the range must not overlap an uploaded part, and only the final part may be smaller than the session part size.

5 status codes
200Returns the uploaded part representation for the chunk stored in the upload session.
partobjectoptional
The representation of an upload session chunk.
409Returned when the chunk conflicts with another chunk previously uploaded to the session.
typestringoptional
The value will always be `error`.
Allowed:error
statusintegeroptional
The HTTP status of the response.
codestringoptional
A Box-specific error code.
Allowed:createdacceptedno_contentredirectnot_modifiedbad_requestunauthorizedforbiddennot_foundmethod_not_allowedconflictprecondition_failed
messagestringoptional
A short message describing the error.
context_infoobjectoptional
A free-form object that contains additional context about the error. The possible fields are defined on a per-endpoint basis. `message` is only one example.
help_urlstringoptional
A URL that links to more information about why this error occurred.
request_idstringoptional
A unique identifier for this response, which can be used when contacting Box support.
412Returned when a required precondition for uploading the part was not met.
typestringoptional
The value will always be `error`.
Allowed:error
statusintegeroptional
The HTTP status of the response.
codestringoptional
A Box-specific error code.
Allowed:createdacceptedno_contentredirectnot_modifiedbad_requestunauthorizedforbiddennot_foundmethod_not_allowedconflictprecondition_failed
messagestringoptional
A short message describing the error.
context_infoobjectoptional
A free-form object that contains additional context about the error. The possible fields are defined on a per-endpoint basis. `message` is only one example.
help_urlstringoptional
A URL that links to more information about why this error occurred.
request_idstringoptional
A unique identifier for this response, which can be used when contacting Box support.
416Returned when `content-range` does not match the range specified for the upload session.
typestringoptional
The value will always be `error`.
Allowed:error
statusintegeroptional
The HTTP status of the response.
codestringoptional
A Box-specific error code.
Allowed:createdacceptedno_contentredirectnot_modifiedbad_requestunauthorizedforbiddennot_foundmethod_not_allowedconflictprecondition_failed
messagestringoptional
A short message describing the error.
context_infoobjectoptional
A free-form object that contains additional context about the error. The possible fields are defined on a per-endpoint basis. `message` is only one example.
help_urlstringoptional
A URL that links to more information about why this error occurred.
request_idstringoptional
A unique identifier for this response, which can be used when contacting Box support.
defaultReturns a generic error object for an unexpected client error.
typestringoptional
The value will always be `error`.
Allowed:error
statusintegeroptional
The HTTP status of the response.
codestringoptional
A Box-specific error code.
Allowed:createdacceptedno_contentredirectnot_modifiedbad_requestunauthorizedforbiddennot_foundmethod_not_allowedconflictprecondition_failed
messagestringoptional
A short message describing the error.
context_infoobjectoptional
A free-form object that contains additional context about the error. The possible fields are defined on a per-endpoint basis. `message` is only one example.
help_urlstringoptional
A URL that links to more information about why this error occurred.
request_idstringoptional
A unique identifier for this response, which can be used when contacting Box support.

Error handling

A 409 is returned when the uploaded chunk conflicts with a chunk already stored in the session. A 412 is returned when a required precondition is not met, and a 416 is returned when content-range does not match the session's expected range. Use a base64-encoded SHA-1 value in digest and a non-overlapping range aligned to the session part size.