Authentication

Registration

In order to log in, you must have a user account. User accounts can be created by sending a POST request to the registration endpoint.

POST /auth/register/

Register a new user.

Request JSON Object:
 
  • email (string) – The email address to register the user under.
  • password (string) – The password to give the new user.
  • first_name (string) – The user’s first name.
  • last_name (string) – The user’s last name.
Response JSON Object:
 
  • id (int) – The new user’s ID.
  • email (string) – The new user’s email address.
  • first_name (string) – The new user’s first name.
  • last_name (string) – The new user’s last name.
Status Codes:
  • 201 Created – A new user was sucessfully created.
  • 400 Bad Request – Bad request; check response for details.
  • 403 Forbidden – Authentication credentials were provided. This endpoint requires the user to be unauthenticated.

Login

Logging in will return a token that can be used to authenticate with other endpoints.

POST /auth/login/

Log in an existing user.

Request JSON Object:
 
  • username (string) – The user’s email address.
  • password (string) – The user’s password.
Response JSON Object:
 
  • token (string) – A token the user can use to authenticate with the API.
Status Codes:

Layer

For real time communications we use Layer. Layer requires an identity token in order to authenticate with their services.

Warning

The validity of the token returned from this endpoint is not guaranteed. If an invalid nonce was provided, the returned token will also be invalid.

POST /auth/layer/

Obtain an identity token for Layer.

Request JSON Object:
 
  • nonce (string) – A nonce from Layer.
Response JSON Object:
 
Status Codes: