GET api/v3/lti_resources
List all lti_resources. This is the term used in the API for LTI connections.

Errors

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

Examples

{
    'example_request_params': {
        'nonce': 1527500365,
        'timestamp': 1527500365052,
        'signature': '8aac70c9906ad0812f4fbc34617322f985b4ac978cec861724f142cb572b88ff'
    },
    'example_response': {
        'lti_resources: [
            {
                'id':1,
                'lti_resource_link_id':null,
                'tool_provider_id':'2',
                'lti_resource_link_name':'link1',
                'exam_id':2,
                'created_at': '2020-11-25T17:21:59.485+01:00',
                'updated_at': '2020-11-25T17:21:59.485+01:00',
                'lti_resource_launch_url':'http://localhost:5001/link1',
                'lti_custom_data':'',
                'open_in_new_tab':false,
                'placeholder': 'LTI_EXAM_1'
            },
            {
                'id':2,
                'lti_resource_link_id':null,
                'tool_provider_id':'2',
                'lti_resource_link_name':'link2',
                'exam_id':2,
                'created_at': '2020-11-25T17:21:59.485+01:00',
                'updated_at': '2020-11-25T17:21:59.485+01:00',
                'lti_resource_launch_url':'http://localhost:5001/link2',
                'lti_custom_data':'',
                'open_in_new_tab':true,
                'placeholder': 'LTI_EXAM_2'
            }
        ]
    }
}

Params

Param name Description
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

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.


GET api/v3/lti_resources/:id
Show a lti resource by its id

Errors

Code Description
404 Couldn't find lti resource with 'id'=':lti_resource_id'
401 You are not authorized to access this page.

Examples

{
    'example_request_params': {
        'id': 1,
        'nonce': 1527500365,
        'timestamp': 1527500365052,
        'signature': '8aac70c9906ad0812f4fbc34617322f985b4ac978cec861724f142cb572b88ff'      
    },
    'example_response': {
        'lti_resource': {
            'id':1,
            'lti_resource_link_id':null,
            'tool_provider_id':'2',
            'lti_resource_link_name':'link1',
            'exam_id':2,
            'created_at': '2020-11-25T17:21:59.485+01:00',
            'updated_at': '2020-11-25T17:21:59.485+01:00',
            'lti_resource_launch_url':'http://localhost:5001/link1',
            'lti_custom_data':'',
            'open_in_new_tab':false,
            'placeholder': 'LTI_EXAM_1'
        }
    }
}

Params

Param name Description
id
required

ID of the lti resource.

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 api/v3/lti_resources
Create a lti resource

In order to create an exam which has an LTI Connection through the API, you'll need to go through these steps:

1. Create an exam 
2. Create a tool provider, which specifies your external platform, linked to your Institute. You can create the tool provider via the API or once, using the web interface, in which case you should fetch the tool_providers with the API in order to know its id.
3. Create an LTI resource with the exam_id of the exam you want to connect and the tool_provider_id of the external platform you created in step 2. The LTI resource you create here should match one of the resources you have created on your external platform.
4. Finally, create the exam instructions using the /documents API, by inserting the placeholder that was returned in step 3 into the instructions (exam_content field)

Errors

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

Examples

{
        'example_request_params': {
            'lti_resource_link_name': 'some name',
            'exam_id': '1',
            'tool_provider_id': '1',
            'nonce': 1527500365,
            'timestamp': 1527500365052,
            'signature': '8aac70c9906ad0812f4fbc34617322f985b4ac978cec861724f142cb572b88ff'
        },
        'example_response': {
            'lti_resource': {
                'id':1,
                'lti_resource_link_id':null,
                'tool_provider_id':'1',
                'lti_resource_link_name':'some name',
                'exam_id':1,
                'created_at': '2020-11-25T17:21:59.485+01:00',
                'updated_at': '2020-11-25T17:21:59.485+01:00',
                'lti_resource_launch_url':'http://localhost:5001/link1',
                'lti_custom_data':'',
                'open_in_new_tab':false,
                'placeholder': 'LTI_EXAM_1'
            }
        }
    }

Params

Param name Description
lti_resource_link_name
required

Name of the lti resource

Validations:

  • Must be a String

exam_id
required

ID of the exam to attach the lti resource to

Validations:

  • Must be a number.

tool_provider_id
required

ID of the tool provider to create the lti resource from

Validations:

  • Must be a number.

lti_resource_launch_url
optional

LTI launch url of the external platform (default to the tool provider url)

Validations:

  • Must be a String

open_in_new_tab
optional

If set to true the link will be opened in a new tab on click

Validations:

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

lti_custom_data
optional

Json as a string that will add custom data to the LTI request (default to the tool provider lti_custom_data)

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 api/v3/lti_resources/:id
Update a lti resource

PUT api/v3/lti_resources/:id
Update a lti resource

Errors

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

Examples

{
        'example_request_params': {
            'tool_name':'Some new name',
            'nonce': 1527500365,
            'timestamp': 1527500365052,
            'signature': '8aac70c9906ad0812f4fbc34617322f985b4ac978cec861724f142cb572b88ff'
        },
        'example_response': {
            'lti_resource': {
                'id':1,
                'lti_resource_link_id':null,
                'tool_provider_id':'1',
                'lti_resource_link_name':'some new name',
                'exam_id':1,
                'created_at': '2020-11-25T17:21:59.485+01:00',
                'updated_at': '2020-11-25T17:21:59.485+01:00',
                'lti_resource_launch_url':'http://localhost:5001/link1',
                'lti_custom_data':'',
                'open_in_new_tab':false,
                'placeholder': 'LTI_EXAM_1'
            }
        }
    }

Params

Param name Description
id
optional

ID of the lti resource.

Validations:

  • Must be a number.

lti_resource_link_name
optional

Name of the lti resource

Validations:

  • Must be a String

exam_id
optional

ID of the exam to attach the lti resource to

Validations:

  • Must be a number.

tool_provider_id
optional

ID of the tool provider to create the lti resource from

Validations:

  • Must be a number.

lti_resource_launch_url
optional

LTI launch url of the external platform (default to the tool provider url)

Validations:

  • Must be a String

open_in_new_tab
optional

If set to true the link will be opened in a new tab on click

Validations:

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

lti_custom_data
optional

Json as a string that will add custom data to the LTI request (default to the tool provider lti_custom_data)

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 api/v3/lti_resources/:id
Destroy a lti resource

Errors

Code Description
404 Couldn't find lti resource with 'id'=':lti_resource_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 lti resource.

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