This document is still under development...
Base address
https://forum.hamcq.cn
Authentication
The API uses a token-based authentication mechanism.
Obtain Token
POST /api/token
{
"identification": "Toby",
"password": "pass7word"
}
HTTP/1.1 200 OK
{
"token": "YACub2KLfe8mfmHPcUKtt6t2SMJOGPXnZbqhc3nX",
"userId": "1"
}
Subsequently, you can include this authentication token in the request headers for subsequent requests:
GET /api/forum HTTP/1.1
Authentication: Token YACub2KLfe8mfmHPcUKtt6t2SMJOGPXnZbqhc3nX
When enabling 2FA, you will be unable to complete the login request and will receive the following message:401 - Not authenticated
Get topic - Get all discussions (default sorting rule is -time)
GET /api/discussions
GET /api/discussions?sort=-commentCount Sort by number of comments in descending order.
GET /api/discussions/{id} Retrieve a discussion by its ID.
GET /api/discussions?include=user,lastPostedUser,firstPost,tags Return to specified content
Create a topic
POST /api/discussions
User information
GET /api/users/{idOrUsername} Retrieve information using an ID or username.
Get all groups
GET /api/groups
Get tags
GET /api/tags