GET /institutes/:institute_id/users
List users

Errors

Code Description
403 You are not authorized to access this page.

Examples

{
  'nonce': '1527500365',
  'timestamp': 1527500365052,
  'signature': '8aac70c9906ad0812f4fbc34617322f985b4ac978cec861724f142cb572b88ff'
}

Params

Param name Description
institute_id
required

ID of the user's institute.

Validations:

  • Must be a number.

timestamp
required

Timestamp of the request in milliseconds.

Validations:

  • Must be a number.

nonce
required

Random number unique between the api calls made in the previous 24 hours.

Validations:

  • Must be a number.

signature
required

HMAC sha256 hex encoded hash, using the user secret_key as key, of the query string build with all the other parameters in the format 'name=value' joined by '?' and ordered alphabethically by name. Do not use encoding scheme on the values you use to calculate the string

Validations:

  • Must be a String


GET /institutes/:institute_id/users/:id
Show an user

Errors

Code Description
404 Couldn't find User with 'id'=':id'
403 You are not authorized to access this page.

Examples

{
  'nonce': '1527500365',
  'timestamp': 1527500365052,
  'signature': '8aac70c9906ad0812f4fbc34617322f985b4ac978cec861724f142cb572b88ff'
}

Params

Param name Description
id
required

ID of the requested user.

Validations:

  • Must be a number.

institute_id
required

ID of the user's institute.

Validations:

  • Must be a number.

timestamp
required

Timestamp of the request in milliseconds.

Validations:

  • Must be a number.

nonce
required

Random number unique between the api calls made in the previous 24 hours.

Validations:

  • Must be a number.

signature
required

HMAC sha256 hex encoded hash, using the user secret_key as key, of the query string build with all the other parameters in the format 'name=value' joined by '?' and ordered alphabethically by name. Do not use encoding scheme on the values you use to calculate the string

Validations:

  • Must be a String


POST /institutes/:institute_id/users
Create an user

Errors

Code Description
403 You are not authorized to access this page.
422 Param is missing or the value is empty: 'param'
422 'email':['has already been taken']

Examples

{
  'email':'teacher@man.com',
  'name':'Teacher Name',
  'password': 'password1',
  'password_confirmation': 'password1',
  'role':'administrator',
  'nonce': '1527500365',
  'timestamp': 1527500365052,
  'signature': '8aac70c9906ad0812f4fbc34617322f985b4ac978cec861724f142cb572b88ff'
}

Params

Param name Description
email
required

Email of the user.

Validations:

  • Must be a String

name
required

Name of the user.

Validations:

  • Must be a String

institute_id
required

ID of the user's institute.

Validations:

  • Must be a number.

password
required

Password of the user. Has to be at least 8 characters long, contain one lowercase and one uppercase letter, one number, one special character

Validations:

  • Must be a String

password_confirmation
required

Confirmation of the password.

Validations:

  • Must be a String

role
required

Role of the user. It can be Proctor, Reviewer, Teacher, Administration or Superuser.

Validations:

  • Must be a String

timestamp
required

Timestamp of the request in milliseconds.

Validations:

  • Must be a number.

nonce
required

Random number unique between the api calls made in the previous 24 hours.

Validations:

  • Must be a number.

signature
required

HMAC sha256 hex encoded hash, using the user secret_key as key, of the query string build with all the other parameters in the format 'name=value' joined by '?' and ordered alphabethically by name. Do not use encoding scheme on the values you use to calculate the string

Validations:

  • Must be a String


PATCH /institutes/:institute_id/users/:id
Update an user

PUT /institutes/:institute_id/users/:id
Update an user

Errors

Code Description
403 You are not authorized to access this page.
422 Param is missing or the value is empty: 'param'

Examples

{
  'receives_reports':true,
  'report_frequency':'week',
  'nonce': '1527500365',
  'timestamp': 1527500365052,
  'signature': '8aac70c9906ad0812f4fbc34617322f985b4ac978cec861724f142cb572b88ff'
}

Params

Param name Description
id
required

ID of the requested user.

Validations:

  • Must be a number.

institute_id
required

ID of the user's institute.

Validations:

  • Must be a number.

receives_reports
optional

Boolean that defines if the user requires reports.

Validations:

  • Must be one of: true, false, 1, 0

report_frequency
optional

Refers to the user's desired report frequency. It can be day, week, month.

Validations:

  • Must be a String

timestamp
required

Timestamp of the request in milliseconds.

Validations:

  • Must be a number.

nonce
required

Random number unique between the api calls made in the previous 24 hours.

Validations:

  • Must be a number.

signature
required

HMAC sha256 hex encoded hash, using the user secret_key as key, of the query string build with all the other parameters in the format 'name=value' joined by '?' and ordered alphabethically by name. Do not use encoding scheme on the values you use to calculate the string

Validations:

  • Must be a String


DELETE /institutes/:institute_id/users/:id
Destroy an user

Errors

Code Description
404 Couldn't find User with 'id'=':id'
403 You are not authorized to access this page.

Examples

{
  'nonce': '1527500365',
  'timestamp': 1527500365052,
  'signature': '8aac70c9906ad0812f4fbc34617322f985b4ac978cec861724f142cb572b88ff'
}

Params

Param name Description
id
required

ID of the requested user.

Validations:

  • Must be a number.

institute_id
required

ID of the user's institute.

Validations:

  • Must be a number.

timestamp
required

Timestamp of the request in milliseconds.

Validations:

  • Must be a number.

nonce
required

Random number unique between the api calls made in the previous 24 hours.

Validations:

  • Must be a number.

signature
required

HMAC sha256 hex encoded hash, using the user secret_key as key, of the query string build with all the other parameters in the format 'name=value' joined by '?' and ordered alphabethically by name. Do not use encoding scheme on the values you use to calculate the string

Validations:

  • Must be a String