This endpoint is used to register a new user in the BlockRoll system. The user can register as an employer, freelancer, or a normal user.
POST
The endpoint expects the following data in JSON format:
{
"username": "string", // Required. The username of the user.
"user_type": "string" // Required. The type of user. Possible values: "employer", "freelancer", "normal".
}- Status Code:
201 Created - Body:
{ "message": "User registered successfully", "data": { "username": "string", "user_type": "string", "account": "string" // Blockchain account address of the user } }
-
Missing Fields
- Status Code:
400 Bad Request - Body:
{ "error": "Username and user_type are required" }
- Status Code:
-
User Already Registered
- Status Code:
409 Conflict - Body:
{ "error": "User is already registered" }
- Status Code:
-
Internal Server Error
- Status Code:
500 Internal Server Error - Body:
{ "error": "An error occurred while registering the user" }
- Status Code:
curl -X POST http://localhost:5000/users/register \
-H "Content-Type: application/json" \
-d '{
"username": "shivam",
"user_type": "freelancer"
}'- Status Code:
201 Created - Body:
{ "message": "User registered successfully", "data": { "username": "string", "user_type": "string", "account": "string" // Blockchain account address of the user } }
-
Missing Fields
- Status Code:
400 Bad Request - Body:
{ "error": "Username and user_type are required" }
- Status Code:
-
User Already Registered
- Status Code:
409 Conflict - Body:
{ "error": "User is already registered" }
- Status Code:
-
Internal Server Error
- Status Code:
500 Internal Server Error - Body:
{ "error": "An error occurred while registering the user" }
- Status Code:
curl -X POST http://localhost:5000/users/register \
-H "Content-Type: application/json" \
-d '{
"username": "shivam",
"user_type": "freelancer"
}'