This is a manager for chunked uploads (allowed for files at least 20MB).
Creates an upload session for a new file.
This operation is performed by calling function createFileUploadSession.
See the endpoint docs at API Reference.
await client.chunkedUploads.createFileUploadSession({
fileName: fileName,
fileSize: fileSize,
folderId: parentFolderId,
} satisfies CreateFileUploadSessionRequestBody);
CreateFileUploadSessionRequestBody
CreateFileUploadSessionOptionalsInputThis function returns a value of type UploadSession.
Returns a new upload session.
Creates an upload session for an existing file.
This operation is performed by calling function createFileUploadSessionForExistingFile.
See the endpoint docs at API Reference.
Currently we don’t have an example for calling createFileUploadSessionForExistingFile in integration tests
string
https://*.app.box.com/files/123 the file_id is 123. Example: “12345”CreateFileUploadSessionForExistingFileRequestBody
CreateFileUploadSessionForExistingFileOptionalsInputThis function returns a value of type UploadSession.
Returns a new upload session.
Return information about an upload session.
The actual endpoint URL is returned by the Create upload session endpoint.
This operation is performed by calling function getFileUploadSessionByUrl.
See the endpoint docs at API Reference.
await client.chunkedUploads.getFileUploadSessionByUrl(statusUrl);
string
GetFileUploadSessionByUrlOptionalsInputThis function returns a value of type UploadSession.
Returns an upload session object.
Return information about an upload session.
The actual endpoint URL is returned by the Create upload session endpoint.
This operation is performed by calling function getFileUploadSessionById.
See the endpoint docs at API Reference.
await client.chunkedUploads.getFileUploadSessionById(uploadSessionId);
string
GetFileUploadSessionByIdOptionalsInputThis function returns a value of type UploadSession.
Returns an upload session object.
Uploads a chunk of a file for an upload session.
The actual endpoint URL is returned by the Create upload session
and Get upload session endpoints.
This operation is performed by calling function uploadFilePartByUrl.
See the endpoint docs at API Reference.
await client.chunkedUploads.uploadFilePartByUrl(
acc.uploadPartUrl,
generateByteStreamFromBuffer(chunkBuffer),
{
digest: digest,
contentRange: contentRange,
} satisfies UploadFilePartByUrlHeadersInput,
);
string
ByteStream
UploadFilePartByUrlHeadersInput
UploadFilePartByUrlOptionalsInputThis function returns a value of type UploadedPart.
Chunk has been uploaded successfully.
Uploads a chunk of a file for an upload session.
The actual endpoint URL is returned by the Create upload session
and Get upload session endpoints.
This operation is performed by calling function uploadFilePart.
See the endpoint docs at API Reference.
await client.chunkedUploads.uploadFilePart(
acc.uploadSessionId,
generateByteStreamFromBuffer(chunkBuffer),
{
digest: digest,
contentRange: contentRange,
} satisfies UploadFilePartHeadersInput,
);
string
ByteStream
UploadFilePartHeadersInput
UploadFilePartOptionalsInputThis function returns a value of type UploadedPart.
Chunk has been uploaded successfully.
Abort an upload session and discard all data uploaded.
This cannot be reversed.
The actual endpoint URL is returned by the Create upload session
and Get upload session endpoints.
This operation is performed by calling function deleteFileUploadSessionByUrl.
See the endpoint docs at API Reference.
await client.chunkedUploads.deleteFileUploadSessionByUrl(abortUrl);
string
DeleteFileUploadSessionByUrlOptionalsInputThis function returns a value of type undefined.
A blank response is returned if the session was successfully aborted.
Abort an upload session and discard all data uploaded.
This cannot be reversed.
The actual endpoint URL is returned by the Create upload session
and Get upload session endpoints.
This operation is performed by calling function deleteFileUploadSessionById.
See the endpoint docs at API Reference.
await client.chunkedUploads.deleteFileUploadSessionById(uploadSessionId);
string
DeleteFileUploadSessionByIdOptionalsInputThis function returns a value of type undefined.
A blank response is returned if the session was successfully aborted.
Return a list of the chunks uploaded to the upload session so far.
The actual endpoint URL is returned by the Create upload session
and Get upload session endpoints.
This operation is performed by calling function getFileUploadSessionPartsByUrl.
See the endpoint docs at API Reference.
await client.chunkedUploads.getFileUploadSessionPartsByUrl(listPartsUrl);
string
GetFileUploadSessionPartsByUrlOptionalsInputThis function returns a value of type UploadParts.
Returns a list of parts that have been uploaded.
Return a list of the chunks uploaded to the upload session so far.
The actual endpoint URL is returned by the Create upload session
and Get upload session endpoints.
This operation is performed by calling function getFileUploadSessionParts.
See the endpoint docs at API Reference.
await client.chunkedUploads.getFileUploadSessionParts(uploadSessionId);
string
GetFileUploadSessionPartsOptionalsInputThis function returns a value of type UploadParts.
Returns a list of parts that have been uploaded.
Close an upload session and create a file from the uploaded chunks.
The actual endpoint URL is returned by the Create upload session
and Get upload session endpoints.
This operation is performed by calling function createFileUploadSessionCommitByUrl.
See the endpoint docs at API Reference.
await client.chunkedUploads.createFileUploadSessionCommitByUrl(
commitUrl,
{ parts: parts } satisfies CreateFileUploadSessionCommitByUrlRequestBody,
{ digest: digest } satisfies CreateFileUploadSessionCommitByUrlHeadersInput,
);
string
CreateFileUploadSessionCommitByUrlRequestBody
CreateFileUploadSessionCommitByUrlHeadersInput
CreateFileUploadSessionCommitByUrlOptionalsInputThis function returns a value of type undefined | Files.
Returns the file object in a list.Returns when all chunks have been uploaded but not yet processed.
Inspect the upload session to get more information about the progress of processing the chunks, then retry committing the file when all chunks have processed.
Close an upload session and create a file from the uploaded chunks.
The actual endpoint URL is returned by the Create upload session
and Get upload session endpoints.
This operation is performed by calling function createFileUploadSessionCommit.
See the endpoint docs at API Reference.
await client.chunkedUploads.createFileUploadSessionCommit(
uploadSessionId,
{ parts: parts } satisfies CreateFileUploadSessionCommitRequestBody,
{ digest: digest } satisfies CreateFileUploadSessionCommitHeadersInput,
);
string
CreateFileUploadSessionCommitRequestBody
CreateFileUploadSessionCommitHeadersInput
CreateFileUploadSessionCommitOptionalsInputThis function returns a value of type undefined | Files.
Returns the file object in a list.Returns when all chunks have been uploaded but not yet processed.
Inspect the upload session to get more information about the progress of processing the chunks, then retry committing the file when all chunks have processed.
Starts the process of chunk uploading a big file. Should return a File object representing uploaded file.
This operation is performed by calling function uploadBigFile.
await client.chunkedUploads.uploadBigFile(
fileByteStream,
fileName,
fileSize,
parentFolderId,
);
ByteStream
string
number
string
undefined | CancellationToken
This function returns a value of type FileFull.