Skip to content

Users

Supports registering, viewing, and updating user accounts.

Register a new user account

Request:

POST /users/

Parameters:

Name Type Required Description
username string Yes The username for the new user.
password string Yes The password for the new user account.
first_name string No The user's given name.
last_name string No The user's family name.
email string No The user's email address.
gender choice Yes The user's gender.
formation string Yes The user's formation.
birthday date Yes The user's birthday.

Note:

  • Not Authorization Protected

Response:

Content-Type application/json
201 Created

{
  "id": "6d5f9bae-a31b-4b7b-82c4-3853eda2b011",
  "username": "richard",
  "first_name": "Richard",
  "last_name": "Hendriks",
  "email": "richard@piedpiper.com",
  "birthday": "2000-10-10",
  "gender": "M",
  "formation": "teacher",
  "auth_token": "132cf952e0165a274bf99e115ab483671b3d9ff6"
}

The auth_token returned with this response should be stored by the client for authenticating future requests to the API. See Authentication.

Get a user's profile information

Request:

GET /users/:id/

Parameters:

Note:

Response:

Content-Type application/json
200 OK

{
  "id": "6d5f9bae-a31b-4b7b-82c4-3853eda2b011",
  "username": "richard",
  "first_name": "Richard",
  "last_name": "Hendriks",
  "birthday": "2000-10-10",
  "gender": "M",
  "formation": "teacher",
}

Update your profile information

Request:

PUT/PATCH /users/:id

Parameters:

Name Type Description
first_name string The first_name of the user object.
last_name string The last_name of the user object.
email string The user's email address.
gender choice The user's gender.
formation string The user's formation.
birthday date The user's birthday.

Note:

Response:

Content-Type application/json
200 OK

{
  "id": "6d5f9bae-a31b-4b7b-82c4-3853eda2b011",
  "username": "richard",
  "first_name": "Richard",
  "last_name": "Hendriks",
  "birthday": "2000-10-10",
  "gender": "M",
  "formation": "teacher",
}