TBD Competitor

Table of Contents

 

TBD

The TBD acronym stands for To Be Decided, which means that represents a competitor which cannot be determined at first e.g. Like when there is a draw and there will be semifinal for sure but you still don’t know who are the competitors which will compete in the semifinal.

A TBD competitor can be proposed through the Fixtures API v2 on endpoint /v2/competitors/tbds

A TBD competitor will be considered as duplicate if there is another with the same combination of name and Sport

A TBD competitor can be requested through the Fixtures API v2 on endpoint /v2/competitors/tbds.

When to use

The TBD competitor can be used when, for some reason, it is unclear who are the competitors which will compete in specific fixture.

How to use

The TBD competitor entity can be used by getting its GSS Id from the Fixtures API v2 on endpoint /v2/competitors/tbds. And then set the needed GSS Id to the request which is going to be made to Fixtures API v2 when it is needed.

Example workflow

  1. GET GSS TDBs from Fixtures API v2

    curl --location --request GET 'https://ci.fixtures.api.geniussports.com/v2/competitors/tbds' \ --header 'x-api-key: <<api_key>>' \ --header 'Content-Type: application/json' \ --header 'Authorization: <<id_token>>' \ --data-raw ''

    A successful response would be with status code 200 and JSON data in format:

    { "page": 0, "pageSize": 0, "totalItems": 0, "items": [ { "id": 0, // GSS TBD Id "createdOn": "2022-06-23T10:49:49.608Z", // When was the TBD competitor created "modifiedOn": "2022-06-23T10:49:49.608Z", // When was the TBD competitor last modified "updatesCount": 0, // How many times the TBD competitor was modified "metadataProperties": [ // Sport specific additional data for the TBD competitor (if available) { "name": "string", "value": "string", "isDeleted": true } ], "name": "string", // The name of the TBD competitor "sport": { "id": 0, // GSS Sport Id defines in which Fixtures, Rounds, Seasons the TBD competitor can take part "name": "string", "ref": "/sports/{id}" // Endpoint on which Sport is available }, "genderType": "string", // Defines in which Fixtures, Rounds, Seasons the TBD competitor can take part "locality": { "id": 0, // The TBD competitor's location "name": "string", "ref": "/localities/{id}" // Endpoint on which the Locality is available }, "competitorStatusType": "string", // Defines whether the TBD competitor is active, retired, or unattached } ], "self": "string", "previous": "string", "next": "string", "first": "string", "last": "string" }

     

  2. POST Fixture with any of the retrieved GSS TBD competitor Ids:

    curl --location --request POST 'https://ci.fixtures.api.geniussports.com/v2/fixtures' \ --header 'x-api-key: <<api_key>>' \ --header 'Content-Type: application/json' \ --header 'Authorization: <<id_token>>' \ --data-raw '{ "seasonId": 0, "competitors": [ // Include separated by coma 2 GSS TBDs Ids which are going to compete in the Fixture // e.g. 1, 2 ], "startDate": "2021-11-29T09:34:10.302Z", "roundId": 0, "venueId": 0,// GSS Venue Id from previous request "localityId": 0, "name": "string" } '

Read Data Points

Field

Type

Nullable

Description

Field

Type

Nullable

Description

id

int64|unsigned

The numeric identifier of the TBD competitor

name

string

The name of the TBD competitor

genderType

string|in: undefined, male, female, mixed

Restricts the TBD competitor to be used only in Mixed or in its specific gender Fixtures, Rounds, Seasons.

competitorStatusType

string|in: Active, Retired, Unattached

Active - The TBD competitor can be used in Fixtures, Rounds, Seasons

Retired/ Unattached - The TBD competitor cannot be used in Fixtures, Rounds, Seasons.

This property is auto set on creation to Active.

sport

object|SportEmbed

The numeric identifier, name, and a reference of the Sport that the TBD competitor plays in

locality

object|LocalityEmbed

The id, name, and reference of the Locality that the TBD competitor is from

createdOn

timestamp

The timestamp when the data entity was created

modifiedOn

timestamp

The timestamp when the data entity was last updated

updatesCount

int32|unsigned

The number of times the data entity was updated

Create/Update Data Points

Field

Type

Required For Create

Required For Update

Description

Field

Type

Required For Create

Required For Update

Description

id

int64|unsigned

The numeric identifier of the entity

name

string

The name of the TBD competitor

sportId

int64|unsigned

The GSS Sport Id in which the Team can be used in Fixtures, Rounds, Seasons

Validations

Description

On Create

On Update

On Delete

Response Code

Contains Conflict Header

Error Message

Description

On Create

On Update

On Delete

Response Code

Contains Conflict Header

Error Message

TBD must exist

400

Not found. Missing TBD entity with id: {proposed id}

TBD must not exist

409

Conflict detected! A TBD competitor with Id {existing tbd id} was already created.

Sport must exist

400

Not found. Missing Sport entity with id: {proposed sport id}

Ensure unique name per Sport

409

 

Conflict detected! Competitor with name {name} for Sport id {sport id} already exists under id {competitor with same name’s id}

Must not be associated with Seasons

400

Only competitor without associated Seasons can be deleted!

Must not be associated with Rounds

400

Only competitor without associated Rounds can be deleted!

Must not be associated with Fixtures

400

Only competitor without associated Fixtures can be deleted!