接口
基础地址
获取验证码 /api/captcha
REQUEST: HTTP GET /api/captcha
RESPONSE: HTTP 200 OK
body: {
success: 1,
code: 'captcha.gen',
data: {
hash: string, // encrypted captcha
content: string // svg image
}
}
获取站点统计信息 /api/statistics
REQUEST: HTTP GET /api/statistics
parameters: reports? : '' // show reports number
players? : '' // show players that is reported number
confirmed? : '' // show confirmed number
registers? : '' // show register number
banappeals? : ''// show ban appeals number
details? : '' // show number of each game, each status
from? : number // stats from when? unix timestamp
RESPONSE: HTTP 200 OK
body: {
success: 1,
code: 'statistics.success',
data: {
reports?: number
players?: number
confirmed?: number
registers?: number
banappeals?: number
details?: {
byGame: {
bf1: number,
bfv: number,
...
},
byStatus: {
1: number,
2: numebr,
...
}
}
}
}
获取网站最近活动 /api/activities
REQUEST: HTTP GET /api/activities
parameters: from?: number(unixTimeStamp)
limit?: number
// show $limit activities before $from
RESPONSE: HTTP 200 OK
body: {
success: 1,
code: 'activities.ok',
data: [ // sort by time
{
id: number,
byUserName: string,
byUserId: number,
toPlayerId: number,
toPlayerName: string,
createTime: string(ISODate)
type: 'banAppeal'
}, ...
{
id: number,
byUserName: string,
byUserId: number,
toPlayerId: number,
toPlayerName: string,
game: string,
createTime: string(ISODate)
type: 'report'
}, ...
{
id: number,
byUserName: string,
byUserId: number,
toPlayerId: number,
toPlayerName: string,
action: string
createTime: string(ISODate)
type: 'judgement'
}, ...
{
id: number,
username: string,
createTime: string(ISODate)
type: 'register
}, ...
]
}
获取玩家分项目统计信息
REQUEST HTTP POST /api/playerStatistics
body: {
data: {
game: string('bf1'|'bfv'|'*'),
status: number(-1(all),0,...)
}[], // 20 max
}
RESPONSE: HTTP 200 OK
body: {
success: 1,
code: "playerStatistics.success",
data: {
game: string(as request),
status: number(as request),
count: number
}[],
}
获取最近热议
REQUEST HTTP GET /api/trend
RESPONSE HTTP 200 OK
body: {
success: 1,
code: "trend.ok",
data: {
hot: number,
id: number,
originName: string,
originUserId: string,
originPersonaId: string,
games: string[], // example: ["bf1","bfv"]
cheatMethods: string[],
avatarlink: string,
viewNum: number,
commentsNum: number,
status: number,
createTime: string(ISODate),
updateTime: string(ISODate)
}[],
}
获取网站历史统计数据 /api/siteStats
REQUEST HTTP GET /api/siteStats
RESPONSE HTTP 200 OK
body: {
success: 1,
code: 'siteStats.ok',
data: {
playerStats: { num:number, time: string(ISOdate) }[],
confirmStats: { num:number, time: string(ISOdate) }[],
userStats: { num:number, time: string(ISOdate) }[]
}
}
获取网站公告 /api/announcements
获取网站管理员列表 /api/admins
REQUEST: HTTP GET /api/admins
REPONSE: HTTP 200 OK
body: {
success: 1,
code: 'getAdmin.success',
data: {
id:number,
username:string,
originName?:string,
originUserId?:string,
privilege:string[]
}[],
}
获取被举报玩家列表 /api/players
REQUEST: HTTP GET /api/players
parameters: game?: ''|'bf1'|'bfv' // specify the game('' all)
createTimeFrom?: number // create from when(unix timestamp)
updateTimeFrom?: number // update from when(unix timestamp)
createTimeTo?: number // create to when(unix timestamp)
updateTimeTo?: number // update to when(unix timestamp)
status?: -1|0|1|2|3|4|5 // the status the player is in(-1 all)
sortBy?: 'createTime'|'updateTime'|'viewNum'|'commentsNum'
order?: 'desc'|'asc' // sort order
limit?: number
skip?: number
RESPONSE: HTTP 200 OK
body: {
success: 1,
code: 'players.ok',
data: {
result: { // the player details
id: number,
originName: string,
originUserId: string,
originPersonaId: string,
games: string[], // example: ["bf1","bfv"]
cheatMethods: string[],
avatarlink: string,
viewNum: number,
commentsNum: number,
status: number,
createTime: string(ISODate),
updateTime: string(ISODate)
}[],
total: number // the number of all results
}
}
获取申诉列表 /api/banAppeals
REQUEST: HTTP GET /api/players
parameters: game?: ''|'bf1'|'bfv' // specify the game('' all)
createTimeFrom?: number // create from when(unix timestamp)
createTimeTo?: number // create to when(unix timestamp)
status?: 'open'|'close'|'lock'|'all' // the status the appeal is in
order?: 'desc'|'asc' // sort order
limit?: number
skip?: number
RESPONSE: HTTP 200 OK
body: {
success: 1,
code: 'banAppeals.ok',
data: {
result: { // the player details
id: number,
originName: string,
originUserId: string,
originPersonaId: string,
games: string[], // example: ["bf1","bfv"]
cheatMethods: string[],
avatarlink: string,
viewNum: number,
commentsNum: number,
status: number,
createTime: string(ISODate),
updateTime: string(ISODate),
appealStatus: 'open'|'close'|'lock',
appealTime: string(ISOdate),
byUserId: number
}[],
total: number // the number of all results
}
}
搜索被举报玩家名字及历史名字 /api/search
REQUEST: HTTP GET /api/search
parameters: param: string // the name need to search
game?: ''|'bf1'|'bfv' // specify the game('' all)
createTimeFrom?: number // create from when(unix timestamp)
createTimeTo?: number // create to when(unix timestamp)
skip?: number
offset?: number
RESPONSE: HTTP 200 OK
body: {
success: 1,
code: 'search.success',
data: {
historyName: string,
dbId: number,
originName: string,
originUserId: string,
originPersonaId: string,
avatarLink: string(url),
games: string[],
cheatMethods: string[],
viewNum: number,
commentsNum: number,
createTime: string(ISODate),
updateTime: string(ISODate),
status: number,
log: {
from: string(ISODate), // name log from
to: string(ISODate) // name log to
}
}[]
}
搜索玩家当前名字 /api/advanceSearch
REQUEST: HTTP GET /api/advanceSearch
headers: x-access-token: {{access_token}} // login required
parameters: param: string // the name need to search
RESPONSE: HTTP 200 OK
body: {
success: 1,
code: 'advSearch.foundOrigin'|'advSearch.foundBoth',
data: {
exact: {
originName: string,
originPersonaId: string,
originUserId: sting,
avatarLink: string(url),
record: Player | null
},
similars: {
originName: string,
originPersonaId: string,
originUserId: sting,
record: Player | null
}[]
}
}
获取被举报玩家信息 /api/player
REQUEST: HTTP GET /api/player
parameters: OneOf [
userId?: string
personaId?: string
dbId?: number ]
history?: ''
RESPONSE: HTTP 200 OK
body: {
success: 1,
code: 'player.ok',
data: {
id: number,
originName: string,
originPersonaId: string,
originUserId: string,
games: string[],
cheatMethods: string[],
avatarlink: string,
viewNum: number,
commentsNum: number,
status: number,
createTime: string(ISODate),
updateTime: string(ISODate),
history?: {
originName: string,
fromTime: string(ISODate),
toTime: string(ISODate),
}[],
}
}
批量获取被举报玩家信息 /api/player/batch
REQUEST: HTTP GET /api/player/batch
parameters: personaIds?: string[] // example /api/player/batch?dbIds[]=1&dbIds[]=2 -> dbIds=[1,2]
originIds?: string[] // max 128 entities
dbIds?: string[]
RESPONSE: HTTP 200 OK
body: {
success: 1,
code: 'playerBatch.ok',
data: {
id: number,
originName: string,
originPersonaId: string,
originUserId: string,
games: string[],
cheatMethods: string[],
avatarlink: string,
viewNum: number,
commentsNum: number,
status: number,
createTime: string(ISODate),
updateTime: string(ISODate),
}[]
}
举报玩家 /api/player/report
REQUEST: HTTP POST /api/player/report
headers: x-access-token: {{access_token}} // login required
body: {
data: {
game: 'bf1'|'bfv',
originName: string,
cheatMethods: string[], // see {{valid_cheatMethod}}
videoLink: string(url)|null,
description: string
},
encryptCaptcha: string(base64),
captcha: string // captcha required
}
RESPONSE: HTTP 201 CREATED
body: {
success: 1,
code: 'report.success',
data: {
originName: string,
originUserId: string,
originPersonaId: string,
dbId: number,
},
message: 'Thank you.'
}
HTTP 404 NOTFOUND
{
error: 1,
code: 'report.notFound',
message: 'Report user not found.'
}
valid_cheatMethods
['wallhack', 'aimbot', 'invisible', 'magicBullet', 'damageChange', 'gadgetModify', 'teleport', 'attackServer']
使用ID举报玩家 /api/player/reportById
REQUEST: HTTP POST /api/player/reportById
headers: x-access-token: {{access_token}} // login required
body: {
data: {
game: 'bf1'|'bfv',
originUserId: string,
cheatMethods: string[], // see {{valid_cheatMethod}}
videoLink: string(url)|null,
description: string
},
encryptCaptcha: string(base64),
captcha: string // captcha required
}
RESPONSE: HTTP 201 CREATED
body: {
success: 1,
code: 'report.success',
data: {
originName: string,
originUserId: string,
originPersonaId: string,
dbId: number,
},
message: 'Thank you.'
}
HTTP 404 NOTFOUND
{
error: 1,
code: 'report.notFound',
message: 'Report user not found.'
}
获取被举报玩家案件时间线 /api/player/timeline
REQUEST: HTTP GET /api/player/timeline
parameters: OneOf [
userId?: string
personaId?: string
dbId?: number ]
skip?: number // skip previous n record
limit?: number // limit n record, max 100
RESPONSE: HTTP 200 OK
body: {
success: 1,
code: 'timeline.ok',
data: [
{ type:'report', id: number, videoLink:string(url), ... }...
{ type:'reply', id: number, content:string, ... }...
{ type:'judgement', id: number, action:string, ...}...
{ type:'banAppeal', id: number, content:string, ...}...
// Order by createTime, asc
]
}
评论被举报玩家 /api/player/reply
REQUEST: HTTP POST /api/player/reply
headers: x-access-token: {{access_token}} // login required
body: {
data: {
toPlayerId: number,
toCommentId?: number,
content: string,
}
}
RESPONSE: HTTP 201 CREATED
body: {
success: 1,
code: 'reply.suceess',
message: 'Reply success.'
}
更新被举报玩家信息 /api/player/update
REQUEST: HTTP POST /api/player/update
headers: x-access-token: {{access_token}} // login required
parameters: OneOf [
userId?: string
personaId?: string
dbId?: number ]
RESPONSE: HTTP 200 OK
body: {
success: 1,
code:'update.success',
data: {
originName: string,
originUserId: string,
originPersonaId: string,
}
}
给予被举报玩家判定 /api/player/judgement
新版本细分了原来回收站的状态,原回收站改名无效举报,新增证据不足分类,效果同回收站
REQUEST: HTTP POST /api/player/judgement
headers: x-access-token: {{access_token}} // login required, admin privilege
body: {
data: {
toPlayerId: number,
cheatMethods: array[], // see {{valid_cheatMethod}}
action: 'suspect'|'innocent'|'discuss'|'guilt'|'kill'|'more'|'invalid' // super
content: string
}
}
RESPONSE: HTTP 201 CREATED
body: {
success: 1,
code: 'judgement.success',
message: 'thank you.'
}
为被举报玩家提出申诉 /api/player/banAppeal
REQUEST: HTTP POST /api/player/banAppeal
headers: x-access-token: {{access_token}} // login required
body: {
data: {
toPlayerId: number,
content: string
}
}
RESPONSE: HTTP 201 CREATED
body: {
success: 1,
code: 'judgement.success',
message: 'please wait.'
}
管理员处理申诉 /api/player/viewBanAppeal
lock状态可使用户无法发起新的申诉
REQUEST: HTTP POST /api/player/viewBanAppeal
headers: x-access-token: {{access_token}} // login required, admin only
body: {
data: {
id: number, // the ban appeal id
status: 'open'|'close'|'lock'
}
}
RESPONSE: HTTP 201 CREATED
body: {
success: 1,
code: 'viewBanAppeal.success',
message: 'thank you'
}
网站注册 /api/user/signup
REQUEST: HTTP POST /api/user/signup
body: {
data: {
username: string,
password: string,
originEmail: string(email), // must match the originName below
originName: string // must have one of bf series game
},
encryptCaptcha: string(base64),
captcha: string // captcha required
}
RESPONSE: HTTP 201 CREATED
body: {
success: 1,
code: 'signup.needVerify',
message: 'Verify Email to join BFBan!'
}
email: 'Hello ${username} ... link: htttps://xxxxx/xxx?code=${code}'
网站注册验证 /api/user/signupVerify
REQUEST: HTTP GET /api/user/signupVerify
parameters: code: string,
RESPONSE: HTTP 201 CREATED
body: {
success: 1,
code:'signup.success',
message: 'Welcome to BFBan!'
}
网站登录 /api/user/signin
REQUEST: HTTP POST /api/user/signin
body: {
data: {
username: string,
password: string,
EXPIRES_IN?: number(ms) // bot/dev account required
},
encryptCaptcha: string(base64),
captcha: string // captcha required
}
RESPONSE: HTTP 200 OK
body: {
success: 1,
code: 'signin.success',
data: {
userinfo: {
username: string,
userId: number,
privilege: string[],
signWhen: string(ISODate),
expiresIn: number(ms)
},
token: string(jwttoken) // for x-access-token
},
message: 'Welcome back.'
}
绑定网站账号至origin账号 /api/user/bindOrigin
REQUEST: HTTP POST /api/user/bindOrigin
headers: x-access-token: {{access_token}} // login required, no blacklisted
body: {
data: {
originEmail: string,
originName: string
},
encryptCaptcha: string(base64),
captcha: string // captcha required
}
RESPONSE: HTTP 200 OK
body: {
success: 1,
code:'bindOrigin.needVerify',
message:'check your email to complete the verification.'
}
email: 'Hello xxx, you are now binding... click link below: htttps://xxx.xxx/xxx?code=${code}' // code for verification
绑定网站账号至origin账号验证 /api/user/bindOriginVerify
REQUEST: HTTP GET /api/user/bindOriginVerify
headers: x-access-token: {{access_token}} // login required
parameters: code: string
RESPONSE: HTTP 200 OK
body: {
success: 1,
code: 'bindOrigin.success',
message:'bind origin successfully.'
}
网站登出 /api/user/signout
REQUEST: HTTP POST /api/user/signout
headers: x-access-token: {{access_token}} // login required
RESPONSE: HTTP 200 OK
body: {
success: 1,
code: 'logout.success',
message: 'bye~'
}