Line Items

Line Item API for IMS Assignment and Grade Services

A LineItem object looks like:

{
  // The fully qualified URL for showing, updating, and deleting the Line Item
  "id": "http://institution.canvas.com/api/lti/courses/5/line_items/2",
  // The maximum score of the Line Item
  "scoreMaximum": 50,
  // The label of the Line Item.
  "label": "50",
  // Tag used to qualify a line Item beyond its ids
  "tag": "50",
  // A Tool Provider specified id for the Line Item. Multiple line items can share
  // the same resourceId within a given context
  "resourceId": "50",
  // The resource link id the Line Item is attached to
  "resourceLinkId": "50",
  // The extension that defines the submission_type of the line_item. Only returns
  // if set through the line_item create endpoint.
  "https://canvas.instructure.com/lti/submission_type": "{
  	"type":"external_tool",
  	"external_tool_url":"https://my.launch.url",
  }",
  // The launch url of the Line Item. Only returned if `include=launch_url` query
  // parameter is passed, and only for Show and List actions.
  "https://canvas.instructure.com/lti/launch_url": "https://my.tool.url/launch"
}

Lti::Ims::LineItemsController#create

POST /api/lti/courses/:course_id/line_items

Scope: url:POST|/api/lti/courses/:course_id/line_items

Create a new Line Item

Request Parameters:

Example Request:

{
  "scoreMaximum": 100.0,
  "label": "LineItemLabel1",
  "resourceId": 1,
  "tag": "MyTag",
  "resourceLinkId": "1",
  "startDateTime": "2022-01-31T22:23:11+0000",
  "endDateTime": "2022-02-07T22:23:11+0000",
  "https://canvas.instructure.com/lti/submission_type": {
    "type": "external_tool",
    "external_tool_url": "https://my.launch.url"
  }
}

Returns a LineItem object.

Lti::Ims::LineItemsController#update

PUT /api/lti/courses/:course_id/line_items/:id

Scope: url:PUT|/api/lti/courses/:course_id/line_items/:id

Update new Line Item

Request Parameters:

Returns a LineItem object.

Lti::Ims::LineItemsController#show

GET /api/lti/courses/:course_id/line_items/:id

Scope: url:GET|/api/lti/courses/:course_id/line_items/:id

Show existing Line Item

Request Parameters:

Returns a LineItem object.

Lti::Ims::LineItemsController#index

GET /api/lti/courses/:course_id/line_items

Scope: url:GET|/api/lti/courses/:course_id/line_items

List all Line Items for a course

Request Parameters:

Returns a LineItem object.

Lti::Ims::LineItemsController#destroy

DELETE /api/lti/courses/:course_id/line_items/:id

Scope: url:DELETE|/api/lti/courses/:course_id/line_items/:id

Delete an existing Line Item

Returns a LineItem object.


© Instructure, Inc. Generated on Wed Nov 6 14:20:07 2024 This documentation is generated directly from the Canvas LMS source code, available on Github.

Last updated

Copyright © 2024 Instructure, Inc. All rights reserved.