DoublesPartnership Competitor
Table of Contents
DoublesPartnership
A Competitor of type DoublesPartnership eases the representation of data for a real-life doubles partnership. In order to create a DoublesPartnership you will need to have the 2 Persons which will be needed to form the DoublesPartnership e.g. In order to create competitor of type DoublesPartnership for N. Djokovic and R. Nadal you will first have to have both Persons created in the GSS system.
A DoublesPartnership can be proposed through the Fixtures API v2 on endpoint /v2/competitors/doubles
A DoublesPartnership will be considered as duplicate when all of the properties GSS Sport Id, GSS FirstPerson Id and GSS SecondPerson Id match any of the already existing DoublesPartnerships in the GSS system.
A DoublesPartnership can be requested through the Fixtures API v2 on endpoint /v2/competitors/doubles
.
When to use
The competitor of type DoublesPartnership can be used to define the doubles partnership which are part of a the Sports allowing such competitor types.
Competitors of type Doubles can only be used when the Sport for which the Double is proposed allows Doubles Competitors.
How to use
The competitor of type DoublesPartnership entity can be used by getting the GSS Id of the DoublesPartnership from the Fixtures API v2 on endpoint /v2/competitors/doubles
. 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
GET GSS DoublesPartnership from Fixtures API v2
curl --location --request GET 'https://ci.fixtures.api.geniussports.com/v2/competitors/doubles' \ --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 Id of the doubles partnership "name": "string", // Name of the doubles partnership "sport": { "Id": 0, // GSS Sport ID Defines in which seasons, rounds, fixtures it can be used "Name": "string", "ref": "/sports/{id}" // Endpoint on which Sport is available }, "locality": { "Id": 0, // The locality of the Doubles partnership (if both players which are part of it are from the same locality it is the locality of the players, else it is set to GSS Locality Id 2 (World)) "Name": "string", "ref": "/localities/{id}" // Endpoint on which the Locality is available }, "genderType": "string", // The gender of the Doubles Partnership defines in which seasons it can be used (e.g. season with gendertype Male cannot include doubles partnership with gender type Female) "competitorStatusType": "string", // Defines whether the player can be used in teams or in fixtures. It can only be used if the status is set to 'Active' "createdOn": "2021-11-29T11:12:23.459Z", "modifiedOn": "2021-11-29T11:12:23.459Z" } ], "self": "string", "previous": "string", "next": "string", "first": "string", "last": "string" }
POST Fixture with any of the retrieved GSS DoublesPartnership 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 Doubles Partnership Ids which are going to compete in the fixture // e.g. 1, 2 ], "startDate": "2021-11-29T09:34:10.302Z", "name": "string" } '
Read Data Points
Field | Type | Nullable | Description |
---|---|---|---|
id | int64|unsigned |
| The numeric identifier of the Doubles Partnership competitor |
name | string |
| The name of the Double Partnership. Based on the associated Persons' Full Name or Nickname based on the Persons’ UseNickname property value in format |
genderType | string|in: undefined, male, female, mixed |
| Restricts the Doubles Partnership to be used only in Mixed or in its specific gender Fixtures, Rounds, Seasons. The property is auto filled/updated based on the associated Persons (e.g. if 2 males → male, if 2 females → female, else → mixed) |
competitorStatusType | string|in: Active, Retired, Unattached |
| Active - The Doubles Partnership can be used in Fixtures, Rounds, Seasons Retired/ Unattached - The Doubles Partnership cannot be used in Fixtures, Rounds, Seasons. This property is auto set on creation to Active. This property is Auto updated based on associated Persons’ IsActive property. For more info visit Person section Important. |
sport | object|SportEmbed |
| The numeric identifier, name and a reference of the Sport that the Doubles Partnership plays in |
locality | object|LocalityEmbed |
| The id, name and reference of the Locality that the Doubles Partnership is from auto filled/updated base on the associated Persons. E.g.: |
metadataProperties | array|MetadataEmbed |
| |
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 |
---|---|---|---|---|
id | int64|unsigned |
|
| The numeric identifier of the Doubles Partnership |
FirstPersonId | int64|unsigned |
|
| The First Person which will be associated with the Doubles Partnership. The First Person name will appear as the first name in the Doubles Partnership name. e.g. Rafael Nadal is proposed as First Person then the name of the Doubles Partnership will become: Rafael Nadal/xxx xxx |
SecondPersonId | int64|unsigned |
|
| The Second Persons which will be associated with the Doubles Partnership. The Second Persons name will appear as the second name in the Doubles Partnership name. e.g. Rafael Nadal is proposed as Second Persons then the name of the Doubles Partnership will become: xxx xxx/Rafael Nadal |
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 Persons’ IsActive property and their Sports. For more info visit Person section Important.
|
sportId | int64|unsigned |
|
| The GSS Sport Id in which the Doubles Partnership can be used in Fixtures, Rounds, Seasons |
metadataProperties | array|MetadataEmbed |
|
|
Validations
Description | On Create | On Update | On Delete | Response Code | Contains Conflict Header | Error Message |
---|---|---|---|---|---|---|
Doubles Partnership must exist |
|
|
| 400 |
| Not found. Missing Competitor entity with id: {proposed id} |
Doubles Partnership must not exist |
|
|
| 409 |
| Conflict detected! Proposed persons already have doubles partnership relation! Doubles Parnership id: {existing doubles id}. |
Sport must allow Doubles Partnership competitors |
|
|
| 400 |
| Proposed sport does not allow doubles partnership! |
Sport must exist |
|
|
| 400 |
| Not found. Missing Sport entity with id: {proposed sport id} |
First/ Second Person must exist |
|
|
| 400 |
| Not found. Missing Person entity with id: {proposed person id} |
First/ Second 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 ', '} |
First and Second person must not be the same |
|
|
| 400 |
| FirstPersonId must be different from SecondPersonId! |
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! |