Account Reports API

API for accessing account reports.

A report object looks like:

{
  // The unique identifier for the report.
  "id": 1,

  // The type of report.
  "report": "sis_export_csv",

  // The url to the report download.
  "file_url": "https://example.com/some/path",

  // The status of the report
  "complete",

  // The report parameters
  {"enrollment_term":"2","sis_terms_csv":"1","sis_accounts_csv":"1"},

  // The progress of the report
  "100",
}
  

List Available Reports AccountReportsController#available_reports

GET /api/v1/accounts/:account_id/reports

Returns the list of reports for the current context.

API response field:

  • name

    The name of the report.

  • parameters

    The parameters will vary for each report

Example Request:

curl -H 'Authorization: Bearer <token>' \ 
     https://<canvas>/api/v1/accounts/<account_id>/reports/

Example Response:

[
  {
    "report":"student_assignment_outcome_map_csv",
    "title":"Student Competency",
    "parameters":null
  },
  {
    "report":"grade_export_csv",
    "title":"Grade Export",
    "parameters":{
      "term":{
        "description":"The canvas id of the term to get grades from",
        "required":true
      }
    }
  }
]

Start a Report AccountReportsController#create

POST /api/v1/accounts/:account_id/reports/:report

Generates a report instance for the account.

Request Parameters:

  • [parameters]

    The parameters will vary for each report

Returns a report

Index of Reports AccountReportsController#index

GET /api/v1/accounts/:account_id/reports/:report

Shows all reports that have been run for the account of a specific type.

Example Request:

curl -H 'Authorization: Bearer <token>' \ 
     https://<canvas>/api/v1/accounts/<account_id>/reports/<report_type>
Returns a list of reports

Status of a Report AccountReportsController#show

GET /api/v1/accounts/:account_id/reports/:report/:id

Returns the status of a report.

Request Parameters:

  • [report_id]

    The report id.

Example Request:

curl -H 'Authorization: Bearer <token>' \ 
     https://<canvas>/api/v1/accounts/<account_id>/reports/<report_type>/<report_id>
Returns a report

Delete a Report AccountReportsController#destroy

DELETE /api/v1/accounts/:account_id/reports/:report/:id

Deletes a generated report instance.

Example Request:

curl -H 'Authorization: Bearer <token>' \ 
     -X DELETE \ 
     https://<canvas>/api/v1/accounts/<account_id>/reports/<report_type>/<id>
Returns a report