Player Competitor

Table of Contents

 

Player

A Competitor of type Player eases the representation of data for a real world player.

A Player can be proposed through the Fixtures API v2 on endpoint /v2/competitors/players.

A player will be considered as duplicate if a there is already a Player with the same GSS Person Id for the same Sport

In order a Competitor of type Player to be created you first need to create a Person

A Player can be requested through the Fixtures API v2 on endpoint /v2/competitors/players.

When to use

The competitor of type Player can be used to define the players which can take part in Fixtures, Rounds, Seasons for specific Sport.

Competitors of type Players can only be used when the Sport for which the Player is proposed allows Player Competitors.

How to use

The competitor of type Player entity can be used by getting the GSS Id of the Player from the Fixtures API v2 on endpoint /v2/competitors/players. 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 Players from Fixtures API v2

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

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

    { "page": 0, "pageSize": 0, "totalItems": 0, "items": [ { "id": 0, // GSS Player Id "createdOn": "2022-06-23T10:49:49.608Z", // When was the Player created "modifiedOn": "2022-06-23T10:49:49.608Z", // When was the Player last modified "updatesCount": 0, // How many times the Player was modified "metadataProperties": [ // Sport specific additional data for the Player (if available) { "name": "string", "value": "string", "isDeleted": true } ], "name": "string", // The name of the Player (either the Full Name or the NickName based on the Related person UseNickname property) "sport": { "id": 0, // GSS Sport Id defines in which Fixtures, Rounds, Seasons the Player can take part "name": "string", "ref": "/sports/{id}" // Endpoint on which Sport is available }, "genderType": "string", // Defines in which Fixtures, Rounds, Seasons the Player can take part "locality": { "id": 0, // GSS Locality Id that defines the Nationality of the Player "name": "string", "ref": "/localities/{id}" // Endpoint on which the Locality is available }, "competitorStatusType": "string", // Defines whether the Player can be used in Fixtures, Rounds, Seasons "person": { // The associated Person to the Player "id": 0, // GSS Person Id "createdOn": "2022-06-23T10:49:49.608Z", // When was the Person created "modifiedOn": "2022-06-23T10:49:49.608Z", // When was the Person last modified "updatesCount": 0, // How many times was the Person modified "fullName": "string", // The Full Name of the Person "nickName": "string", // The NickName of the Person (if available) "useNickname": true, // Whether the Person will be displayed with its Nickname when used in Players/Doubles Partnership names "firstName": "string", // The First Name of the Person "lastName": "string", // The Last Name of the Person "genderType": "string", The Gender of the Person "dateOfBirth": "2022-06-23T10:49:49.608Z", // The Date Of Birth of the Person (if available) "isActive": true, // Whether the Person can be used in Contracts and Fixture Officials "locality": { // The Nationallity of the Person "id": 0, // GSS Locality Id "name": "string", "ref": "/localities/{id}" // Endpoint on which the Locality is available }, "sports": [ { "id": 0, // The Sports in which the Person can be used "name": "string", "ref": "/sports/{id}" // Endpoint on which Sport is available } ], "ref": "string" } } ], "self": "string", "previous": "string", "next": "string", "first": "string", "last": "string" }

     

  2. POST Fixture with any of the retrieved GSS Player 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 Player Ids which are going to compete in the Fixture // e.g. 1, 2 ], "startDate": "2021-11-29T09:34:10.302Z", "roundId": 0, "name": "string" } '

Read Data Points

Field

Type

Nullable

Description

Field

Type

Nullable

Description

id

int64|unsigned

The numeric identifier of the Player

name

string

The name of the Player based on the associated Person’s Full Name or Nickname based on the Person’s UseNickname property value. The property is auto filled/updated by associated Person

genderType

string|in: undefined, male, female, mixed

Restricts the Player to be used only in Mixed or in its specific gender Fixtures, Rounds, Seasons. The property is auto filled/updated by associated Person

competitorStatusType

string|in: Active, Retired, Unattached

Active - The Player can be used in Fixtures, Rounds, Seasons

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

This property is auto set on creation to Active.

This property is Auto updated based on associated Person’s IsActive property and the Sports related to the Person. For more info visit Person section Important.

sport

object|SportEmbed

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

locality

object|LocalityEmbed

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

person

object|PersonEmbed

Check Person

metadataProperties

array|MetadataEmbed

Check AllowedMetadataPropertyType

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 amount 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

PersonId

int64|unsigned

The Person which will be associated with the Player.

competitorStatusType

int34|in: 0 - Active, 1 - Retired, 2 - Unattached

Active - The Player can be used in Fixtures, Rounds, Seasons

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

This property is auto set on creation to Active.

This property is Auto updated based on associated Person’s IsActive property and the Sports related to the person. For more info visit Person section Important.

 

sportId

int64|unsigned

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

metadataProperties

array|MetadataEmbed

Check AllowedMetadataPropertyType

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

Player must exist

400

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

Player must not exist

409

Conflict detected! A player competitor with Id {existing player id} was already created for person with Id {gs person id}.

Sport must allow player competitors

400

Proposed sport does not allow players competitors!

Sport must exist

400

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

Person must exist

400

Not found. Missing Person entity with id: {proposed person id}

Person must be active

400

Only persons which are active are allowed to be connected with competitor via contract or to be part of double partnerships!

Person must have the sport associated

400

Person cannot be used in sport {proposed sport id} as the sports associated with the person are: {sport ids separated by ', '}

On CompetitorStatusType change the Player must not be part of future fixtures

400

Competitor cannot be associated with future fixtures when status is changed! In order to update status of the current competitor delete all fixtures associated with it.

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!