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/files

HTTP headers

  • X-Api-Key
    string

    API key of your application (see Authentication)

  • Authorization
    string

    Access token with organizer:file scope (see Authorization)

  • Range
    string

    A range of requested items using the files unit. The size of the range can not exceed 50. (see Pagination)

    Example: files=0-49

Query Parameters

  • file_ids
    array

    Only return files for the given list of ids.

    Example: 437854281666691129,529400138800557511

  • contexts
    array

    One or several contexts of files to filter on.

    Example: circuit_logo,tournament_logo

  • associated
    integer

    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)
  • id
    string

    The id of the file.

    Example: "437854281666691129"

  • context
    string

    The context of the file.

    Example: "match_report_proof"

  • associated
    boolean

    Whether the file is used.

    Example: true

  • status
    string

    The file processing status.

    Possible values: pending, processing, available, failed

POST /files

Creates a new file.

Resource URL

https://api.toornament.com/organizer/v2/files

HTTP headers

  • X-Api-Key
    string

    API key of your application (see Authentication)

  • Authorization
    string

    Access token with organizer:file scope (see Authorization)

  • Content-Type
    string

    The media type of the uploaded file.

    Example: image/png

  • Content-Disposition
    string

    The name of the uploaded file. The first parameter is ignored.

    Example: inline; filename="test.png"

Query Parameters

  • context
    string

    The media context of the uploaded file (see File upload)

    Possible values: circuit_logo, tournament_logo, tournament_background, tournament_sponsor, match_report_proof

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)
  • id
    string

    The id of the file.

    Example: "437854281666691129"

  • context
    string

    The context of the file.

    Example: "match_report_proof"

  • associated
    boolean

    Whether the file is used.

    Example: true

  • status
    string

    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-Key
    string

    API key of your application (see Authentication)

  • Authorization
    string

    Access token with organizer:file scope (see Authorization)

Path parameters

  • id
    string

    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-Key
    string

    API key of your application (see Authentication)

  • Authorization
    string

    Access token with organizer:file scope (see Authorization)

Path parameters

  • id
    string

    The id of the file.

  • format
    string

    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)...