-
Notifications
You must be signed in to change notification settings - Fork 0
Users
To create a new user you will have to create a new POST
request to the following URL: https://project-run.herokuapp.com/users
.
The body of the request should contain the name, email and password.
A sample JSON of the request is:
{
"name":"John Doe",
"email":"[email protected]",
"password":"dkjIUm21"
}
The response will be a JSON again. A sample is provided below:
{
"id": 4,
"name": "John Doe",
"email": "[email protected]",
"password_digest": "$2a$10$XtDtrOH2Pq0fV/g60yNQF.3jafd6I/TX8KeDzL94onQpbCIc53i.2",
"created_at": "2017-02-21T20:06:44.583Z",
"updated_at": "2017-02-21T20:06:44.583Z"
}
PATCH
to https://project-run.herokuapp.com/users/ for updating user with. This is an authenticated resource so you will receive a
401` if the token sent doesn't have modifying permissions for that user.
The params permitted are the following
{
"name":"John Doe",
"email":"[email protected]",
"password":"dkjIUm21"
}
GET
request to https://project-run.herokuapp.com/users/mine/groups
A sample response for this request:
[
{
"id": 1,
"name": "Group use2",
"creator": "[email protected]",
"role": "admin"
},
{
"id": 2,
"name": "Group us2",
"creator": "[email protected]",
"role": "student"
}
]
GET
request to https://project-run.herokuapp.com/users/mine/quizzes
[
{
"id": 3,
"title": "My quiz",
"status": "not_started"
}
]
POST
request at https://project-run.herokuapp.com/users/search
with the following parameters:
{
"input": "what_to_look_for"
}
The request will return the best match for name and email and alternative matched for name and email.