This section details the API endpoints for managing user authentication and authorization within the SQL database system.
Authenticate a user and obtain an access token.
{
"username": "string",
"password": "string"
}
username (string, required): The username for authentication.password (string, required): The password for authentication.| Status Code | Description | Response Body |
|---|---|---|
| 200 OK | Authentication successful. |
Example Response (200 OK)
|
| 401 Unauthorized | Invalid credentials. |
Example Response (401 Unauthorized)
|
| 500 Internal Server Error | An unexpected error occurred. |
Example Response (500 Internal Server Error)
|
Register a new user account.
{
"username": "string",
"password": "string",
"email": "string"
}
username (string, required): The desired username. Must be unique.password (string, required): The user's password.email (string, required): The user's email address.| Status Code | Description | Response Body |
|---|---|---|
| 201 Created | User registered successfully. |
Example Response (201 Created)
|
| 400 Bad Request | Invalid input data or missing required fields. |
Example Response (400 Bad Request)
|
| 500 Internal Server Error | An unexpected error occurred. |
Example Response (500 Internal Server Error)
|
Log out the current user and invalidate their token.
Authorization: Bearer <your_access_token>
| Status Code | Description | Response Body |
|---|---|---|
| 200 OK | Logout successful. |
Example Response (200 OK)
|
| 401 Unauthorized | No valid authentication token provided. |
Example Response (401 Unauthorized)
|
| 500 Internal Server Error | An unexpected error occurred. |
Example Response (500 Internal Server Error)
|