Перейти к основному содержанию
POST
/
games
Create game
curl --request POST \
  --url https://api.oquiz.net/games \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "settings": {
    "prePlay": true,
    "teamMode": true
  },
  "visibility": "<unknown>",
  "communicationInviteUrl": "<unknown>",
  "password": "<unknown>",
  "packageId": "<string>",
  "versionId": "<unknown>"
}
'
{
  "id": "<string>",
  "name": "<string>",
  "users": "<unknown>",
  "settings": {
    "gameId": "<string>",
    "slots": 123,
    "prePlay": true,
    "teamMode": true
  },
  "visibility": "<unknown>",
  "communicationInviteUrl": "<unknown>",
  "userId": "<string>",
  "packageId": "<unknown>",
  "versionId": "<unknown>",
  "expiredAt": "<unknown>",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z"
}

Авторизации

Authorization
string
header
обязательно

Тело

application/json
settings
object
обязательно

Game settings

visibility
обязательно

Game visibility

communicationInviteUrl
null | string
обязательно

Discord or Telegram invite link for public games, required for public games

password
null | string
обязательно

Game password for private games

packageId
string
обязательно

id of the package that will be used to start the game

versionId
null | string
обязательно

id of the package version that will be used to start the game, if not provided, use the latest published version

Ответ

201 - application/json
id
string
обязательно
name
string
обязательно

Game name

users
any
обязательно

List of users in the game

settings
object
обязательно

Game settings

visibility
обязательно

Game visibility

communicationInviteUrl
null | string
обязательно

Communication invite URL

userId
string
обязательно

Owner user id

packageId
null | string
обязательно

Package id that the game is based on

versionId
null | string
обязательно

Version id that the game is based on

expiredAt
null | string<date-time>
обязательно

Game expiration date

createdAt
string<date-time>
обязательно

Game creation date

updatedAt
string<date-time>
обязательно

Game update date