摘要:
Using the API
Every Flarum forum exposes a publicly-accessible JSON API that can read and write forum data. It conforms to the JSON-API 1.0 specification.
AuthenticationThe API uses token-based authentication. Some endpoints do not require authentication. You can retrieve a token from the /api/token endpoint:
POST /api/token HTTP/1.1 { "identification": "Toby", "password": "pass7word" } HTTP/1.1 200 OK { "token": "YACub2KLfe8mfmHPcUKtt6t2SMJOGPXnZbqhc3nX", "userId": "1" }
You can then pass the token in an Authorization header in subsequent requests:
GET /api/forum HTTP/1.1 Authorization: Token YACub2KLfe8mfmHPcUKtt6t2SMJOGPXnZbqhc3nX
Forum
GET /api/forum - get information about the forum, including groups and tags PATCH /api/forum - update forum config
Discussions
GET /api/discussions - get all discussions (sort is -time by default) filter[q] - filter by username/gambits POST /api/discussions - create a new discussion GET /api/discussions/:id - get a discussion by ID PATCH /api/discussions/:id - update a discussion DELETE /api/discussions/:id - delete a discussion
Posts
GET /api/posts - get all posts filter[discussion] - filter by discussion ID filter[user] - filter by user ID filter[number] - filter by number (position within the discussion) filter[type] - filter by post type POST /api/posts - create a new post GET /api/posts/:id - get a post by ID PATCH /api/posts/:id - update a post DELETE /api/posts/:id - delete a post
Users
GET /api/users - get all users filter[q] - filter by username/gambits POST /api/users - register a new user GET /api/users/:idOrUsername - get a user by ID or username PATCH /api/users/:id - update a user DELETE /api/users/:id - delete a user POST /api/users/:id/avatar - upload a user avatar DELETE /api/users/:id/avatar - delete a user avatar
Groups
GET /api/groups - get all groups POST /api/groups - create a new group PATCH /api/groups/:id - update a group DELETE /api/groups/:id - delete a group
Notifications
GET /api/notifications - get all notifications PATCH /api/notifications/:id - mark a notification as read
Tags
POST /api/tags - create a new tag PATCH /api/tags/:id - update a tag DELETE /api/tags/:id - delete a tag
文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。
转载请注明本文地址:https://www.ucloud.cn/yun/21519.html
摘要:前言本教程面向新人撰写,无需任何编程语言基础,教你如何搭建一个轻论坛。按照本教程的操作方法,您可以顺利完成搭建并将论坛上线。禁用缓存,存在小的缓存,论坛内的刷新页面并不会刷新内容,而是返回之前的某个时间段,其原因为缓存问题。 前言 本教程面向新人撰写,无需任何编程语言基础,教你如何搭建一个轻论坛。您可以访问 https://flarum.org.cn/ 来了解该更多相关信息。 按照本教...
摘要:前言本教程面向新人撰写,无需任何编程语言基础,教你如何搭建一个轻论坛。按照本教程的操作方法,您可以顺利完成搭建并将论坛上线。禁用缓存,存在小的缓存,论坛内的刷新页面并不会刷新内容,而是返回之前的某个时间段,其原因为缓存问题。 前言 本教程面向新人撰写,无需任何编程语言基础,教你如何搭建一个轻论坛。您可以访问 https://flarum.org.cn/ 来了解该更多相关信息。 按照本教...
摘要:原文作者译文强强联合作者加盟译者是一个快速轻量级论坛软件,它的开发者是一名德国的天才。将加入我们,并成为的核心成员,并负责和相关的工作。的加盟将使我们能发挥我们的长处,共同完成一个惊人的论坛软件。 原文:FluxBB Joins Forces With Flarum 作者:Toby Zerner 译文:强强联合:FluxBB 作者加盟 Flarum 译者:justjavac Flu...
摘要:堡塔网站加速是宝塔面板为用户开发的一款网站加速插件网站加速插件,基于页面缓存的网站加速插件,支持常见的众多建站程序加速。那么有了堡塔网站加速之后,我们可以使用更多的加速方式,提升网站打开速度。实测加速性能远强于,以下加速效果来自环境。堡塔网站加速是宝塔面板为用户开发的一款网站加速插件,基于页面缓存的网站加速插件,支持常见的众多建站程序加速。其原理是在http协议层缓存动态页面,对实时信息及已...
阅读 2855·2021-11-24 09:39
阅读 3084·2021-11-19 10:00
阅读 1506·2021-10-27 14:17
阅读 1788·2021-10-14 09:43
阅读 939·2021-09-03 10:30
阅读 3399·2019-08-30 15:54
阅读 2700·2019-08-30 13:05
阅读 1971·2019-08-30 11:02