Registration API
Endpoint:
• /api/register
Description:
• This endpoint allows users to register and create a new account on the platform.
Request Parameters:
• username (string, required): The unique username chosen by the user.
• email (string, required): The email address of the user.
• password (string, required): The password chosen by the user.
• Role_id (integer, required): The role of the user on the application
Response:
• 200 OK: Registration successful. Returns user information along with an authentication token
with message “Registered successfully”.
• 400 Bad Request: Invalid or missing parameters. Returns an error message.
• 500 Internal Server Error: Something went wrong on the server. Returns an error message.
Note
• Ensure the username is unique and follows alphanumeric characters.
• Password should meet security requirements.
• Email should be a valid and unique email address.
• Handle errors gracefully and provide meaningful error messages.