-
Notifications
You must be signed in to change notification settings - Fork 7
post users
Harmun edited this page May 16, 2019
·
10 revisions
post | /users | None | Create new user with User privileges | { userName, pssword } | { id, userName, dateCreated } |
Creates a new user with user role privileges. Passwords will be hashed in the database. Users are assigned IDs on creation.
- Usernames must be unique
- Usernames currently cannot be purely numerical
Request formats | JSON |
Requires authentication? | No |
Name | Required | Description | Role | Example |
---|---|---|---|---|
userName | required | The created user's username | user | "SteveRogers1918" |
pssword | required | The password that will be used to authenticate the user | user | "bucky4ever" |
curl -X POST \
http://localhost:3000/users \
-H 'Content-Type: application/json' \
-H 'Host: localhost:3000' \
-d '{
"userName": "SteveRogers1918",
"pssword": "bucky4ever"
}'
After you post succesfully you should get back the created user's information like this:
{
"id": 2,
"userName": "SteveRogers1918",
"dateCreated": "2019-05-14T10:01:56.000Z"
}
post | /admin | Admin | Create new user with Admin privileges | { userName, pssword } | { id, userName, role, dateCreated, deletedAt } |
Creates a new user with admin role privileges. Passwords will be hashed in the database. Users are assigned IDs on creation.