Upload file chunk

Description

This API allows a client to upload chunks of a file

URL Path

/transfer_file

Method

PATCH

When using a diode without GET support

URL Path

/transfer_file_chunk_diode

Method

POST

Permissions Restrictions

The API is limited to the user roles listed above (i.e. CO, Administrator, User), but assuming that a valid set of parameters is provided, including a group_id, only the transfer owner will be able alter the transfer.

Example:

The user test1 initiates a group transfer (i.e. calls /transfer successfully) and it receives a transfer group ID - group_id.

The user test2 tries to append a file to transfer with ID group_id. A 403 - Forbidden error will be returned stating that the user that has made the request is not authorized to alter the transfer.

The user test1 tries to append a file to the transfer - operation successful.

The user test1 completes the transfer by calling POST /transfer - operation successful.

Transfer with ID group_id will be accessible to the user until its expiration date.

HTTP header parameters

Authorization

The authentication token of the caller

REQUIRED

This header should have the following format: Bearer [

Example: Bearer Cp01BwnXAIOLZXxn7yogjKqIZnZpQD

group_id

Transfer group id

REQUIRED

A transfer group id obtained from the Initialize Group Transfer call.

file_id

File id

REQUIRED

A file id obtained from the Initialize File Transfer call.

chunk_offset

Chunk offset

REQUIRED/OPTIONAL*

The offset (location) of the chunk in the reassembled file.

chunk_checksum

The MD5 hash of the chunk data

OPTIONAL

Used to verify data integrity when chunk has been received. If no value is provided no checksum will be performed.

* chunk_offset is required when transfer_method is Chunk, otherwise optional.

Method: PATCH

HTTP body

Binary chunk data (max 100 MB per chunk)
Note: If Amazon S3 is used as temporary storage then chunk should be at least 5 MB except the last one

REQUIRED

Request Code

200

OK

Successful request

400

Bad Request

Invalid HTTP request

401

Invalid parameter

An invalid header parameter was specified.

403

Forbidden

Authentication credentials incorrect

413

Too large

Content chunk is too large (100MB/104857600B max)

500

Internal Server Error

Server is temporarily unavailable

Response

Example of successful scan request:

{
"result": "success"
}

Descriptions of response:

result

Result of upload