0% found this document useful (0 votes)
79 views1 page

User Registration API Overview

The registration API endpoint allows users to create a new account by providing a unique username, valid email address, password, and role ID. Upon successful registration, a 200 OK response is returned along with the user information and authentication token, while invalid or missing parameters return a 400 error and internal server errors receive a 500 response.

Uploaded by

abdulhakimaben
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
79 views1 page

User Registration API Overview

The registration API endpoint allows users to create a new account by providing a unique username, valid email address, password, and role ID. Upon successful registration, a 200 OK response is returned along with the user information and authentication token, while invalid or missing parameters return a 400 error and internal server errors receive a 500 response.

Uploaded by

abdulhakimaben
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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.

You might also like