Add a team player
POST/v1/teams/{teamId}/players
const url = 'https://api.ligr.live/rest/v1/teams/1/players';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"firstName":"example","lastName":"example","number":"example","position":"example","positionType":"example","gfxFirstName":"example","gfxLastName":"example","defaultStarter":true,"defaultBench":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.ligr.live/rest/v1/teams/1/players \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "firstName": "example", "lastName": "example", "number": "example", "position": "example", "positionType": "example", "gfxFirstName": "example", "gfxLastName": "example", "defaultStarter": true, "defaultBench": true }'Creates a new player in your organization and adds the player to the roster of the team.
The team must belong to your organization. The response has the same shape as an item of
GET /v1/teams/{teamId}/players. Use the returned id as playerId in
PUT /v2/matches/{matchId}/lineup.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Entity identifier
The team id
Request Bodyrequired
Section titled “Request Bodyrequired”Add a new player to a team roster. firstName and lastName are required.
number is the squad number, 0 to 3 characters. position is the position label, for example
“Goalkeeper”. positionType is the sport position key, for example goalKeeper.
gfxFirstName and gfxLastName are the names that graphics show, 1 to 16 characters.
Set defaultStarter or defaultBench to put the player in the default starting list or on the
default bench. Both are false when you omit them.
object
Default Player first name
Default Player first name
A player position label or position key
A player position label or position key
A player name that graphics show
A player name that graphics show
Examplegenerated
{ "firstName": "example", "lastName": "example", "number": "example", "position": "example", "positionType": "example", "gfxFirstName": "example", "gfxLastName": "example", "defaultStarter": true, "defaultBench": true}Responses
Section titled “Responses”Created
object
Entity identifier
Default Player first name
Name predominantly display in graphics
Name predominantly display in graphics
Default Player first name
Examplegenerated
{ "id": 1, "firstName": "example", "gfxFirstName": "example", "gfxLastName": "example", "lastName": "example", "position": "example", "positionType": "example", "number": "example", "starter": true, "bench": true, "captain": true, "photoUrl": "example"}Request is invalid
object
object
Examplegenerated
{ "message": "example", "details": { "additionalProperty": "example" }}Missing or invalid api key
object
Examplegenerated
{ "message": "example"}Api key provides insufficient access for the request
object
Examplegenerated
{ "message": "example"}Team not found
object
Examplegenerated
{ "message": "example"}Api key has made too many requests
object
Examplegenerated
{ "message": "example"}An unexpected error has occured. If problems persist please contact support
object
Examplegenerated
{ "message": "example"}