ForumAPI is a RESTful API built with ASP.NET Core that allows users to create, read, update, and delete categories, sections, subjects, and messages.
- Clone the repository: git clone git@github.com:RomainNeup/forum_server_asp.git
- Navigate to the project directory:
cd ForumAPI
** - Restore the dependencies: dotnet
restore
** - Build the project:
dotnet build
** - Run the project:
dotnet run
**
π POST /auth/register
Registers a new user account.
π Payload:
{
"username": "string",
"email": "string",
"password": "string"
}
π POST /auth/login
Logs in a user and returns an authentication token.
π Payload:
{
"email": "string",
"password": "string"
}
π POST /categories
Creates a new category.
π Payload:
{
"name": "string",
"description": "string"
}
π GET /categories
Returns a list of all categories.
π GET /categories/{id}
Returns the details of a single category.
π PUT /categories/{id}
Updates an existing category.
π Payload:
{
"name": "string",
"description": "string"
}
π DELETE /categories/{id}
Deletes an existing category.
π POST /sections
Creates a new section in the specified category.
π Payload:
{
"name": "string",
"description": "string",
"categoryId": "integer"
}
π GET /sections
Returns a list of all sections.
π GET /sections/{id}
Returns the details of a single section.
π PUT /sections/{id}
Updates an existing section.
π Payload:
{
"name": "string",
"description": "string"
}
π DELETE /sections/{id}
Deletes an existing section.
π POST /sections/{sectionId}/subjects
Creates a new subject in the specified section.
π Payload:
{
"name": "string",
"text": "string"
}
π GET /sections/{sectionId}/subjects
Returns a list of all subjects in the specified section.
π GET /sections/{sectionId}/subjects/{id}
Returns the details of a single subject.
π PUT /sections/{sectionId}/subjects/{id}
Updates an existing subject.
π Payload:
{
"name": "string",
"text": "string"
}
π DELETE /sections/{sectionId}/subjects/{id}
Deletes an existing subject.
π POST /subjects/{subjectId}/messages
Creates a new message in the specified subject.
π Payload:
{
"text": "string"
}
π GET /subjects/{subjectId}/messages
Returns a list of all messages in the specified subject.
π GET /subjects/{subjectId}/messages/{id}
Returns the details of a single message.
π PUT /subjects/{subjectId}/messages/{id}
Updates an existing message.
π Payload:
{
"text": "string"
}
π DELETE /subjects/{subjectId}/messages/{id}
Deletes an existing message.
Note: π represents a protected route, which requires a JWT token to be sent in the request header as Bearer token, while π represents an unprotected route.