Get Line Items
The LTI® protocol allows you to retrieve grade lines from the LMS grade book through the Assignment and Grades - Line Items service. In the context of LTI®, these grade lines are called line items. LTIAAS gives you access to this service through the /api/lineitems
API endpoint.
Please check our Manipulating grade lines guide and its Retrieving grade lines section to learn more about using this endpoint.
API Authentication Method | Supported |
---|---|
LTIK-AUTH-V2 | ✅ |
SERVICE-AUTH-V1 | ✅ |
Bearer |
Query Parameters
Filters line items by the resource link ID attached to the current launch context
Filters line items by resourceId
Filters line items by tag
Possible values: >= 1
Limits the number of line items returned. the platform MAY further reduce the number of items returned at its own discretion.
Retrieves line items from a specific URL. - When present, the url
parameter causes every other parameter to be ignored. - The url
parameter should be URL encoded. - In cases where not all line items are retrieved when the line item limit is reached, the returned object will contain a next
field holding an URL that can be used to retrieve the remaining line items through the url
parameter.
- 200
- 401
Schema
lineItems object[] required
A URL pointing to the next page of line items.
A URL pointing to the first page of line items.
A URL pointing to the last page of line items.
A URL pointing to the previous page of line items.
{
"lineItems": [
{
"id": "https://lms.example.com/course/1/lineitems/1",
"label": "Activity",
"scoreMaximum": 100,
"resourceLinkId": "1g3k4dlk49fk",
"resourceId": "a-9334df-33",
"tag": "grade",
"startDateTime": "2025-01-09T04:06:33.928Z",
"endDateTime": "2018-04-06T22:05:03Z",
"gradesReleased": true
}
],
"next": "https://lms.example.com/course/1/lineitems?pages=2",
"first": "https://lms.example.com/course/1/lineitems?pages=1",
"last": "https://lms.example.com/course/1/lineitems?pages=3",
"prev": "string"
}
Unauthorized. Please check our guide on Authenticating API requests to learn about how authentication works in the LTIAAS API.
Schema
Default value: 401
Default value: Unauthorized
details object required
{
"status": 401,
"error": "Unauthorized",
"details": {
"message": "INVALID_LTIK_AUTH_AUTHORIZATION_HEADER",
"description": "Invalid or expired ltik."
}
}
GET /api/lineitems
Authorization
name: Authorizationtype: apiKeyin: headerdescription: An http Header who's value is of the format: `LTIK-AUTH-V2 <API_KEY>:<ltik>`. Where <API_KEY> should be replaced with your static API Key provided by LTIAAS and <ltik> is the ltik value passed to you on each new launch of your tool. Learn more about this in the <a href="/guides/api/authentication">Authenticating API requests</a> guide.
Request
Request
const axios = require('axios');
const url = 'https://your.ltiaas.com/api/lineitems';
const config = {
headers: {
'Authorization': `LTIK-AUTH-V2 ${API_KEY}:${ltik}`
}
};
try {
const response = await axios.get(url, config);
console.log(response.data);
} catch(error) {
console.log(error);
}
const axios = require('axios');
const url = 'https://your.ltiaas.com/api/lineitems';
const config = {
headers: {
'Authorization': `LTIK-AUTH-V2 ${API_KEY}:${ltik}`
}
};
try {
const response = await axios.get(url, config);
console.log(response.data);
} catch(error) {
console.log(error);
}
const axios = require('axios');
const url = 'https://your.ltiaas.com/api/lineitems';
const config = {
headers: {
'Authorization': `LTIK-AUTH-V2 ${API_KEY}:${ltik}`
}
};
try {
const response = await axios.get(url, config);
console.log(response.data);
} catch(error) {
console.log(error);
}
const axios = require('axios');
const url = 'https://your.ltiaas.com/api/lineitems';
const config = {
headers: {
'Authorization': `LTIK-AUTH-V2 ${API_KEY}:${ltik}`
}
};
try {
const response = await axios.get(url, config);
console.log(response.data);
} catch(error) {
console.log(error);
}
const axios = require('axios');
const url = 'https://your.ltiaas.com/api/lineitems';
const config = {
headers: {
'Authorization': `LTIK-AUTH-V2 ${API_KEY}:${ltik}`
}
};
try {
const response = await axios.get(url, config);
console.log(response.data);
} catch(error) {
console.log(error);
}
const axios = require('axios');
const url = 'https://your.ltiaas.com/api/lineitems';
const config = {
headers: {
'Authorization': `LTIK-AUTH-V2 ${API_KEY}:${ltik}`
}
};
try {
const response = await axios.get(url, config);
console.log(response.data);
} catch(error) {
console.log(error);
}
const axios = require('axios');
const url = 'https://your.ltiaas.com/api/lineitems';
const config = {
headers: {
'Authorization': `LTIK-AUTH-V2 ${API_KEY}:${ltik}`
}
};
try {
const response = await axios.get(url, config);
console.log(response.data);
} catch(error) {
console.log(error);
}