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}/appeals | appeals:read | List ban appeals |
GET/guilds/{guildId}/appeals/{number} | appeals:read | Get a ban appeal |
POST/guilds/{guildId}/appeals/{number}/approve | appeals:write | Approve a ban appeal (unban) |
POST/guilds/{guildId}/appeals/{number}/reject | appeals:write | Reject a ban appeal |
מלבד השגיאות הייחודיות שלה (בהמשך), כל נקודת קצה יכולה להחזיר את השגיאות הכלליות האלה:
List ban appeals
GET/guilds/{guildId}/appeals
Newest first. status=open (default) = open + waiting for the user’s answer; all = every status. Pass before=<nextCursor> for the next page.
נדרש שהפיצ׳ר הזה יהיה מופעל בשרת: ערעורי הרחקה
| שם | מיקום | סוג | חובה | תיאור |
|---|---|---|---|---|
guildId | נתיב | string | כן | המזהה של השרת שלכם · מזהה דיסקורד (מחרוזת) |
status | query | string | לא | אחד מ: open, question, approved, rejected, closed, all · ברירת מחדל "open" |
userId | query | string | לא | Only this user’s appeals מזהה דיסקורד (מחרוזת) |
limit | query | integer | לא | 1–100 · ברירת מחדל 25 |
before | query | integer | לא | 1–999,999,999 |
תשובה
| שדה | סוג | חובה | תיאור |
|---|---|---|---|
items | array of object | כן | |
items[].number | integer | כן | |
items[].userId | string | כן | |
items[].userTag | string | null | כן | |
items[].status | string | כן | אחד מ: open, question, approved, rejected, closed |
items[].banCaseNumber | integer | null | כן | |
items[].claimedBy | string | null | כן | |
items[].decidedBy | string | null | כן | null = system / API |
items[].decidedAt | string | null | כן | ISO 8601 date-time |
items[].reason | string | null | כן | |
items[].createdAt | string | null | כן | ISO 8601 date-time |
items[].lastActivityAt | string | null | כן | ISO 8601 date-time |
nextCursor | string | null | כן |
{
"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 -s "https://console.botgg.app/api/v1/guilds/123456789012345678/appeals?status=open&limit=25" \
-H "Authorization: Bearer $BOTGG_API_KEY"// 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);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 | קודים |
|---|---|
| 409 | FEATURE_DISABLED |
| 503 | SERVICE_UNAVAILABLE |
Get a ban appeal
GET/guilds/{guildId}/appeals/{number}
With the answers, the ban reason and the conversation the appellant sees. Internal staff notes are never returned.
נדרש שהפיצ׳ר הזה יהיה מופעל בשרת: ערעורי הרחקה
| שם | מיקום | סוג | חובה | תיאור |
|---|---|---|---|---|
guildId | נתיב | string | כן | המזהה של השרת שלכם · מזהה דיסקורד (מחרוזת) |
number | נתיב | string | כן |
תשובה
| שדה | סוג | חובה | תיאור |
|---|---|---|---|
number | integer | כן | |
userId | string | כן | |
userTag | string | null | כן | |
status | string | כן | אחד מ: open, question, approved, rejected, closed |
banCaseNumber | integer | null | כן | |
claimedBy | string | null | כן | |
decidedBy | string | null | כן | null = system / API |
decidedAt | string | null | כן | ISO 8601 date-time |
reason | string | null | כן | |
createdAt | string | null | כן | ISO 8601 date-time |
lastActivityAt | string | null | כן | ISO 8601 date-time |
banReason | string | null | כן | |
answers | array of object | כן | |
answers[].id | string | כן | |
answers[].type | string | כן | |
answers[].label | string | כן | |
answers[].value | any | כן | |
messages | array of object | כן | The conversation the appellant sees (staff questions + replies). Internal notes are never included. |
messages[].author | string | כן | אחד מ: user, staff |
messages[].authorId | string | null | כן | |
messages[].text | string | כן | |
messages[].createdAt | string | null | כן | ISO 8601 date-time |
applying | boolean | כן | A console/API decision is still being applied in Discord |
failedAction | object | null | כן | |
failedAction.type | string | כן | |
failedAction.error | string | null | כן |
{
"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 -s "https://console.botgg.app/api/v1/guilds/123456789012345678/appeals/234567890123456789" \
-H "Authorization: Bearer $BOTGG_API_KEY"// 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);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 | קודים |
|---|---|
| 404 | APPEAL_NOT_FOUND |
| 409 | FEATURE_DISABLED |
| 503 | SERVICE_UNAVAILABLE |
Approve a ban appeal (unban)
POST/guilds/{guildId}/appeals/{number}/approve
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) והשתמשו בו שוב בניסיונות חוזרים — השינוי יקרה פעם אחת בלבד. איך זה עובד |
גוף הבקשה
| שדה | סוג | חובה | תיאור |
|---|---|---|---|
reason | string | null | לא | Sent to the appellant (DM / appeal page) עד 1,000 תווים |
תשובה
| שדה | סוג | חובה | תיאור |
|---|---|---|---|
number | integer | כן | |
userId | string | כן | |
userTag | string | null | כן | |
status | string | כן | אחד מ: open, question, approved, rejected, closed |
banCaseNumber | integer | null | כן | |
claimedBy | string | null | כן | |
decidedBy | string | null | כן | null = system / API |
decidedAt | string | null | כן | ISO 8601 date-time |
reason | string | null | כן | |
createdAt | string | null | כן | ISO 8601 date-time |
lastActivityAt | string | null | כן | ISO 8601 date-time |
banReason | string | null | כן | |
answers | array of object | כן | |
answers[].id | string | כן | |
answers[].type | string | כן | |
answers[].label | string | כן | |
answers[].value | any | כן | |
messages | array of object | כן | The conversation the appellant sees (staff questions + replies). Internal notes are never included. |
messages[].author | string | כן | אחד מ: user, staff |
messages[].authorId | string | null | כן | |
messages[].text | string | כן | |
messages[].createdAt | string | null | כן | ISO 8601 date-time |
applying | boolean | כן | A console/API decision is still being applied in Discord |
failedAction | object | null | כן | |
failedAction.type | string | כן | |
failedAction.error | string | null | כן |
{
"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 -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"}'// 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);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)שגיאות
| HTTP | קודים |
|---|---|
| 400 | INVALID_JSON |
| 403 | SELF_DECISION |
| 404 | APPEAL_NOT_FOUND |
| 409 | FEATURE_DISABLED, ALREADY_DECIDED |
| 413 | PAYLOAD_TOO_LARGE |
| 415 | UNSUPPORTED_MEDIA_TYPE |
| 422 | IDEMPOTENCY_KEY_REUSED |
| 503 | SERVICE_UNAVAILABLE |
Reject a ban appeal
POST/guilds/{guildId}/appeals/{number}/reject
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) והשתמשו בו שוב בניסיונות חוזרים — השינוי יקרה פעם אחת בלבד. איך זה עובד |
גוף הבקשה
| שדה | סוג | חובה | תיאור |
|---|---|---|---|
reason | string | null | לא | Sent to the appellant (DM / appeal page) עד 1,000 תווים |
תשובה
| שדה | סוג | חובה | תיאור |
|---|---|---|---|
number | integer | כן | |
userId | string | כן | |
userTag | string | null | כן | |
status | string | כן | אחד מ: open, question, approved, rejected, closed |
banCaseNumber | integer | null | כן | |
claimedBy | string | null | כן | |
decidedBy | string | null | כן | null = system / API |
decidedAt | string | null | כן | ISO 8601 date-time |
reason | string | null | כן | |
createdAt | string | null | כן | ISO 8601 date-time |
lastActivityAt | string | null | כן | ISO 8601 date-time |
banReason | string | null | כן | |
answers | array of object | כן | |
answers[].id | string | כן | |
answers[].type | string | כן | |
answers[].label | string | כן | |
answers[].value | any | כן | |
messages | array of object | כן | The conversation the appellant sees (staff questions + replies). Internal notes are never included. |
messages[].author | string | כן | אחד מ: user, staff |
messages[].authorId | string | null | כן | |
messages[].text | string | כן | |
messages[].createdAt | string | null | כן | ISO 8601 date-time |
applying | boolean | כן | A console/API decision is still being applied in Discord |
failedAction | object | null | כן | |
failedAction.type | string | כן | |
failedAction.error | string | null | כן |
{
"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 -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"}'// 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);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)שגיאות
| HTTP | קודים |
|---|---|
| 400 | INVALID_JSON |
| 403 | SELF_DECISION |
| 404 | APPEAL_NOT_FOUND |
| 409 | FEATURE_DISABLED, ALREADY_DECIDED |
| 413 | PAYLOAD_TOO_LARGE |
| 415 | UNSUPPORTED_MEDIA_TYPE |
| 422 | IDEMPOTENCY_KEY_REUSED |
| 503 | SERVICE_UNAVAILABLE |