Viewer API › Custom Fields Legacy

LegacyGET /tournaments/{tournament_id}/custom-fields

This endpoint is in legacy mode. Access will soon be deprecated. It is therefore advised to use another endpoint when possible.

Returns the complete definition of all custom fields for a given tournament. This includes both public and private custom fields. A custom field may be associated to a player, a team or a team's player. For more information, please read the Custom Fields documentation.

Resource URL

https://api.toornament.com/viewer/v2/tournaments/{tournament_id}/custom-fields

HTTP headers

Path parameters

  • tournament_id
    string

    The id of the tournament you want to retrieve data about.

Query Parameters

  • target_type
    string

    The entity affected by the custom fields.

    Possible values: player, team, team_player

Request Body

This endpoint does not require a request body.

Response

[200] Success.

Example
[
    {
        "machine_name": "my_steam_id",
        "label": "My Steam ID",
        "target_type": "player",
        "type": "steam_player_id",
        "default_value": "#steam_id",
        "required": false,
        "public": false,
        "position": 5
    }
]
Structure (collection)
  • machine_name
    string

    A name used to identify a custom field for computing purposes.

    Pattern: ^[a-z0-9_]+$

    Max. length: 255 characters

    Example: "my_steam_id"

  • label
    string

    The display name of a custom field in forms.

    Max. length: 255 characters

    Example: "My Steam ID"

  • target_type
    string

    The entity concerned by the custom field.

    Possible values: player, team, team_player

  • type
    string

    A data type used for both input and computing.

    Example: "steam_player_id"

  • default_value
    mixed|null

    A default value (can be array, scalar or null).

    Example: #steam_id

  • required
    boolean

    Whether the custom field is required.

    Example: false

  • public
    boolean

    Whether the value of the custom field is public.

    Example: false

  • position
    integer

    The position of the field in forms.

    Example: 5