Media API › Files
GET /files
Returns a collection of files. Unused files will be deleted after a few days.
Resource URL
https://api.toornament.com/organizer/v2/filesHTTP headers
- X-Api-Keystring
API key of your application (see Authentication)
- Authorizationstring
Access token with
organizer:filescope (see Authorization) - Rangestring
A range of requested items using the
filesunit. The size of the range can not exceed 50. (see Pagination)Example: files=0-49
Query Parameters
- file_idsarray
Only return files for the given list of ids.
Example: 437854281666691129,529400138800557511
- contextsarray
One or several contexts of files to filter on.
Example: circuit_logo,tournament_logo
- associatedinteger
Whether the file is used by an entity.
Possible values: 0, 1
Request Body
This endpoint does not require a request body.
Response
[206] Files retrieved.
Example
[
{
"id": "437854281666691129",
"context": "match_report_proof",
"associated": true,
"status": "available"
}
]Structure (collection)
- idstring
The id of the file.
Example: "437854281666691129"
- contextstring
The context of the file.
Example: "match_report_proof"
- associatedboolean
Whether the file is used.
Example: true
- statusstring
The file processing status.
Possible values: pending, processing, available, failed
POST /files
Creates a new file.
Resource URL
https://api.toornament.com/organizer/v2/filesHTTP headers
- X-Api-Keystring
API key of your application (see Authentication)
- Authorizationstring
Access token with
organizer:filescope (see Authorization) - Content-Typestring
The media type of the uploaded file.
Example: image/png
- Content-Dispositionstring
The name of the uploaded file. The first parameter is ignored.
Example: inline; filename="test.png"
Query Parameters
- contextstring
The media context of the uploaded file (see File upload)
Possible values: circuit_logo, circuit_background, circuit_sponsor, tournament_logo, tournament_background, tournament_sponsor, match_report_proof, participant_logo, player_logo
Request Body
Binary data of file.
Example
...(binary bytes)...
Response
[201] File created.
Example
{
"id": "437854281666691129",
"context": "match_report_proof",
"associated": true,
"status": "available"
}Structure (object)
- idstring
The id of the file.
Example: "437854281666691129"
- contextstring
The context of the file.
Example: "match_report_proof"
- associatedboolean
Whether the file is used.
Example: true
- statusstring
The file processing status.
Possible values: pending, processing, available, failed
GET /files/{id}
Returns the binary content of an original file.
Resource URL
https://api.toornament.com/organizer/v2/files/{id}HTTP headers
- X-Api-Keystring
API key of your application (see Authentication)
- Authorizationstring
Access token with
organizer:filescope (see Authorization)
Path parameters
- idstring
The id of the file.
Query Parameters
This endpoint does not have any query parameters.
Request Body
This endpoint does not require a request body.
Response
[200] Binary content of file retrieved.
Example
...(binary bytes)...
GET /files/{id}/{format}
Returns a binary content of file with a specific format.
Resource URL
https://api.toornament.com/organizer/v2/files/{id}/{format}HTTP headers
- X-Api-Keystring
API key of your application (see Authentication)
- Authorizationstring
Access token with
organizer:filescope (see Authorization)
Path parameters
- idstring
The id of the file.
- formatstring
The name of the format of the file.
Query Parameters
This endpoint does not have any query parameters.
Request Body
This endpoint does not require a request body.
Response
[200] Binary content of file retrieved.
Example
...(binary bytes)...