# User Creation
# Create User Profile
In order for users to create posts or leave comments on products, they must first set up a profile. This profile will serve as a repository for all of the user's posts and comments, making it simpler to associate them with that particular user.
#
# Request
- HTTP Method:
POST
- accept :
application/json
- Content Type :
application/json
- URL:
https://comments-api-production.up.railway.app/users/create-user
# Body Parameters
Property | Type | Required | Description |
---|---|---|---|
name | string | true | The name of the user |
email | string | true | The email of the user |
password | string | true | The password of the user |
passwordVerify | string | true | The verified password of the user |
# Request example
curl -X POST \
'https://comments-api-production.up.railway.app/users/create-user' \
-H 'accept : application/json' \
-H 'Content-Type : application/json' \
-d '{
"name" : "John Doe Superb",
"email" : "johndoe@mail.com",
"password" : "Password1234&",
"passwordVerify" : "Password1234&"
}'
# Expected Responses:
# Account Created Successfully
Your account has been created successfully
{
"statusCode":201,
"responseValue":{
"message":"Account Created Successfully"}
}
# Other Responses:
# Email Already Exists
Your email has been used before
{
"statusCode":403,
"message":["Your Email has been used before"],
"error":"forbidden"}
# Password Mismatch
Your password does not match
{
"statusCode":422,
"message":["Your passwords do not match"],
"error":"Unprocessable entity"}
# Incorrect Password
Your password has the wrong format
{
"statusCode":422,
"message":["password must be longer than or equal to 6 characters"],
"error":"Unprocessable Entity"}
# Database Error
There was an error with the database
{
"statusCode":500,
"message":["Database write failed"],
"error":"Internal server error"}
# Playground
Method: POST
URL: https://comments-api-production.up.railway.app/users/create-user
Headers:
Key | Value |
---|---|
accept | |
Content-Type |