2bttns
  • Getting Started
    • What is 2bttns?
    • Quick Start
    • 🆕You Asked We Listened
  • HOW TO
    • Set up your Console
    • Use the API
    • Build a game
    • Manage game data
    • Integrate game via API
    • Retrieve scores via API
  • References
    • APIs
      • Authentication
      • Generate Game URL
      • Games
      • Game Objects
      • Tags
      • Players
      • Admin
      • Export/Import
    • Command Line Interface (CLI)
      • Install
      • Usage
      • Configuration
  • TUTORIALS
    • ✨Personalize profiles with 2bttns and Next.js
Powered by GitBook
On this page

Was this helpful?

  1. References
  2. APIs

Tags

PreviousGame ObjectsNextPlayers

Was this helpful?

Delete Tags

delete

Delete one or more Tags by their IDs

Authorizations
Query parameters
idstring[]Optional
Responses
200
Successful response
application/json
default
Error response
application/json
delete
DELETE /api/tags HTTP/1.1
Host: 
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "deletedCount": 1
}

Get Tag Count

get

Get Tag Count

Authorizations
Query parameters
idFilterany ofOptional

Comma-separated tag IDs to filter by

notOptional
or
string[]Optional
nameFilterany ofOptional

Comma-separated tag names to filter by

notOptional
or
string[]Optional
Responses
200
Successful response
application/json
default
Error response
application/json
get
GET /api/tags/count HTTP/1.1
Host: 
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "count": 1
}

Get Tag by ID

get

Get a Tag by its ID.

Authorizations
Path parameters
idstringRequired

ID value. Only alphanumeric, underscore, and hyphen are allowed.

Pattern: ^[a-zA-Z0-9_-]+$
Responses
200
Successful response
application/json
default
Error response
application/json
get
GET /api/tags/{id} HTTP/1.1
Host: 
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "tag": {
    "id": "text",
    "name": "text",
    "description": "text",
    "createdAt": "text",
    "updatedAt": "text"
  }
}
  • GETGet All Tags
  • POSTCreate Tag
  • DELETEDelete Tags
  • GETGet Tag Count
  • GETGet Tag by ID
  • PUTUpdate Tag by ID

Get All Tags

get

Get all tags

Authorizations
Query parameters
idFilterany ofOptional

Comma-separated tag IDs to filter by

notOptional
or
string[]Optional
nameFilterany ofOptional

Comma-separated tag names to filter by

notOptional
or
string[]Optional
takeany ofOptionalDefault: 10
notOptional
or
numberOptional
skipany ofOptionalDefault: 0
notOptional
or
numberOptional
sortFieldstring · enumOptional

Field to sort by

Possible values:
sortOrderstring · enumOptional

Sort order for the selected field

Possible values:
Responses
200
Successful response
application/json
default
Error response
application/json
get
GET /api/tags HTTP/1.1
Host: 
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "tags": [
    {
      "id": "text",
      "name": "text",
      "description": "text",
      "createdAt": "text",
      "updatedAt": "text"
    }
  ]
}

Create Tag

post

Create Tag

Authorizations
Body
idstringOptional

ID value. Only alphanumeric, underscore, and hyphen are allowed.

Pattern: ^[a-zA-Z0-9_-]+$
namestringRequired
descriptionstringOptional
Responses
200
Successful response
application/json
default
Error response
application/json
post
POST /api/tags HTTP/1.1
Host: 
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 48

{
  "id": "text",
  "name": "text",
  "description": "text"
}
{
  "createdTag": {
    "id": "text",
    "name": "text",
    "description": "text",
    "createdAt": "text",
    "updatedAt": "text"
  }
}

Update Tag by ID

put

Update a Tag by its ID

Authorizations
Path parameters
idstringRequired

ID value. Only alphanumeric, underscore, and hyphen are allowed.

Pattern: ^[a-zA-Z0-9_-]+$
Body
Responses
200
Successful response
application/json
default
Error response
application/json
put
PUT /api/tags/{id} HTTP/1.1
Host: 
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 112

{
  "data": {
    "id": "text",
    "name": "text",
    "description": "text",
    "addGameObjects": [
      "text"
    ],
    "removeGameObjects": [
      "text"
    ]
  }
}
{
  "updatedTag": {
    "id": "text",
    "createdAt": "text",
    "updatedAt": "text",
    "name": "text",
    "description": "text",
    "gameObjectCount": 1
  }
}