GET /exams/:exam_id/attachments
List attachments

Errors

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

Examples

{
  'example_request_params': {
    'nonce': '1527500365',
    'timestamp': 1527500365052,
    'signature': '8aac70c9906ad0812f4fbc34617322f985b4ac978cec861724f142cb572b88ff',
    'page': 1
  },
  'example_response': {
    'attachments': [
      {
          'id': 1,
          'created_at': '2019-01-22T16:07:23.246+01:00',
          'updated_at': '2019-01-22T16:07:23.246+01:00',
          'document_file_name': 'image.jpg',
          'document_content_type': 'image/jpeg',
          'document_file_size': 2065711,
          'document_updated_at': '2019-01-22T16:07:23.235+01:00',
          'exam_id': 1,
          'placeholder': '1548172086_image2.jpg'
      }
    ]
  }
}

Params

Param name Description
exam_id
required

ID of the exam.

Validations:

  • Must be a number.

page
optional

Page number, returns LIMIT items per page. The X-Pagination-* HTTP headers contain the information about the total number of items (X-Pagination-Item-Count), the total number of pages (X-Pagination-Page-Count), the current page number (X-Pagination-Page) and the number of items per page (X-Pagination-Limit).

Validations:

  • Must be a number.

limit
optional

Number of items returned per page. Default and maximum value is 300.

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 /exams/:exam_id/attachments/:id
Show an attachment

Errors

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

Examples

{
  'example_request_params': {
    'nonce': '1527500365',
    'timestamp': 1527500365052,
    'signature': '8aac70c9906ad0812f4fbc34617322f985b4ac978cec861724f142cb572b88ff'
  },
  'example_response': {
    'attachment': {
      'id': 1,
      'created_at': '2019-01-22T16:07:23.246+01:00',
      'updated_at': '2019-01-22T16:07:23.246+01:00',
      'document_file_name': 'image.jpg',
      'document_content_type': 'image/jpeg',
      'document_file_size': 2065711,
      'document_updated_at': '2019-01-22T16:07:23.235+01:00',
      'exam_id': 1,
      'placeholder': '1548172086_image2.jpg'
    }
  }
}

Params

Param name Description
id
required

ID of the attachment.

Validations:

  • Must be a number.

exam_id
required

ID of the exam.

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 /exams/:exam_id/attachments
Create an attachment using multipart

Errors

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

Examples

{
  'example_request_params': {
    'nonce': '1527500365',
    'timestamp': 1527500365052,
    'signature': '8aac70c9906ad0812f4fbc34617322f985b4ac978cec861724f142cb572b88ff'
  },
  'example_response': {
    'attachment': {
      'id': 2,
      'created_at': '2019-01-22T16:48:06.991+01:00',
      'updated_at': '2019-01-22T16:48:06.991+01:00',
      'document_file_name': 'image2.jpg',
      'document_content_type': 'image/jpeg',
      'document_file_size': 1469411,
      'document_updated_at': '2019-01-22T16:48:06.983+01:00',
      'exam_id': 1,
      'placeholder': '1548172086_image2.jpg'
    }
  }
}

Params

Param name Description
exam_id
required

ID of the exam.

Validations:

  • Must be a number.

document
required

File of the attachment.

Validations:

  • Must be a File

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 /exams/:exam_id/attachments/:id
Destroy an attachment

Errors

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

Examples

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

Params

Param name Description
id
required

ID of the attachment.

Validations:

  • Must be a number.

exam_id
required

ID of the exam.

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