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

Open
OmalPerera opened this issue Mar 1, 2018 · 0 comments
Open

Implement POST /users #2

OmalPerera opened this issue Mar 1, 2018 · 0 comments

Comments

@OmalPerera
Copy link
Member

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

Request schema 1:

{
    "email": "[email protected]",
    "password": "password"
}

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

Response schemas:

Status 201: Return if the user was successfully created.

{
    "self": "http://localhost:8090/api/users/{user_id}",
    "email": "[email protected]"
}

Status 400: Return if email is not set.

Status 409: If the user already exists.

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

Request schema 2

{
    "email": "[email protected]"
}

Here the password is not set.

Response schemas

Status 201: Return if the user was successfully created.

{
    "self": "http://localhost:8090/api/users/{user_id}",
    "email": "[email protected]"
}

Note
Placeholders {email}, {user_id} should contain actual values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant