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 [email protected]: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.