REST API v1 · Разработчикам · Справочник API

Справочник API: Заявки

Все 4 эндпоинта раздела «Заявки» в REST API BotGG v1: права, параметры, поля, ошибки и готовые примеры на curl, JavaScript и Python.

Документация для разработчиков
На этой странице

Эндпоинты

Пути указаны относительно https://console.botgg.app/api/v1. Передавайте API-ключ в заголовке Authorization: Bearer botgg_…; ID — строки.

Эндпоинты: Заявки
ЭндпоинтПравоОписание
GET/guilds/{guildId}/applications/formsapplications:readList application forms
GET/guilds/{guildId}/applications/submissionsapplications:readList applications
GET/guilds/{guildId}/applications/submissions/{number}applications:readGet an application
POST/guilds/{guildId}/applications/submissions/{number}/decisionapplications:writeAccept or deny an application

Кроме собственных ошибок (см. ниже), любой эндпоинт может вернуть эти общие:

List application forms

GET/guilds/{guildId}/applications/forms

Право: applications:read

In the console’s order, with their questions and submission counts.

На сервере должен быть включён модуль: Заявки

Параметры
ИмяГдеТипОбязательноеОписание
guildIdпутьstringДаID вашего сервера · Discord ID (строка)

Ответ

Поля ответа · 200
ПолеТипОбязательноеОписание
itemsarray of objectДа
items[].idintegerДа
items[].titlestringДа
items[].descriptionstringДа
items[].openbooleanДаThe open toggle (the open window is in opensAt / closesAt)
items[].opensAtstring | nullДаISO 8601 date-time
items[].closesAtstring | nullДаISO 8601 date-time
items[].questionsarray of objectДа
items[].questions[].idstringДа
items[].questions[].typestringДа
items[].questions[].labelstringДа
items[].questions[].requiredbooleanДа
items[].submissionsobjectДа
items[].submissions.totalintegerДа
items[].submissions.openintegerДа
Ответ · 200
{
  "items": [
    {
      "id": 98765,
      "title": "example",
      "description": "example",
      "open": true,
      "opensAt": "2026-10-07T12:00:00.000Z",
      "closesAt": "2026-10-07T12:00:00.000Z",
      "questions": [
        {
          "id": "example",
          "type": "example",
          "label": "Example",
          "required": true
        }
      ],
      "submissions": {
        "total": 10,
        "open": 10
      }
    }
  ]
}

Примеры

curl
curl -s "https://console.botgg.app/api/v1/guilds/123456789012345678/applications/forms" \
  -H "Authorization: Bearer $BOTGG_API_KEY"
JavaScript (fetch)
// Node.js 18+ (built-in fetch) — on your server, never in a browser
const res = await fetch('https://console.botgg.app/api/v1/guilds/123456789012345678/applications/forms', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.BOTGG_API_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${res.status} ${data.error}: ${data.message}`);
console.log(data);
Python (requests)
import os
import requests

res = requests.get(
    "https://console.botgg.app/api/v1/guilds/123456789012345678/applications/forms",
    headers={
        "Authorization": f"Bearer {os.environ['BOTGG_API_KEY']}",
    },
    timeout=10,
)
data = res.json()
if not res.ok:
    raise RuntimeError(f"{res.status_code} {data['error']}: {data['message']}")
print(data)

Ошибки

Ошибки
HTTPКоды
409FEATURE_DISABLED
503SERVICE_UNAVAILABLE

List applications

GET/guilds/{guildId}/applications/submissions

Право: applications:read

Newest first, without answers. status=open = pending + interview + hold, decided = accepted + denied. Pass before=<nextCursor> for the next page.

На сервере должен быть включён модуль: Заявки

Параметры
ИмяГдеТипОбязательноеОписание
guildIdпутьstringДаID вашего сервера · Discord ID (строка)
statusquerystringНетОдно из pending, interview, hold, accepted, denied, withdrawn, open, decided
formIdqueryintegerНетне меньше 1
userIdquerystringНетOnly this applicant
Discord ID (строка)
limitqueryintegerНет1–100 · По умолчанию 25
beforequeryintegerНет1–999 999 999

Ответ

Поля ответа · 200
ПолеТипОбязательноеОписание
itemsarray of objectДа
items[].numberintegerДа
items[].formIdinteger | nullДаnull when the form was deleted
items[].formTitlestring | nullДа
items[].userIdstringДа
items[].statusstringДаОдно из pending, interview, hold, accepted, denied, withdrawn
items[].votesobjectДа
items[].votes.upintegerДа
items[].votes.downintegerДа
items[].submittedAtstring | nullДаISO 8601 date-time
items[].decidedAtstring | nullДаISO 8601 date-time
items[].decidedBystring | nullДаnull = system / API
items[].reasonstring | nullДа
nextCursorstring | nullДа
Ответ · 200
{
  "items": [
    {
      "number": 7,
      "formId": 98765,
      "formTitle": "example",
      "userId": "876543210987654321",
      "status": "pending",
      "votes": {
        "up": 10,
        "down": 10
      },
      "submittedAt": "2026-10-07T12:00:00.000Z",
      "decidedAt": "2026-10-07T12:00:00.000Z",
      "decidedBy": "example",
      "reason": "Tournament prize"
    }
  ],
  "nextCursor": "98700"
}

Примеры

curl
curl -s "https://console.botgg.app/api/v1/guilds/123456789012345678/applications/submissions?limit=25" \
  -H "Authorization: Bearer $BOTGG_API_KEY"
JavaScript (fetch)
// Node.js 18+ (built-in fetch) — on your server, never in a browser
const res = await fetch('https://console.botgg.app/api/v1/guilds/123456789012345678/applications/submissions?limit=25', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.BOTGG_API_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${res.status} ${data.error}: ${data.message}`);
console.log(data);
Python (requests)
import os
import requests

res = requests.get(
    "https://console.botgg.app/api/v1/guilds/123456789012345678/applications/submissions",
    headers={
        "Authorization": f"Bearer {os.environ['BOTGG_API_KEY']}",
    },
    params={
        "limit": 25,
    },
    timeout=10,
)
data = res.json()
if not res.ok:
    raise RuntimeError(f"{res.status_code} {data['error']}: {data['message']}")
print(data)

Ошибки

Ошибки
HTTPКоды
409FEATURE_DISABLED
503SERVICE_UNAVAILABLE

Get an application

GET/guilds/{guildId}/applications/submissions/{number}

Право: applications:read

With the answers and the applicant snapshot taken at submit time (account age, join date, roles, level).

На сервере должен быть включён модуль: Заявки

Параметры
ИмяГдеТипОбязательноеОписание
guildIdпутьstringДаID вашего сервера · Discord ID (строка)
numberпутьstringДа

Ответ

Поля ответа · 200
ПолеТипОбязательноеОписание
numberintegerДа
formIdinteger | nullДаnull when the form was deleted
formTitlestring | nullДа
userIdstringДа
statusstringДаОдно из pending, interview, hold, accepted, denied, withdrawn
votesobjectДа
votes.upintegerДа
votes.downintegerДа
submittedAtstring | nullДаISO 8601 date-time
decidedAtstring | nullДаISO 8601 date-time
decidedBystring | nullДаnull = system / API
reasonstring | nullДа
answersarray of objectДа
answers[].idstringДа
answers[].typestringДа
answers[].labelstringДа
answers[].textstringДа
applicantobjectДа
applicant.accountCreatedAtstring | nullДаISO 8601 date-time
applicant.joinedAtstring | nullДаISO 8601 date-time
applicant.roleIdsarray of stringДа
applicant.levelinteger | nullДа
applyingbooleanДаA console/API decision is still being applied in Discord
failedActionsarray of objectДа
failedActions[].typestringДа
failedActions[].errorstring | nullДа
Ответ · 200
{
  "number": 7,
  "formId": 98765,
  "formTitle": "example",
  "userId": "876543210987654321",
  "status": "pending",
  "votes": {
    "up": 10,
    "down": 10
  },
  "submittedAt": "2026-10-07T12:00:00.000Z",
  "decidedAt": "2026-10-07T12:00:00.000Z",
  "decidedBy": "example",
  "reason": "Tournament prize",
  "answers": [
    {
      "id": "example",
      "type": "example",
      "label": "Example",
      "text": "Example answer"
    }
  ],
  "applicant": {
    "accountCreatedAt": "2026-10-07T12:00:00.000Z",
    "joinedAt": "2026-10-07T12:00:00.000Z",
    "roleIds": [
      "234567890123456789"
    ],
    "level": 5
  },
  "applying": true,
  "failedActions": [
    {
      "type": "example",
      "error": "example"
    }
  ]
}

Примеры

curl
curl -s "https://console.botgg.app/api/v1/guilds/123456789012345678/applications/submissions/234567890123456789" \
  -H "Authorization: Bearer $BOTGG_API_KEY"
JavaScript (fetch)
// Node.js 18+ (built-in fetch) — on your server, never in a browser
const res = await fetch('https://console.botgg.app/api/v1/guilds/123456789012345678/applications/submissions/234567890123456789', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.BOTGG_API_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${res.status} ${data.error}: ${data.message}`);
console.log(data);
Python (requests)
import os
import requests

res = requests.get(
    "https://console.botgg.app/api/v1/guilds/123456789012345678/applications/submissions/234567890123456789",
    headers={
        "Authorization": f"Bearer {os.environ['BOTGG_API_KEY']}",
    },
    timeout=10,
)
data = res.json()
if not res.ok:
    raise RuntimeError(f"{res.status_code} {data['error']}: {data['message']}")
print(data)

Ошибки

Accept or deny an application

POST/guilds/{guildId}/applications/submissions/{number}/decision

Право: applications:writeIdempotency-Key

Same as Accept / Deny in the console: decided now (status, reason, reapply cooldown after a denial), then the bot gives / removes the form’s roles, DMs the applicant, announces and updates the review within a few seconds (applying). Written to the audit log.

На сервере должен быть включён модуль: Заявки

Параметры
ИмяГдеТипОбязательноеОписание
guildIdпутьstringДаID вашего сервера · Discord ID (строка)
numberпутьstringДа
Idempotency-KeyзаголовокstringНетНеобязательно. Передайте уникальное значение (UUID) и повторяйте его при ретраях — операция выполнится один раз. Как это работает

Тело запроса

Тело запроса
ПолеТипОбязательноеОписание
decisionstringДаОдно из accepted, denied
reasonstring | nullНетSent to the applicant (DM) and shown in the review
до 1 000 символов

Ответ

Поля ответа · 202
ПолеТипОбязательноеОписание
numberintegerДа
formIdinteger | nullДаnull when the form was deleted
formTitlestring | nullДа
userIdstringДа
statusstringДаОдно из pending, interview, hold, accepted, denied, withdrawn
votesobjectДа
votes.upintegerДа
votes.downintegerДа
submittedAtstring | nullДаISO 8601 date-time
decidedAtstring | nullДаISO 8601 date-time
decidedBystring | nullДаnull = system / API
reasonstring | nullДа
answersarray of objectДа
answers[].idstringДа
answers[].typestringДа
answers[].labelstringДа
answers[].textstringДа
applicantobjectДа
applicant.accountCreatedAtstring | nullДаISO 8601 date-time
applicant.joinedAtstring | nullДаISO 8601 date-time
applicant.roleIdsarray of stringДа
applicant.levelinteger | nullДа
applyingbooleanДаA console/API decision is still being applied in Discord
failedActionsarray of objectДа
failedActions[].typestringДа
failedActions[].errorstring | nullДа
Ответ · 202
{
  "number": 7,
  "formId": 98765,
  "formTitle": "example",
  "userId": "876543210987654321",
  "status": "pending",
  "votes": {
    "up": 10,
    "down": 10
  },
  "submittedAt": "2026-10-07T12:00:00.000Z",
  "decidedAt": "2026-10-07T12:00:00.000Z",
  "decidedBy": "example",
  "reason": "Tournament prize",
  "answers": [
    {
      "id": "example",
      "type": "example",
      "label": "Example",
      "text": "Example answer"
    }
  ],
  "applicant": {
    "accountCreatedAt": "2026-10-07T12:00:00.000Z",
    "joinedAt": "2026-10-07T12:00:00.000Z",
    "roleIds": [
      "234567890123456789"
    ],
    "level": 5
  },
  "applying": true,
  "failedActions": [
    {
      "type": "example",
      "error": "example"
    }
  ]
}

Примеры

curl
curl -s -X POST "https://console.botgg.app/api/v1/guilds/123456789012345678/applications/submissions/234567890123456789/decision" \
  -H "Authorization: Bearer $BOTGG_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"decision":"accepted","reason":"Tournament prize"}'
JavaScript (fetch)
// Node.js 18+ (built-in fetch) — on your server, never in a browser
const res = await fetch('https://console.botgg.app/api/v1/guilds/123456789012345678/applications/submissions/234567890123456789/decision', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.BOTGG_API_KEY}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': crypto.randomUUID(), // reuse it when you retry this request
  },
  body: JSON.stringify({
    decision: 'accepted',
    reason: 'Tournament prize',
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(`${res.status} ${data.error}: ${data.message}`);
console.log(data);
Python (requests)
import os, uuid
import requests

res = requests.post(
    "https://console.botgg.app/api/v1/guilds/123456789012345678/applications/submissions/234567890123456789/decision",
    headers={
        "Authorization": f"Bearer {os.environ['BOTGG_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),  # reuse it when you retry this request
    },
    json={
        "decision": "accepted",
        "reason": "Tournament prize",
    },
    timeout=10,
)
data = res.json()
if not res.ok:
    raise RuntimeError(f"{res.status_code} {data['error']}: {data['message']}")
print(data)

Ошибки

Готовы прокачать свой сервер?

Добавьте BotGG бесплатно и включайте нужные функции в веб-консоли.