Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement POST /users #2

Closed
WThamira opened this issue Feb 14, 2018 · 0 comments
Closed

Implement POST /users #2

WThamira opened this issue Feb 14, 2018 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@WThamira
Copy link
Owner

HTTP POST request to http://localhost:8090/api/users should create a new user.

Request schema #1:

{
    "username":"admin",
    "email" : "admin@letmehack.lk"
    “password”: “password”
}

If the password is not set, you should randomly generate a password in the backend.

Response schemas:

Status 201: Return if the user was successfully created.

{
 “self”: “http://localhost:8090/api/users/{user_id}”,
 “email”: “admin@letmehack.lk”
}

Status 400: Return if email is not set.

Status 409: If the user already exists.

{
  "status": 409,
  "message": "An user with email: {email} already exists.",
  "developerMessage": "User creation failed because the email: {email} already exists."
}

Request schema #2

{
    "username":"admin",
    “email”: “admin@letmehack.lk”
}

Here the password is not set.

Response schema

Status 201: Return if the user was successfully created.

{
    “self”: “http://localhost:8090/api/users/{user_id}”
    “email”: “admin@letmehack.lk”
}

Note
Placeholders {email}, {user_id} should contain actual values.
It's recommended that you use UUID as the primary key.

@OmalPerera OmalPerera self-assigned this Feb 14, 2018
@OmalPerera OmalPerera added the enhancement New feature or request label Feb 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants