Onedata API Reference

REST API references for Onezone, Oneprovider, and Onepanel.

Download file content

GET /data/{id}/content

Returns the content of file specified by $FILE_ID. Partial file content download is also supported using Range header.

Example cURL requests for file with abcdefghijklmno content

Download entire file content

curl -H "X-Auth-Token: $TOKEN" \
-X GET "https://$HOST/api/v3/oneprovider/data/$FILE_ID/content"

abcdefghijklmno

Download only part of the file content

curl -H "X-Auth-Token: $TOKEN" -X GET "https://$HOST/api/v3/oneprovider/data/$FILE_ID/content" \
-H "Range: bytes=5-8"

fghi

Path parameters

Parameter Type & Description
id required
string

Id of the file.

Request Examples

Shell
oneprovider-rest-cli downloadFileContent id=$FILE_ID

Responses

application/json
200

Entire file content.

No schema provided.

206

Part(s) of file content.

No schema provided.

400

Invalid request.

Property
Type & Description
error
string

Identifier representing internal error code.

error_description
string

Detailed error message.

Example

application/json
{
  "error": "invalid_token",
  "error_description": "Provided token could not be validated."
}
403

Forbidden request.

Property
Type & Description
error
string

Identifier representing internal error code.

error_description
string

Detailed error message.

Example

application/json
{
  "error": "invalid_token",
  "error_description": "Provided token could not be validated."
}
404

File not found.

Property
Type & Description
error
string

Identifier representing internal error code.

error_description
string

Detailed error message.

Example

application/json
{
  "error": "invalid_token",
  "error_description": "Provided token could not be validated."
}
500

Internal server error.

Property
Type & Description
error
string

Identifier representing internal error code.

error_description
string

Detailed error message.

Example

application/json
{
  "error": "invalid_token",
  "error_description": "Provided token could not be validated."
}