REST API v1 · למפתחים · מדריך עיון ל-API

מדריך עיון ל-API: ערעורי הרחקה

כל 4 נקודות הקצה של ערעורי הרחקה ב-REST API v1 של BotGG: הרשאות, פרמטרים, שדות, שגיאות ודוגמאות מוכנות ב-curl, JavaScript ו-Python.

תיעוד למפתחים
בעמוד הזה

נקודות קצה

הנתיבים יחסיים ל-https://console.botgg.app/api/v1. שלחו את מפתח ה-API בכותרת Authorization: Bearer botgg_…; מזהים הם מחרוזות.

נקודות קצה: ערעורי הרחקה
נקודת קצההרשאהתיאור
GET/guilds/{guildId}/appealsappeals:readList ban appeals
GET/guilds/{guildId}/appeals/{number}appeals:readGet a ban appeal
POST/guilds/{guildId}/appeals/{number}/approveappeals:writeApprove a ban appeal (unban)
POST/guilds/{guildId}/appeals/{number}/rejectappeals:writeReject a ban appeal

מלבד השגיאות הייחודיות שלה (בהמשך), כל נקודת קצה יכולה להחזיר את השגיאות הכלליות האלה:

List ban appeals

GET/guilds/{guildId}/appeals

הרשאה: appeals:read

Newest first. status=open (default) = open + waiting for the user’s answer; all = every status. Pass before=<nextCursor> for the next page.

נדרש שהפיצ׳ר הזה יהיה מופעל בשרת: ערעורי הרחקה

פרמטרים
שםמיקוםסוגחובהתיאור
guildIdנתיבstringכןהמזהה של השרת שלכם · מזהה דיסקורד (מחרוזת)
statusquerystringלאאחד מ: open, question, approved, rejected, closed, all · ברירת מחדל "open"
userIdquerystringלאOnly this user’s appeals
מזהה דיסקורד (מחרוזת)
limitqueryintegerלא1–100 · ברירת מחדל 25
beforequeryintegerלא1–999,999,999

תשובה

שדות התשובה · 200
שדהסוגחובהתיאור
itemsarray of objectכן
items[].numberintegerכן
items[].userIdstringכן
items[].userTagstring | nullכן
items[].statusstringכןאחד מ: open, question, approved, rejected, closed
items[].banCaseNumberinteger | nullכן
items[].claimedBystring | nullכן
items[].decidedBystring | nullכןnull = system / API
items[].decidedAtstring | nullכןISO 8601 date-time
items[].reasonstring | nullכן
items[].createdAtstring | nullכןISO 8601 date-time
items[].lastActivityAtstring | nullכןISO 8601 date-time
nextCursorstring | nullכן
תשובה · 200
{
  "items": [
    {
      "number": 7,
      "userId": "876543210987654321",
      "userTag": "example",
      "status": "open",
      "banCaseNumber": 10,
      "claimedBy": "example",
      "decidedBy": "example",
      "decidedAt": "2026-10-07T12:00:00.000Z",
      "reason": "Tournament prize",
      "createdAt": "2026-10-07T12:00:00.000Z",
      "lastActivityAt": "2026-10-07T12:00:00.000Z"
    }
  ],
  "nextCursor": "98700"
}

דוגמאות

curl
curl -s "https://console.botgg.app/api/v1/guilds/123456789012345678/appeals?status=open&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/appeals?status=open&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/appeals",
    headers={
        "Authorization": f"Bearer {os.environ['BOTGG_API_KEY']}",
    },
    params={
        "status": "open",
        "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 a ban appeal

GET/guilds/{guildId}/appeals/{number}

הרשאה: appeals:read

With the answers, the ban reason and the conversation the appellant sees. Internal staff notes are never returned.

נדרש שהפיצ׳ר הזה יהיה מופעל בשרת: ערעורי הרחקה

פרמטרים
שםמיקוםסוגחובהתיאור
guildIdנתיבstringכןהמזהה של השרת שלכם · מזהה דיסקורד (מחרוזת)
numberנתיבstringכן

תשובה

שדות התשובה · 200
שדהסוגחובהתיאור
numberintegerכן
userIdstringכן
userTagstring | nullכן
statusstringכןאחד מ: open, question, approved, rejected, closed
banCaseNumberinteger | nullכן
claimedBystring | nullכן
decidedBystring | nullכןnull = system / API
decidedAtstring | nullכןISO 8601 date-time
reasonstring | nullכן
createdAtstring | nullכןISO 8601 date-time
lastActivityAtstring | nullכןISO 8601 date-time
banReasonstring | nullכן
answersarray of objectכן
answers[].idstringכן
answers[].typestringכן
answers[].labelstringכן
answers[].valueanyכן
messagesarray of objectכןThe conversation the appellant sees (staff questions + replies). Internal notes are never included.
messages[].authorstringכןאחד מ: user, staff
messages[].authorIdstring | nullכן
messages[].textstringכן
messages[].createdAtstring | nullכןISO 8601 date-time
applyingbooleanכןA console/API decision is still being applied in Discord
failedActionobject | nullכן
failedAction.typestringכן
failedAction.errorstring | nullכן
תשובה · 200
{
  "number": 7,
  "userId": "876543210987654321",
  "userTag": "example",
  "status": "open",
  "banCaseNumber": 10,
  "claimedBy": "example",
  "decidedBy": "example",
  "decidedAt": "2026-10-07T12:00:00.000Z",
  "reason": "Tournament prize",
  "createdAt": "2026-10-07T12:00:00.000Z",
  "lastActivityAt": "2026-10-07T12:00:00.000Z",
  "banReason": "example",
  "answers": [
    {
      "id": "example",
      "type": "example",
      "label": "Example",
      "value": null
    }
  ],
  "messages": [
    {
      "author": "user",
      "authorId": "234567890123456789",
      "text": "Example answer",
      "createdAt": "2026-10-07T12:00:00.000Z"
    }
  ],
  "applying": true,
  "failedAction": {
    "type": "example",
    "error": "example"
  }
}

דוגמאות

curl
curl -s "https://console.botgg.app/api/v1/guilds/123456789012345678/appeals/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/appeals/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/appeals/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)

שגיאות

שגיאות
HTTPקודים
404APPEAL_NOT_FOUND
409FEATURE_DISABLED
503SERVICE_UNAVAILABLE

Approve a ban appeal (unban)

POST/guilds/{guildId}/appeals/{number}/approve

הרשאה: appeals:writeרגישהIdempotency-Key

Same as Approve in the console: the bot unbans within a few seconds (an unban moderation case when Moderation is enabled), creates a single-use invite and DMs the user per the appeal settings. Written to the audit log.

נדרש שהפיצ׳ר הזה יהיה מופעל בשרת: ערעורי הרחקה

פרמטרים
שםמיקוםסוגחובהתיאור
guildIdנתיבstringכןהמזהה של השרת שלכם · מזהה דיסקורד (מחרוזת)
numberנתיבstringכן
Idempotency-Keyכותרתstringלאלא חובה. שלחו ערך ייחודי (UUID) והשתמשו בו שוב בניסיונות חוזרים — השינוי יקרה פעם אחת בלבד. איך זה עובד

גוף הבקשה

גוף הבקשה
שדהסוגחובהתיאור
reasonstring | nullלאSent to the appellant (DM / appeal page)
עד 1,000 תווים

תשובה

שדות התשובה · 202
שדהסוגחובהתיאור
numberintegerכן
userIdstringכן
userTagstring | nullכן
statusstringכןאחד מ: open, question, approved, rejected, closed
banCaseNumberinteger | nullכן
claimedBystring | nullכן
decidedBystring | nullכןnull = system / API
decidedAtstring | nullכןISO 8601 date-time
reasonstring | nullכן
createdAtstring | nullכןISO 8601 date-time
lastActivityAtstring | nullכןISO 8601 date-time
banReasonstring | nullכן
answersarray of objectכן
answers[].idstringכן
answers[].typestringכן
answers[].labelstringכן
answers[].valueanyכן
messagesarray of objectכןThe conversation the appellant sees (staff questions + replies). Internal notes are never included.
messages[].authorstringכןאחד מ: user, staff
messages[].authorIdstring | nullכן
messages[].textstringכן
messages[].createdAtstring | nullכןISO 8601 date-time
applyingbooleanכןA console/API decision is still being applied in Discord
failedActionobject | nullכן
failedAction.typestringכן
failedAction.errorstring | nullכן
תשובה · 202
{
  "number": 7,
  "userId": "876543210987654321",
  "userTag": "example",
  "status": "open",
  "banCaseNumber": 10,
  "claimedBy": "example",
  "decidedBy": "example",
  "decidedAt": "2026-10-07T12:00:00.000Z",
  "reason": "Tournament prize",
  "createdAt": "2026-10-07T12:00:00.000Z",
  "lastActivityAt": "2026-10-07T12:00:00.000Z",
  "banReason": "example",
  "answers": [
    {
      "id": "example",
      "type": "example",
      "label": "Example",
      "value": null
    }
  ],
  "messages": [
    {
      "author": "user",
      "authorId": "234567890123456789",
      "text": "Example answer",
      "createdAt": "2026-10-07T12:00:00.000Z"
    }
  ],
  "applying": true,
  "failedAction": {
    "type": "example",
    "error": "example"
  }
}

דוגמאות

curl
curl -s -X POST "https://console.botgg.app/api/v1/guilds/123456789012345678/appeals/234567890123456789/approve" \
  -H "Authorization: Bearer $BOTGG_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"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/appeals/234567890123456789/approve', {
  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({
    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/appeals/234567890123456789/approve",
    headers={
        "Authorization": f"Bearer {os.environ['BOTGG_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),  # reuse it when you retry this request
    },
    json={
        "reason": "Tournament prize",
    },
    timeout=10,
)
data = res.json()
if not res.ok:
    raise RuntimeError(f"{res.status_code} {data['error']}: {data['message']}")
print(data)

שגיאות

Reject a ban appeal

POST/guilds/{guildId}/appeals/{number}/reject

הרשאה: appeals:writeרגישהIdempotency-Key

Same as Reject in the console: the user gets the rejection DM per the appeal settings and the re-appeal cooldown starts. Written to the audit log.

נדרש שהפיצ׳ר הזה יהיה מופעל בשרת: ערעורי הרחקה

פרמטרים
שםמיקוםסוגחובהתיאור
guildIdנתיבstringכןהמזהה של השרת שלכם · מזהה דיסקורד (מחרוזת)
numberנתיבstringכן
Idempotency-Keyכותרתstringלאלא חובה. שלחו ערך ייחודי (UUID) והשתמשו בו שוב בניסיונות חוזרים — השינוי יקרה פעם אחת בלבד. איך זה עובד

גוף הבקשה

גוף הבקשה
שדהסוגחובהתיאור
reasonstring | nullלאSent to the appellant (DM / appeal page)
עד 1,000 תווים

תשובה

שדות התשובה · 202
שדהסוגחובהתיאור
numberintegerכן
userIdstringכן
userTagstring | nullכן
statusstringכןאחד מ: open, question, approved, rejected, closed
banCaseNumberinteger | nullכן
claimedBystring | nullכן
decidedBystring | nullכןnull = system / API
decidedAtstring | nullכןISO 8601 date-time
reasonstring | nullכן
createdAtstring | nullכןISO 8601 date-time
lastActivityAtstring | nullכןISO 8601 date-time
banReasonstring | nullכן
answersarray of objectכן
answers[].idstringכן
answers[].typestringכן
answers[].labelstringכן
answers[].valueanyכן
messagesarray of objectכןThe conversation the appellant sees (staff questions + replies). Internal notes are never included.
messages[].authorstringכןאחד מ: user, staff
messages[].authorIdstring | nullכן
messages[].textstringכן
messages[].createdAtstring | nullכןISO 8601 date-time
applyingbooleanכןA console/API decision is still being applied in Discord
failedActionobject | nullכן
failedAction.typestringכן
failedAction.errorstring | nullכן
תשובה · 202
{
  "number": 7,
  "userId": "876543210987654321",
  "userTag": "example",
  "status": "open",
  "banCaseNumber": 10,
  "claimedBy": "example",
  "decidedBy": "example",
  "decidedAt": "2026-10-07T12:00:00.000Z",
  "reason": "Tournament prize",
  "createdAt": "2026-10-07T12:00:00.000Z",
  "lastActivityAt": "2026-10-07T12:00:00.000Z",
  "banReason": "example",
  "answers": [
    {
      "id": "example",
      "type": "example",
      "label": "Example",
      "value": null
    }
  ],
  "messages": [
    {
      "author": "user",
      "authorId": "234567890123456789",
      "text": "Example answer",
      "createdAt": "2026-10-07T12:00:00.000Z"
    }
  ],
  "applying": true,
  "failedAction": {
    "type": "example",
    "error": "example"
  }
}

דוגמאות

curl
curl -s -X POST "https://console.botgg.app/api/v1/guilds/123456789012345678/appeals/234567890123456789/reject" \
  -H "Authorization: Bearer $BOTGG_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"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/appeals/234567890123456789/reject', {
  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({
    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/appeals/234567890123456789/reject",
    headers={
        "Authorization": f"Bearer {os.environ['BOTGG_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),  # reuse it when you retry this request
    },
    json={
        "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 בחינם ומפעילים יכולות בקונסולת הווב.