Custom Fields

GET /tournaments/{tournament_id}/custom-fields

Simple Access

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

    An unique identifier of the tournament.

Query Parameters

  • target_type
    string

    Possible values: player, team, team_player

Request Body

This endpoint doesn't require a request body.

Response

[200] Success

Example
[
    {
        "id": "128114939547269789",
        "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)
  • id
    string

    An unique identifier for the custom-field

    Example: "128114939547269789"

  • machine_name
    string

    A name used to identify a custom field for computing purposes (maximum 255 characters, accepts only "a-z0-9_" characters)

    Example: "my_steam_id"

  • label
    string

    A name used in forms to display a custom field (maximum 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

    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 values of the custom field are public

    Example: false

  • position
    integer

    An ordering position used in forms

    Example: 5