摘要:
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
文章版權歸作者所有,未經允許請勿轉載,若此文章存在違規行為,您可以聯系管理員刪除。
轉載請注明本文地址:http://specialneedsforspecialkids.com/yun/21519.html
摘要:前言本教程面向新人撰寫,無需任何編程語言基礎,教你如何搭建一個輕論壇。按照本教程的操作方法,您可以順利完成搭建并將論壇上線。禁用緩存,存在小的緩存,論壇內的刷新頁面并不會刷新內容,而是返回之前的某個時間段,其原因為緩存問題。 前言 本教程面向新人撰寫,無需任何編程語言基礎,教你如何搭建一個輕論壇。您可以訪問 https://flarum.org.cn/ 來了解該更多相關信息。 按照本教...
摘要:前言本教程面向新人撰寫,無需任何編程語言基礎,教你如何搭建一個輕論壇。按照本教程的操作方法,您可以順利完成搭建并將論壇上線。禁用緩存,存在小的緩存,論壇內的刷新頁面并不會刷新內容,而是返回之前的某個時間段,其原因為緩存問題。 前言 本教程面向新人撰寫,無需任何編程語言基礎,教你如何搭建一個輕論壇。您可以訪問 https://flarum.org.cn/ 來了解該更多相關信息。 按照本教...
摘要:原文作者譯文強強聯合作者加盟譯者是一個快速輕量級論壇軟件,它的開發者是一名德國的天才。將加入我們,并成為的核心成員,并負責和相關的工作。的加盟將使我們能發揮我們的長處,共同完成一個驚人的論壇軟件。 原文:FluxBB Joins Forces With Flarum 作者:Toby Zerner 譯文:強強聯合:FluxBB 作者加盟 Flarum 譯者:justjavac Flu...
摘要:堡塔網站加速是寶塔面板為用戶開發的一款網站加速插件網站加速插件,基于頁面緩存的網站加速插件,支持常見的眾多建站程序加速。那么有了堡塔網站加速之后,我們可以使用更多的加速方式,提升網站打開速度。實測加速性能遠強于,以下加速效果來自環境。堡塔網站加速是寶塔面板為用戶開發的一款網站加速插件,基于頁面緩存的網站加速插件,支持常見的眾多建站程序加速。其原理是在http協議層緩存動態頁面,對實時信息及已...
閱讀 2887·2021-11-24 09:39
閱讀 3140·2021-11-19 10:00
閱讀 1542·2021-10-27 14:17
閱讀 1816·2021-10-14 09:43
閱讀 965·2021-09-03 10:30
閱讀 3419·2019-08-30 15:54
閱讀 2740·2019-08-30 13:05
閱讀 2016·2019-08-30 11:02