| 接口 | /api/forum |
| --- | --- |
| method | GET |
| 参数 | 无|
| 返回值| 见下 |
此接口,目前来说无任何参数,不知filter[groups]参数是我研究有问题还是本身代码不起作用
返回值:
{
"data": {
"type": "forums",
"id": "1",
"attributes": {
"title": "Flarum 中文开发者社区",
"description": "Flarum 是一个优雅的轻论坛软件,简约界面回归社区本质。这里没有太多的条条框框规定,在这里你可以谈天说地,可以在最短的时间收集灵感,寻找有趣的东西。",
"baseUrl": "http://discuss.flarum.org.cn",
"basePath": "",
"debug": false,
"apiUrl": "http://discuss.flarum.org.cn/api",
"welcomeTitle": "欢迎访问 Flarum 中文开发者社区",
"welcomeMessage": "Flarum 是一个优雅的轻论坛软件,简约界面回归社区本质。这里没有太多的条条框框规定,在这里你可以谈天说地,可以在最短的时间收集灵感,寻找有趣的东西。",
"themePrimaryColor": "#4D698E",
"canView": true,
"canStartDiscussion": false,
"allowSignUp": true,
"defaultRoute": "/all",
"minPrimaryTags": "1",
"maxPrimaryTags": "1",
"minSecondaryTags": "0",
"maxSecondaryTags": "3"
},
"relationships": {
"groups": {
"data": [
{
"type": "groups",
"id": "1"
},
]
},
"tags": {
"data": [
{
"type": "tags",
"id": "1"
},
]
}
}
},
"included": [
{
"type": "groups",
"id": "1",
"attributes": {
"nameSingular": "Admin",
"namePlural": "Admins",
"color": "#B72A2A",
"icon": "wrench"
}
},
{
"type": "tags",
"id": "3",
"attributes": {
"name": "需求",
"description": "需要一些额外的功能,包括插件、扩展、语言包",
"slug": "features",
"color": "#E2C783",
"backgroundUrl": null,
"backgroundMode": null,
"iconUrl": null,
"discussionsCount": 2,
"position": 7,
"defaultSort": null,
"isChild": false,
"isHidden": false,
"lastTime": "2015-09-26T15:47:02+08:00",
"canStartDiscussion": true
},
"relationships": {
"lastDiscussion": {
"data": {
"type": "discussions",
"id": "110"
}
}
}
},
{
"type": "tags",
"id": "4",
"attributes": {
"name": "UX",
"description": "关于Flarum的用户体验和界面设计",
"slug": "ux",
"color": "#92E6D9",
"backgroundUrl": null,
"backgroundMode": null,
"iconUrl": null,
"discussionsCount": 0,
"position": 3,
"defaultSort": null,
"isChild": false,
"isHidden": false,
"lastTime": null,
"canStartDiscussion": true
}
},
{
"type": "tags",
"id": "5",
"attributes": {
"name": "插件扩展",
"description": "开发或者讨论扩展",
"slug": "extensions",
"color": "#9ACEC7",
"backgroundUrl": null,
"backgroundMode": null,
"iconUrl": null,
"discussionsCount": 18,
"position": 4,
"defaultSort": null,
"isChild": false,
"isHidden": false,
"lastTime": "2015-10-02T18:10:54+08:00",
"canStartDiscussion": true
},
"relationships": {
"lastDiscussion": {
"data": {
"type": "discussions",
"id": "47"
}
}
}
},
]
}
| 接口 | /api/forum |
| --- | --- |
| method | GET |
| 参数 | 见下|
| 返回值| 同上|
注:本接口需要设置access_token 放在header中如
Authorization: Token your_access_token
并且需要设置 Content-type: application/vnd.api+json
注:Flarum的APIs有一个小小的BUG,Content-type设置只需要包含 json 这个字符串均可以通过
{
"data": {
"attributes": {
"title": "Flarum 中文开发者社区",
"description": "Flarum 是一个优雅的轻论坛软件,简约界面回归社区本质。这里没有太多的条条框框规定,在这里你可以谈天说地,可以在最短的时间收集灵感,寻找有趣的东西。",
"baseUrl": "http://discuss.flarum.org.cn",
"basePath": "",
"debug": false,
"apiUrl": "http://discuss.flarum.org.cn/api",
"welcomeTitle": "欢迎访问 Flarum 中文开发者社区",
"welcomeMessage": "Flarum 是一个优雅的轻论坛软件,简约界面回归社区本质。这里没有太多的条条框框规定,在这里你可以谈天说地,可以在最短的时间收集灵感,寻找有趣的东西。",
"themePrimaryColor": "#4D698E",
"canView": true,
"canStartDiscussion": false,
"allowSignUp": true,
"defaultRoute": "/all",
"minPrimaryTags": "1",
"maxPrimaryTags": "1",
"minSecondaryTags": "0",
"maxSecondaryTags": "3"
}
}
我就不做坏事啦,你们可以通过api来更改论坛名称等信息