DHIS2 Instructor API
The instructor API from DHIS2 — 3 operation(s) for instructor.
The instructor API from DHIS2 — 3 operation(s) for instructor.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/dhis2:dhis2-instructor-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Open edX Instructor API
description: APIs for access to Open edX information
contact:
email: contact@academy.dhis2.org
version: v1
servers:
- url: https://academy.dhis2.org/api
security:
- Basic: []
tags:
- name: instructor
paths:
/instructor/v1/reports/{course_id}:
parameters:
- name: course_id
in: path
required: true
schema:
type: string
get:
operationId: instructor_v1_reports_read
summary: List report CSV files that are available for download for this course
description: '**Use Cases**
Lists reports available for download
**Example Requests**:
GET /api/instructor/v1/reports/{course_id}
**Response Values**
```json
{
"downloads": [
{
"url": "https://1.mock.url",
"link": "mock_file_name_1",
"name": "mock_file_name_1"
}
]
}
```
The report name will depend on the type of report generated. For example a
problem responses report for an entire course might be called:
edX_DemoX_Demo_Course_student_state_from_block-v1_edX+DemoX+Demo_Course+type@course+block@course_2021-04-30-0918.csv'
parameters:
- name: course_id
in: path
description: ID for the course whose reports need to be listed.
required: true
schema:
type: string
- name: report_name
in: query
description: Filter results to only return details of for the report with the specified name.
schema:
type: string
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/ReportDownloadsList'
'401':
description: The requesting user is not authenticated.
'403':
description: The requesting user lacks access to the course.
'404':
description: The requested course does not exist.
tags:
- instructor
/instructor/v1/reports/{course_id}/generate/problem_responses:
parameters:
- name: course_id
in: path
required: true
schema:
type: string
post:
operationId: instructor_v1_reports_generate_problem_responses_create
summary: Initiate generation of a CSV file containing all student answers
description: 'to a given problem.
**Example requests**
POST /api/instructor/v1/reports/{course_id}/generate/problem_responses {
"problem_locations": [
"{usage_key1}",
"{usage_key2}",
"{usage_key3}"
]
}
POST /api/instructor/v1/reports/{course_id}/generate/problem_responses {
"problem_locations": ["{usage_key}"],
"problem_types_filter": ["problem"]
}
**POST Parameters**
A POST request can include the following parameters:
* problem_location: A list of usage keys for the blocks to include in
the report. If the location is a block that contains other blocks,
(such as the course, section, subsection, or unit blocks) then all
blocks under that block will be included in the report.
* problem_types_filter: Optional. A comma-separated list of block types
to include in the report. If set, only blocks of the specified types
will be included in the report.
To get data on all the poll and survey blocks in a course, you could
POST the usage key of the course for `problem_location`, and
"poll, survey" as the value for `problem_types_filter`.
**Example Response:**
If initiation is successful (or generation task is already running):
```json
{
"status": "The problem responses report is being created. ...",
"task_id": "4e49522f-31d9-431a-9cff-dd2a2bf4c85a"
}
```
Responds with BadRequest if any of the provided problem locations are faulty.'
parameters:
- name: course_id
in: path
description: ID of the course for which report is to be generate.
required: true
schema:
type: string
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/ProblemResponsesReportStatus'
'400':
description: The provided parameters were invalid. Make sure you've provided at least one valid usage key for `problem_locations`.
'401':
description: The requesting user is not authenticated.
'403':
description: The requesting user lacks access to the course.
tags:
- instructor
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ProblemResponseReportPostParams'
required: true
/instructor/v1/tasks/{course_id}:
parameters:
- name: course_id
in: path
required: true
schema:
type: string
get:
operationId: instructor_v1_tasks_read
summary: List instructor tasks filtered by `course_id`
description: '**Use Cases**
Lists currently running instructor tasks
**Parameters**
- With no arguments, lists running tasks.
- `problem_location_str` lists task history for problem
- `problem_location_str` and `unique_student_identifier` lists task
history for problem AND student (intersection)
**Example Requests**:
GET /courses/{course_id}/instructor/api/v0/tasks
**Response Values**
```json
{
"tasks": [
{
"status": "Incomplete",
"task_type": "grade_problems",
"task_id": "2519ff31-22d9-4a62-91e2-55495895b355",
"created": "2019-01-15T18:00:15.902470+00:00",
"task_input": "{}",
"duration_sec": "unknown",
"task_message": "No status information available",
"requester": "staff",
"task_state": "PROGRESS"
}
]
}
```'
parameters:
- name: course_id
in: path
description: ID for the course whose tasks need to be listed.
required: true
schema:
type: string
- name: problem_location_str
in: query
description: Filter instructor tasks to this problem location.
schema:
type: string
- name: unique_student_identifier
in: query
description: Filter tasks to a singe problem and a single student. Must be used in combination with `problem_location_str`.
schema:
type: string
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/InstructorTasksList'
'401':
description: The requesting user is not authenticated.
'403':
description: The requesting user lacks access to the course.
'404':
description: The requested course does not exist.
tags:
- instructor
components:
schemas:
InstructorTask:
required:
- status
- task_type
- task_id
- created
- task_input
- requester
- task_state
- duration_sec
- task_message
type: object
properties:
status:
title: Status
description: Current status of task.
type: string
minLength: 1
task_type:
title: Task type
description: Identifies the kind of task being performed, e.g. rescoring.
type: string
minLength: 1
task_id:
title: Task id
description: The celery ID for the task.
type: string
minLength: 1
created:
title: Created
description: The date and time when the task was created.
type: string
format: date-time
task_input:
title: Task input
description: The input parameters for the task. The format and content of this data will depend on the kind of task being performed. For instanceit may contain the problem locations for a problem resources task.
type: object
additionalProperties:
type:
- string
- 'null'
requester:
title: Requester
description: The username of the user who initiated this task.
type: string
minLength: 1
task_state:
title: Task state
description: The last knows state of the celery task.
type: string
minLength: 1
duration_sec:
title: Duration sec
description: Task duration information, if known
type: string
minLength: 1
task_message:
title: Task message
description: User-friendly task status information, if available.
type: string
minLength: 1
InstructorTasksList:
required:
- tasks
type: object
properties:
tasks:
description: List of instructor tasks.
type: array
items:
$ref: '#/components/schemas/InstructorTask'
ProblemResponseReportPostParams:
required:
- problem_locations
type: object
properties:
problem_locations:
description: 'A list of usage keys for the blocks to include in the report. '
type: array
items:
description: A usage key location for a section or a problem. If the location is a block that contains other blocks, (such as the course, section, subsection, or unit blocks) then all blocks under that block will be included in the report.
type: string
minLength: 1
problem_types_filter:
description: 'A list of problem/block types to generate the report for. This field can be omitted if the report should include details of allblock types. '
type: array
items:
type: string
minLength: 1
ReportDownload:
description: Report Download
required:
- url
- name
- link
type: object
properties:
url:
title: Url
description: URL from which report can be downloaded.
type: string
format: uri
minLength: 1
name:
title: Name
description: Name of report.
type: string
minLength: 1
link:
title: Link
description: HTML anchor tag that contains the name and link.
type: string
minLength: 1
ProblemResponsesReportStatus:
required:
- status
- task_id
type: object
properties:
status:
title: Status
description: User-friendly text describing current status of report generation.
type: string
minLength: 1
task_id:
title: Task id
description: A unique id for the report generation task. It can be used to query the latest report generation status.
type: string
format: uuid
ReportDownloadsList:
required:
- downloads
type: object
properties:
downloads:
description: List of report downloads
type: array
items:
$ref: '#/components/schemas/ReportDownload'
securitySchemes:
Basic:
type: http
scheme: basic