Players
Was this helpful?
Was this helpful?
Get player by ID
ID value. Only alphanumeric, underscore, and hyphen are allowed.
^[a-zA-Z0-9_-]+$
GET /api/players/{id} HTTP/1.1
Host:
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"player": {
"id": "text",
"name": "text",
"createdAt": "text",
"updatedAt": "text"
}
}
Delete player by ID
ID value. Only alphanumeric, underscore, and hyphen are allowed.
^[a-zA-Z0-9_-]+$
DELETE /api/players/{id} HTTP/1.1
Host:
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"deletedPlayer": {
"id": "text",
"name": "text",
"createdAt": "text",
"updatedAt": "text"
}
}
Get all players
GET /api/players HTTP/1.1
Host:
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"players": [
{
"id": "text",
"name": "text",
"createdAt": "text",
"updatedAt": "text"
}
]
}
Creates a player with the given ID and an optional name. The ID must be unique, and ideally corresponds with a user ID used by the app integrating with 2bttns.
ID value. Only alphanumeric, underscore, and hyphen are allowed.
^[a-zA-Z0-9_-]+$
POST /api/players/create HTTP/1.1
Host:
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 27
{
"id": "text",
"name": "text"
}
{
"createdPlayer": {
"id": "text",
"name": "text",
"createdAt": "text",
"updatedAt": "text"
}
}
Update player by ID.
ID value. Only alphanumeric, underscore, and hyphen are allowed.
^[a-zA-Z0-9_-]+$
PUT /api/players/{id} HTTP/1.1
Host:
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 36
{
"data": {
"id": "text",
"name": "text"
}
}
{
"updatedPlayer": {
"id": "text",
"name": "text",
"createdAt": "text",
"updatedAt": "text"
}
}