基础信息
- API 命名空间:
/bbpas/v1
- 当前版本:1.0.0
- 需要 bbPress 版本:2.6+
认证方式
所有 API 端点目前无需认证即可访问
端点列表
1. 测试连接
GET /bbpas/v1/test
响应示例
{
"success": true,
"message": "Connection successful",
"version": "1.0.0",
"bbpress_version": "2.6.4",
"api_namespace": "bbpas/v1"
}
2. 论坛相关
获取论坛列表
GET /bbpas/v1/forums
参数:
parent
(可选): 父论坛 ID,0 表示根论坛per_page
(默认-1): 每页数量 (1-100)page
(默认 1): 页码
获取单个论坛详情
GET /bbpas/v1/forum/{id}
3. 话题相关
获取话题列表
GET /bbpas/v1/topics
参数:
forum_id
(可选): 按论坛 ID 过滤per_page
(默认 10): 每页数量 (1-100)page
(默认 1): 页码orderby
(默认 activity): 排序字段 (date/title/activity/popularity)order
(默认 DESC): 排序方向 (ASC/DESC)
获取话题详情
GET /bbpas/v1/topic/{id}
参数:
with_replies
(默认 false): 是否包含回复
4. 回复相关
获取回复列表
GET /bbpas/v1/replies
参数:
topic_id
(必填): 话题 IDper_page
(默认 20): 每页数量 (1-100)page
(默认 1): 页码order
(默认 ASC): 排序方向
获取单个回复
GET /bbpas/v1/reply/{id}
5. 用户相关
获取用户活动
GET /bbpas/v1/user/{id}/activity
参数:
type
(默认 all): 活动类型 (topics/replies/all)per_page
(默认 10): 每页数量 (1-50)
6. 搜索
GET /bbpas/v1/search
参数:
query
(必填): 搜索关键词type
(默认 all): 搜索类型 (forum/topic/reply/all)per_page
(默认 10): 每页数量 (1-50)page
(默认 1): 页码
7. 统计
GET /bbpas/v1/stats
响应示例:
{
"forums": {
"total": 15,
"active": 12
},
"topics": {
"total": 2450,
"open": 2300,
"closed": 150
},
"replies": {
"total": 15800
},
"users": {
"total": 850
}
}