GET /tournaments/{tournament_id}/custom-fields
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
- X-Api-Keystring
API key of your application (see Authentication)
Path parameters
- tournament_idstring
The id of the tournament you want to retrieve data about.
Query Parameters
- target_typestring
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_namestring
A name used to identify a custom field for computing purposes.
Pattern: ^[a-z0-9_]+$
Max. length: 255 characters
Example: "my_steam_id"
- labelstring
The display name of a custom field in forms.
Max. length: 255 characters
Example: "My Steam ID"
- target_typestring
The entity concerned by the custom field.
Possible values: player, team, team_player
- typestring
A data type used for both input and computing.
Example: "steam_player_id"
- default_valuemixed|null
A default value (can be array, scalar or null).
Example: #steam_id
- requiredboolean
Whether the custom field is required.
Example: false
- publicboolean
Whether the value of the custom field is public.
Example: false
- positioninteger
The position of the field in forms.
Example: 5