https://dzx35.xcxgy.cn/plugin.php?id=domi_api&mod=threads
https://dzx35.xcxgy.cn/domi_api/threads
# 将 /domi_api/xxx 重写到 plugin.php?id=domi_api&mod=xxx
location /domi_api/ {
rewrite ^/domi_api/(\w+)$ /plugin.php?id=domi_api&mod=$1&$args last;
}
POST /login
Authorization: Bearer {token}
{
"code": 200, // HTTP状态码
"message": "success", // 状态消息
"data": {}, // 响应数据
"timestamp": 1629456789 // 响应时间戳
}
GET /forums
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
fid | string | 否 | 版块ID,可以指定多个,用逗号分隔,如"1,2,3" |
{
"code": 200,
"message": "success",
"data": {
"list": [
{
"fid": 1,
"type": "forum",
"name": "版块名称",
"status": 1,
"displayorder": 0,
"fup": 0,
"threads": 100,
"posts": 500,
"todayposts": 10,
"description": "版块描述",
"icon": "图标URL",
"banner": "横幅URL",
"lastpost": {
"tid": 123,
"subject": "最新帖子标题",
"dateline": 1629456789,
"author": "作者"
},
"moderators": ["版主1", "版主2"],
"threadtypes": {
"1": "类型1",
"2": "类型2"
},
"perms": {
"view": [],
"post": [],
"reply": [],
"getattach": [],
"postattach": []
}
}
]
},
"timestamp": 1629456789
}
GET /forum_detail
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
fid | int/string | 是 | 版块ID,可以指定多个,用逗号分隔,如"1,2,3" |
{
"code": 200,
"message": "success",
"data": {
"fid": 1,
"type": "forum",
"name": "版块名称",
"status": 1,
"displayorder": 0,
"fup": 0,
"threads": 100,
"posts": 500,
"todayposts": 10,
"description": "版块描述",
"icon": "图标URL",
"banner": "横幅URL",
"rules": "版块规则",
"lastpost": {
"tid": 123,
"subject": "最新帖子标题",
"dateline": 1629456789,
"author": "作者"
},
"moderators": ["版主1", "版主2"],
"threadtypes": {
"1": "类型1",
"2": "类型2"
},
"perms": {
"view": [],
"post": [],
"reply": [],
"getattach": [],
"postattach": []
},
"extra": {
"commentitem": [],
"redirect": "",
"supe_pushsetting": "",
"modrecommend": {},
"picstyle": 0,
"seotitle": "",
"keywords": "",
"seodescription": ""
}
},
"timestamp": 1629456789
}
{
"code": 200,
"message": "success",
"data": {
"list": [
{
// 版块1信息
},
{
// 版块2信息
}
]
},
"timestamp": 1629456789
}
GET /threads
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
fid | int/string | 否 | 版块ID,可以指定多个,用逗号分隔,如"1,2,3" |
page | int | 否 | 页码,默认为1 |
perpage | int | 否 | 每页数量,默认为20,最大100 |
orderby | string | 否 | 排序方式:dateline(默认,发帖时间)、lastpost(最后回复时间)、views(查看次数)、replies(回复数)、heats(热度) |
filter | string | 否 | 筛选方式:digest(精华)、hot(热门)、recommend(推荐)、attachment(有附件的)、follow(我关注的) |
keyword | string | 否 | 关键词搜索 |
digest | int | 否 | 是否只看精华帖,1为是 |
authorid | int | 否 | 作者用户ID |
{
"code": 200,
"message": "success",
"data": {
"threads": [
{
"tid": 123,
"fid": 1,
"author": "作者",
"authorid": 456,
"subject": "帖子标题",
"dateline": 1629456789,
"lastpost": 1629457000,
"lastposter": "最后回复者",
"views": 100,
"replies": 10,
"digest": 0,
"attachment": 0,
"recommend": 5,
"heats": 8,
"cover": "封面图URL",
"displayorder": 0,
"closed": 0,
"icon": "主题图标",
"typeid": 0,
"is_read": false
}
],
"count": 100,
"page": 1,
"perpage": 20
},
"timestamp": 1629456789
}
GET /thread_detail
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
tid | int | 是 | 帖子ID |
{
"code": 200,
"message": "success",
"data": {
"thread": {
"tid": 123,
"fid": 1,
"author": "作者",
"authorid": 456,
"subject": "帖子标题",
"dateline": 1629456789,
"message": "帖子内容",
"views": 100,
"replies": 10,
"digest": 0,
"attachment": 1,
"typeid": 0,
"closed": 0,
"highlight": "",
"displayorder": 0,
"recommend": 5,
"heats": 8,
"status": 0,
"readperm": 0,
"price": 0,
"is_favorite": false,
"attachments": [
{
"aid": 1,
"tid": 123,
"uid": 456,
"filename": "文件名",
"filesize": 12345,
"attachment": "a/abc.jpg",
"remote": 0,
"isimage": 1,
"width": 800,
"thumb": 1,
"url": "附件URL",
"dateline": 1629456789,
"description": "附件描述"
}
]
},
"posts": [
{
"pid": 789,
"tid": 123,
"author": "回复者",
"authorid": 789,
"message": "回复内容",
"dateline": 1629457000,
"attachment": 0,
"attachments": [],
"position": 1,
"anonymous": 0,
"status": 0,
"rate": 0,
"comment": 0,
"is_reply": false,
"is_liked": false,
"likes": 0
}
],
"forum": {
"fid": 1,
"name": "版块名称",
"threads": 100,
"posts": 500
},
"count": 10,
"page": 1,
"perpage": 20
},
"timestamp": 1629456789
}
GET /posts
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
tid | int | 是 | 帖子ID |
page | int | 否 | 页码,默认为1 |
perpage | int | 否 | 每页数量,默认为20,最大100 |
ordertype | string | 否 | 回帖排序方式:desc(默认,从新到旧)、asc(从旧到新) |
authorid | int | 否 | 只看某个作者的回复 |
pid | int | 否 | 特定回复ID |
{
"code": 200,
"message": "success",
"data": {
"posts": [
{
"pid": 789,
"tid": 123,
"author": "回复者",
"authorid": 789,
"message": "回复内容",
"dateline": 1629457000,
"attachment": 0,
"attachments": [],
"position": 1,
"anonymous": 0,
"status": 0,
"rate": 0,
"comment": 0,
"is_reply": false,
"is_liked": false,
"likes": 0
}
],
"count": 10,
"page": 1,
"perpage": 20
},
"timestamp": 1629456789
}
POST /threads
POST /new_thread
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
fid | int | 是 | 版块ID |
subject | string | 是 | 帖子标题 |
message | string | 是 | 帖子内容 |
attachments | array | 否 | 附件ID数组 |
typeid | int | 否 | 主题分类ID |
readperm | int | 否 | 阅读权限,0为无限制 |
price | int | 否 | 售价,0为免费 |
allownoticeauthor | int | 否 | 是否允许回复通知作者,1为允许 |
tags | string | 否 | 标签,多个标签用逗号分隔 |
anonymous | int | 否 | 是否匿名发布,1为匿名 |
ishtml | int | 否 | 是否允许HTML,1为允许 |
{
"code": 200,
"message": "success",
"data": {
"tid": 123,
"pid": 456,
"subject": "帖子标题",
"url": "帖子URL"
},
"timestamp": 1629456789
}
POST /posts
POST /reply
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
tid | int | 是 | 帖子ID |
message | string | 是 | 回复内容 |
attachments | array | 否 | 附件ID数组 |
replysubmit | int | 否 | 确认提交,1为确认 |
reppid | int | 否 | 引用回复的ID |
reppost | int | 否 | 是否引用回复,1为引用 |
noticetrimstr | string | 否 | 通知修剪的内容 |
noticeauthor | int | 否 | 是否通知作者,1为通知 |
usesig | int | 否 | 是否使用签名,1为使用 |
htmlon | int | 否 | 是否允许HTML,1为允许 |
anonymous | int | 否 | 是否匿名发布,1为匿名 |
{
"code": 200,
"message": "success",
"data": {
"pid": 789,
"tid": 123,
"position": 12,
"url": "回复URL"
},
"timestamp": 1629456789
}
POST /favorite
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
tid | int | 是 | 帖子ID |
action | string | 否 | 操作类型:add(添加,默认)、remove(删除) |
{
"code": 200,
"message": "success",
"data": {
"result": true
},
"timestamp": 1629456789
}
POST /recommend
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
tid | int | 是 | 帖子ID |
{
"code": 200,
"message": "success",
"data": {
"result": true
},
"timestamp": 1629456789
}
POST /upload
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
fid | int | 是 | 版块ID |
uid | int | 是 | 用户ID |
file | file | 是 | 上传文件 |
{
"code": 200,
"message": "success",
"data": {
"aid": 1,
"filename": "文件名",
"filesize": 12345,
"attachment": "a/abc.jpg",
"isimage": 1,
"width": 800,
"url": "附件URL"
},
"timestamp": 1629456789
}
POST /login
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
username | string | 是 | 用户名 |
password | string | 是 | 密码 |
questionid | int | 否 | 安全提问ID |
answer | string | 否 | 安全提问答案 |
cookietime | int | 否 | Cookie有效期,单位秒,默认2592000(30天) |
{
"code": 200,
"message": "success",
"data": {
"token": "JWT令牌",
"user": {
"uid": 123,
"username": "用户名",
"email": "邮箱",
"groupid": 10,
"groupname": "用户组名称",
"credits": 100,
"regdate": 1629400000,
"lastlogin": 1629456789,
"avatar": "头像URL",
"status": 1,
"mobile": "手机号",
"stats": {
"posts": 50,
"threads": 10,
"digestposts": 5,
"credits1": 100,
"credits2": 200,
"credits3": 0,
"credits4": 0,
"credits5": 0,
"credits6": 0,
"credits7": 0,
"credits8": 0,
"oltime": 100,
"todayattachs": 0,
"todayattachsize": 0
},
"profile": {
"realname": "真实姓名",
"gender": 1,
"birthyear": 1990,
"birthmonth": 1,
"birthday": 1,
"constellation": "",
"zodiac": "",
"telephone": "",
"mobile": "",
"idcardtype": "",
"idcard": "",
"address": "",
"zipcode": "",
"nationality": "",
"birthprovince": "",
"birthcity": "",
"resideprovince": "",
"residecity": "",
"residedist": "",
"residecommunity": "",
"residesuite": "",
"graduateschool": "",
"education": "",
"company": "",
"occupation": "",
"position": "",
"revenue": "",
"affectivestatus": "",
"lookingfor": "",
"bloodtype": "",
"height": "",
"weight": "",
"alipay": "",
"icq": "",
"qq": "",
"yahoo": "",
"msn": "",
"taobao": "",
"site": "",
"bio": "个人简介",
"interest": "兴趣爱好",
"field1": "",
"field2": "",
"field3": "",
"field4": "",
"field5": "",
"field6": "",
"field7": "",
"field8": ""
}
}
},
"timestamp": 1629456789
}
POST /register
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
username | string | 是 | 用户名,3-15个字符 |
password | string | 是 | 密码,6-20个字符 |
string | 是 | 邮箱 | |
mobile | string | 否 | 手机号 |
questionid | int | 否 | 安全提问ID |
answer | string | 否 | 安全提问答案 |
gender | int | 否 | 性别:1(男)、2(女) |
birthyear | int | 否 | 出生年,如1990 |
birthmonth | int | 否 | 出生月,1-12 |
birthday | int | 否 | 出生日,1-31 |
invitecode | string | 否 | 邀请码 |
regsubmit | int | 否 | 确认提交,1为确认 |
{
"code": 200,
"message": "success",
"data": {
"uid": 123,
"username": "用户名",
"token": "JWT令牌",
"groupid": 10,
"regdate": 1629456789,
"email": "邮箱",
"mobile": "手机号"
},
"timestamp": 1629456789
}
POST /refresh
{
"code": 200,
"message": "success",
"data": {
"token": "新JWT令牌",
"uid": 123,
"username": "用户名",
"exp": 1632048789 // 过期时间戳
},
"timestamp": 1629456789
}
GET /users_info
GET /user_info
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
uid | int | 否 | 用户ID,不填则获取当前登录用户信息 |
username | string | 否 | 用户名,与uid二选一 |
fields | string | 否 | 要获取的字段,多个字段用逗号分隔,如"profile,stats" |
{
"code": 200,
"message": "success",
"data": {
"user": {
"uid": 123,
"username": "用户名",
"email": "邮箱",
"groupid": 10,
"groupname": "用户组名称",
"credits": 100,
"regdate": 1629400000,
"lastlogin": 1629456789,
"avatar": "头像URL",
"status": 1,
"mobile": "手机号",
"stats": {
"posts": 50,
"threads": 10,
"digestposts": 5,
"credits1": 100,
"credits2": 200,
"credits3": 0,
"credits4": 0,
"credits5": 0,
"credits6": 0,
"credits7": 0,
"credits8": 0,
"oltime": 100
},
"profile": {
"realname": "真实姓名",
"gender": 1,
"birthyear": 1990,
"birthmonth": 1,
"birthday": 1,
"bio": "个人简介",
"interest": "兴趣爱好"
},
"following": 20, // 关注的人数
"follower": 50, // 粉丝数
"friends": 30 // 好友数
}
},
"timestamp": 1629456789
}
POST /users_info
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
uid | int | 是 | 用户ID |
fields | string | 否 | 要获取的字段,多个字段用逗号分隔,如"profile,stats" |
POST /users_update
POST /update_user
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
profile[bio] | string | 否 | 个人简介 |
profile[realname] | string | 否 | 真实姓名 |
profile[gender] | int | 否 | 性别:1(男)、2(女) |
profile[birthyear] | int | 否 | 出生年 |
profile[birthmonth] | int | 否 | 出生月 |
profile[birthday] | int | 否 | 出生日 |
profile[site] | string | 否 | 个人网站 |
profile[address] | string | 否 | 地址 |
profile[mobile] | string | 否 | 手机号码 |
profile[qq] | string | 否 | QQ号码 |
profile[icq] | string | 否 | ICQ号码 |
profile[yahoo] | string | 否 | Yahoo帐号 |
profile[msn] | string | 否 | MSN帐号 |
profile[taobao] | string | 否 | 淘宝帐号 |
profile[alipay] | string | 否 | 支付宝帐号 |
profile[interest] | string | 否 | 兴趣爱好 |
profile[bloodtype] | string | 否 | 血型 |
profile[height] | string | 否 | 身高(cm) |
profile[weight] | string | 否 | 体重(kg) |
profile[company] | string | 否 | 公司 |
profile[occupation] | string | 否 | 职业 |
profile[position] | string | 否 | 职位 |
profile[education] | string | 否 | 学历 |
profile[graduateschool] | string | 否 | 毕业学校 |
avatar | file | 否 | 头像文件 |
string | 否 | 邮箱 | |
password | string | 否 | 新密码 |
oldpassword | string | 否 | 旧密码,更改密码时必填 |
questionid | int | 否 | 安全提问ID |
answer | string | 否 | 安全提问答案 |
{
"code": 200,
"message": "success",
"data": {
"result": true,
"updated_fields": ["profile.bio", "profile.mobile", "email"]
},
"timestamp": 1629456789
}
GET /users
GET /user_list
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
page | int | 否 | 页码,默认为1 |
perpage | int | 否 | 每页数量,默认为20,最大100 |
orderby | string | 否 | 排序方式:credits(积分)、regdate(注册时间,默认)、posts(发帖数)、lastvisit(最后访问时间) |
groupid | int | 否 | 用户组ID |
keyword | string | 否 | 搜索关键词,搜索用户名 |
{
"code": 200,
"message": "success",
"data": {
"users": [
{
"uid": 123,
"username": "用户名",
"credits": 100,
"posts": 50,
"regdate": 1629400000,
"lastvisit": 1629456000,
"avatar": "头像URL",
"groupid": 10,
"groupname": "用户组名称",
"gender": 1,
"bio": "个人简介"
}
],
"count": 100,
"page": 1,
"perpage": 20
},
"timestamp": 1629456789
}
POST /notifications
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
page | int | 否 | 页码,默认为1 |
perpage | int | 否 | 每页数量,默认为20,最大100 |
type | string | 否 | 通知类型:system(系统)、friend(好友)、post(帖子)、follow(关注)、all(所有,默认) |
filter | string | 否 | 筛选方式:new(未读)、read(已读)、all(全部,默认) |
dateline | int | 否 | 时间戳,获取此时间戳之前的通知 |
{
"code": 200,
"message": "success",
"data": {
"notifications": [
{
"id": 123,
"uid": 456,
"type": "post",
"new": 1,
"authorid": 789,
"author": "通知发送者",
"note": "通知内容",
"dateline": 1629456789,
"from_id": 100,
"from_idtype": "tid",
"from_title": "相关帖子标题",
"from_url": "相关链接",
"avatar": "发送者头像URL",
"extra": {
"fid": 1,
"subject": "帖子标题",
"content": "回复内容摘要"
}
}
],
"count": {
"total": 10,
"new": 5,
"read": 5
},
"page": 1,
"perpage": 20
},
"timestamp": 1629456789
}
POST /notifications_count
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
filter | string | 否 | 筛选方式:new(未读)、read(已读)、all(全部,默认) |
{
"code": 200,
"message": "success",
"data": {
"count": {
"total": 10,
"system": 1,
"friend": 2,
"post": 5,
"follow": 2,
"new": {
"total": 5,
"system": 1,
"friend": 1,
"post": 2,
"follow": 1
}
}
},
"timestamp": 1629456789
}
POST /notifications_read
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
id | int | 否 | 通知ID,不填则标记所有通知为已读 |
type | string | 否 | 通知类型,标记指定类型的通知为已读:system(系统)、friend(好友)、post(帖子)、follow(关注) |
ids | string | 否 | 多个通知ID,用逗号分隔,如"1,2,3" |
{
"code": 200,
"message": "success",
"data": {
"result": true,
"affected": 5 // 受影响的通知数量
},
"timestamp": 1629456789
}
POST /notifications_ignore
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
type | string | 否 | 通知类型,忽略指定类型的所有通知:system(系统)、friend(好友)、post(帖子)、follow(关注)、all(所有,默认) |
{
"code": 200,
"message": "success",
"data": {
"result": true,
"affected": 10 // 受影响的通知数量
},
"timestamp": 1629456789
}
POST /notifications_delete
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
id | int | 否 | 通知ID |
type | string | 否 | 通知类型,删除指定类型的所有通知 |
ids | string | 否 | 多个通知ID,用逗号分隔,如"1,2,3" |
filter | string | 否 | 筛选方式:new(删除未读)、read(删除已读)、all(删除全部) |
{
"code": 200,
"message": "success",
"data": {
"result": true,
"affected": 1 // 受影响的通知数量
},
"timestamp": 1629456789
}
POST /friends
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
page | int | 否 | 页码,默认为1 |
perpage | int | 否 | 每页数量,默认为20,最大100 |
gid | int | 否 | 好友分组ID,不填则获取所有好友 |
keyword | string | 否 | 搜索关键词,搜索好友用户名 |
orderby | string | 否 | 排序方式:dateline(添加时间,默认)、username(用户名) |
{
"code": 200,
"message": "success",
"data": {
"friends": [
{
"uid": 123,
"username": "好友用户名",
"gid": 1,
"groupname": "好友分组名称",
"note": "备注",
"dateline": 1629456789,
"avatar": "头像URL",
"is_online": true,
"lastactivity": 1629456000,
"gender": 1,
"posts": 50,
"credits": 100,
"groupid": 10,
"groupname": "用户组名称",
"is_mutual": true,
"follow_mutual": 1
}
],
"groups": [
{
"gid": 1,
"name": "分组名称",
"count": 5
}
],
"count": 10,
"page": 1,
"perpage": 20
},
"timestamp": 1629456789
}
GET /friend_groups
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
name | string | 否 | 搜索分组名称 |
{
"code": 200,
"message": "success",
"data": {
"groups": [
{
"gid": 1,
"name": "分组名称",
"count": 5,
"displayorder": 0
}
],
"count": 3,
"default_group": {
"gid": 0,
"name": "默认分组",
"count": 10
}
},
"timestamp": 1629456789
}
POST /friend_add
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
uid | int | 是 | 好友用户ID |
message | string | 否 | 验证消息 |
gid | int | 否 | 好友分组ID,默认为0(未分组) |
note | string | 否 | 好友备注 |
add_follow | int | 否 | 是否同时关注,1为关注 |
{
"code": 200,
"message": "success",
"data": {
"result": true,
"status": "pending", // pending(等待验证)、success(添加成功)、exists(已经是好友)
"message": "请求已发送,等待对方验证"
},
"timestamp": 1629456789
}
POST /friend_delete
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
uid | int | 是 | 好友用户ID |
uids | string | 否 | 多个好友用户ID,用逗号分隔,如"1,2,3" |
gid | int | 否 | 好友分组ID,删除指定分组的所有好友 |
{
"code": 200,
"message": "success",
"data": {
"result": true,
"affected": 1, // 受影响的好友数量
"message": "好友删除成功"
},
"timestamp": 1629456789
}
POST /friend_check
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
uid | int | 是 | 用户ID |
uids | string | 否 | 多个用户ID,用逗号分隔,如"1,2,3" |
{
"code": 200,
"message": "success",
"data": {
"is_friend": true,
"status": "mutual", // mutual(互为好友)、pending(等待验证)、pendingFrom(对方等待我验证)、none(非好友)
"gid": 1,
"groupname": "分组名称",
"note": "备注",
"dateline": 1629456789,
"is_following": true, // 是否关注了该用户
"is_followed": true // 是否被该用户关注
},
"timestamp": 1629456789
}
{
"code": 200,
"message": "success",
"data": {
"friends": {
"1": {
"is_friend": true,
"status": "mutual",
"gid": 1
},
"2": {
"is_friend": false,
"status": "none",
"gid": 0
}
}
},
"timestamp": 1629456789
}
GET /friend_requests
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
page | int | 否 | 页码,默认为1 |
perpage | int | 否 | 每页数量,默认为20,最大100 |
direction | string | 否 | 请求方向:received(收到的请求,默认)、sent(发出的请求) |
{
"code": 200,
"message": "success",
"data": {
"requests": [
{
"id": 123,
"uid": 456,
"username": "请求者用户名",
"message": "验证消息",
"dateline": 1629456789,
"avatar": "头像URL",
"status": "pending", // pending(待处理)、accepted(已接受)、declined(已拒绝)
"gender": 1,
"posts": 50,
"credits": 100,
"groupid": 10,
"groupname": "用户组名称"
}
],
"count": {
"total": 3,
"pending": 2,
"accepted": 1,
"declined": 0
},
"page": 1,
"perpage": 20
},
"timestamp": 1629456789
}
POST /friend_response
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
id | int | 是 | 请求ID |
action | string | 是 | 操作:accept(接受)、decline(拒绝)、ignore(忽略) |
gid | int | 否 | 好友分组ID,默认为0(未分组) |
note | string | 否 | 好友备注 |
add_follow | int | 否 | 是否同时关注,1为关注 |
{
"code": 200,
"message": "success",
"data": {
"result": true,
"status": "accepted", // accepted(已接受)、declined(已拒绝)、ignored(已忽略)
"message": "已接受好友请求"
},
"timestamp": 1629456789
}
POST /friend_group
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
uid | int | 是 | 好友用户ID |
gid | int | 是 | 好友分组ID |
uids | string | 否 | 多个好友用户ID,用逗号分隔,如"1,2,3" |
create_group | string | 否 | 创建新分组并移动到该分组,提供分组名称 |
{
"code": 200,
"message": "success",
"data": {
"result": true,
"affected": 1, // 受影响的好友数量
"new_gid": 0 // 如果创建了新分组,返回新分组ID
},
"timestamp": 1629456789
}
POST /friend_group_create
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
name | string | 是 | 分组名称 |
displayorder | int | 否 | 显示顺序,默认为0 |
{
"code": 200,
"message": "success",
"data": {
"result": true,
"gid": 5, // 新创建的分组ID
"name": "分组名称"
},
"timestamp": 1629456789
}
POST /friend_group_rename
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
gid | int | 是 | 分组ID |
name | string | 是 | 新分组名称 |
{
"code": 200,
"message": "success",
"data": {
"result": true,
"gid": 5,
"name": "新分组名称"
},
"timestamp": 1629456789
}
POST /friend_group_delete
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
gid | int | 是 | 分组ID |
tgid | int | 否 | 目标分组ID,将该分组的好友移动到目标分组,默认为0(未分组) |
{
"code": 200,
"message": "success",
"data": {
"result": true,
"affected": 5 // 受影响的好友数量
},
"timestamp": 1629456789
}
POST /friend_note
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
uid | int | 是 | 好友用户ID |
note | string | 是 | 好友备注 |
{
"code": 200,
"message": "success",
"data": {
"result": true,
"uid": 123,
"note": "新备注"
},
"timestamp": 1629456789
}
POST /points_log
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
page | int | 否 | 页码,默认为1 |
perpage | int | 否 | 每页数量,默认为20,最大100 |
{
"code": 200,
"message": "success",
"data": {
"logs": [
{
"id": 123,
"uid": 456,
"operation": "操作类型",
"relatedid": 0,
"dateline": 1629456789,
"extcredits1": 0,
"extcredits2": 10,
"extcredits3": 0,
"extcredits4": 0,
"extcredits5": 0,
"extcredits6": 0,
"extcredits7": 0,
"extcredits8": 0
}
],
"count": 10,
"page": 1,
"perpage": 20
},
"timestamp": 1629456789
}
GET /user_threads
POST /user_threads
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
uid | int | 否 | 用户ID,不填则获取当前登录用户的帖子 |
page | int | 否 | 页码,默认为1 |
perpage | int | 否 | 每页数量,默认为20,最大100 |
{
"code": 200,
"message": "success",
"data": {
"threads": [
{
"tid": 123,
"fid": 1,
"author": "作者",
"authorid": 456,
"subject": "帖子标题",
"dateline": 1629456789,
"lastpost": 1629457000,
"lastposter": "最后回复者",
"views": 100,
"replies": 10,
"digest": 0,
"attachment": 0
}
],
"count": 10,
"page": 1,
"perpage": 20
},
"timestamp": 1629456789
}
POST /user_favorites
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
page | int | 否 | 页码,默认为1 |
perpage | int | 否 | 每页数量,默认为20,最大100 |
{
"code": 200,
"message": "success",
"data": {
"favorites": [
{
"tid": 123,
"fid": 1,
"author": "作者",
"authorid": 456,
"subject": "帖子标题",
"dateline": 1629456789,
"lastpost": 1629457000,
"lastposter": "最后回复者",
"views": 100,
"replies": 10,
"digest": 0,
"attachment": 0
}
],
"count": 5,
"page": 1,
"perpage": 20
},
"timestamp": 1629456789
}
GET /site_info
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
fields | string | 否 | 需要获取的字段,多个字段用逗号分隔,如"bbname,sitename,stats" |
{
"code": 200,
"message": "success",
"data": {
"site_name": "站点名称",
"site_url": "站点URL",
"version": "Discuz版本",
"charset": "站点编码",
"timezone": "站点时区",
"lang": "站点语言",
"bbclosed": 0, // 是否关闭站点
"announcement": "站点公告",
"stats": {
"totalmembers": 1000,
"totalposts": 5000,
"totalthreads": 1000,
"activeusers": 100,
"online": {
"total": 120,
"members": 50,
"guests": 70
}
},
"credits": {
"extcredits1": {
"title": "金钱",
"unit": "元"
},
"extcredits2": {
"title": "积分",
"unit": "点"
}
},
"plugin_version": "多米API版本号"
},
"timestamp": 1629456789
}
GET /setting
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
fields | string | 否 | 需要获取的设置,多个设置用逗号分隔,如"register,upload,credits" |
{
"code": 200,
"message": "success",
"data": {
"site_name": "站点名称",
"site_url": "站点URL",
"register": {
"status": 1,
"allow_register": true,
"register_validate": 0,
"register_invite": 0,
"invite_code": 0,
"invite_buy": 0,
"invite_price": 0
},
"upload": {
"allow_upload": true,
"allow_imgsize": 10000, // 允许的图片最大尺寸(KB)
"allow_filesize": 5000, // 允许的文件最大尺寸(KB)
"allow_exts": ["jpg", "jpeg", "gif", "png", "zip", "rar", "pdf"]
},
"credit_names": {
"1": {
"title": "金钱",
"unit": "元"
},
"2": {
"title": "积分",
"unit": "点"
}
},
"app_settings": {
"allow_anonymous": true,
"allow_search": true,
"show_online": true,
"allow_share": true
}
},
"timestamp": 1629456789
}