Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API 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.
openapi: 3.2.0
info:
title: Open edX Discussion 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: Discussion
paths:
/discussion/v1/accounts/replace_username:
parameters: []
post:
operationId: discussion_v1_accounts_replace_username_create
description: Implements the username replacement endpoint
responses:
'201':
description: ''
tags:
- Discussion
summary: Discussion v1 accounts replace username create
x-summary-source: derived
/discussion/v1/accounts/retire_forum/:
parameters: []
post:
operationId: discussion_v1_accounts_retire_forum_create
description: Implements the retirement endpoint.
responses:
'201':
description: ''
tags:
- Discussion
summary: Discussion v1 accounts retire forum create
x-summary-source: derived
/discussion/v1/comments/:
parameters: []
get:
operationId: discussion_v1_comments_list
summary: Implements the GET method for the list endpoint as described in the class…
description: 'This endpoint implements two distinct usage contexts.
When `username` is provided, the `course_id` parameter is
required, and `thread_id` is ignored.
The behavior is to retrieve all of the user''s non-anonymous
comments from the specified course, outside of the context of a
forum thread. In this context, endorsement information is
unavailable.
When `username` is not provided, `thread_id` is required, and
`course_id` is ignored, since the thread already belongs to a course.
In this context, all information relevant to usage in the
discussions forum is available.'
responses:
'200':
description: ''
tags:
- Discussion
post:
operationId: discussion_v1_comments_create
description: 'Implements the POST method for the list endpoint as described in the
class docstring.'
responses:
'201':
description: ''
tags:
- Discussion
summary: Discussion v1 comments create
x-summary-source: derived
/discussion/v1/comments/{comment_id}/:
parameters:
- name: comment_id
in: path
required: true
schema:
type: string
get:
operationId: discussion_v1_comments_read
description: Implements the GET method for comments against response ID
responses:
'200':
description: ''
tags:
- Discussion
summary: Discussion v1 comments read
x-summary-source: derived
patch:
operationId: discussion_v1_comments_partial_update
description: 'Implements the PATCH method for the instance endpoint as described in
the class docstring.'
responses:
'200':
description: ''
tags:
- Discussion
summary: Discussion v1 comments partial update
x-summary-source: derived
delete:
operationId: discussion_v1_comments_delete
description: 'Implements the DELETE method for the instance endpoint as described in
the class docstring'
responses:
'204':
description: ''
tags:
- Discussion
summary: Discussion v1 comments delete
x-summary-source: derived
/discussion/v1/course_topics/{course_id}:
parameters:
- name: course_id
in: path
required: true
schema:
type: string
get:
operationId: discussion_v1_course_topics_read
description: Implements the GET method as described in the class docstring.
responses:
'200':
description: ''
tags:
- Discussion
summary: Discussion v1 course topics read
x-summary-source: derived
/discussion/v1/courses/{course_id}:
parameters:
- name: course_id
in: path
required: true
schema:
type: string
get:
operationId: discussion_v1_courses_read
summary: Retrieve general discussion metadata for a course
description: '**Example Requests**:
GET /api/discussion/v1/courses/course-v1:ExampleX+Subject101+2015'
parameters:
- name: course_id
in: path
description: Course ID
required: true
schema:
type: string
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/CourseMetadataSerailizer'
'401':
description: The requester is not authenticated.
'403':
description: The requester cannot access the specified course.
'404':
description: The requested course does not exist.
tags:
- Discussion
/discussion/v1/courses/{course_id}/learner/:
parameters:
- name: course_id
in: path
required: true
schema:
type: string
get:
operationId: discussion_v1_courses_learner_list
description: Implements the GET method as described in the class docstring.
responses:
'200':
description: ''
tags:
- Discussion
summary: Discussion v1 courses learner list
x-summary-source: derived
/discussion/v1/courses/{course_id}/roles/{rolename}/:
parameters:
- name: course_id
in: path
required: true
schema:
type: string
- name: rolename
in: path
required: true
schema:
type: string
get:
operationId: discussion_v1_courses_roles_read
description: Implement a handler for the GET method.
responses:
'200':
description: ''
tags:
- Discussion
summary: Discussion v1 courses roles read
x-summary-source: derived
post:
operationId: discussion_v1_courses_roles_create
description: Implement a handler for the POST method.
responses:
'201':
description: ''
tags:
- Discussion
summary: Discussion v1 courses roles create
x-summary-source: derived
/discussion/v1/courses/{course_id}/settings:
parameters:
- name: course_id
in: path
required: true
schema:
type: string
get:
operationId: discussion_v1_courses_settings_list
description: Implement a handler for the GET method.
responses:
'200':
description: ''
tags:
- Discussion
summary: Discussion v1 courses settings list
x-summary-source: derived
patch:
operationId: discussion_v1_courses_settings_partial_update
description: Implement a handler for the PATCH method.
responses:
'200':
description: ''
tags:
- Discussion
summary: Discussion v1 courses settings partial update
x-summary-source: derived
/discussion/v1/courses/{course_id}/upload:
parameters:
- name: course_id
in: path
required: true
schema:
type: string
post:
operationId: discussion_v1_courses_upload_create
description: Handles a file upload.
responses:
'201':
description: ''
tags:
- Discussion
summary: Discussion v1 courses upload create
x-summary-source: derived
/discussion/v1/courses/{course_key_string}/activity_stats:
parameters:
- name: course_key_string
in: path
required: true
schema:
type: string
get:
operationId: discussion_v1_courses_activity_stats_list
description: Implements the GET method as described in the class docstring.
responses:
'200':
description: ''
tags:
- Discussion
summary: Discussion v1 courses activity stats list
x-summary-source: derived
/discussion/v1/threads/:
parameters: []
get:
operationId: discussion_v1_threads_list
description: 'Implements the GET method for the list endpoint as described in the
class docstring.'
responses:
'200':
description: ''
tags:
- Discussion
summary: Discussion v1 threads list
x-summary-source: derived
post:
operationId: discussion_v1_threads_create
description: 'Implements the POST method for the list endpoint as described in the
class docstring.'
responses:
'201':
description: ''
tags:
- Discussion
summary: Discussion v1 threads create
x-summary-source: derived
/discussion/v1/threads/{thread_id}/:
parameters:
- name: thread_id
in: path
required: true
schema:
type: string
get:
operationId: discussion_v1_threads_read
description: Implements the GET method for thread ID
responses:
'200':
description: ''
tags:
- Discussion
summary: Discussion v1 threads read
x-summary-source: derived
patch:
operationId: discussion_v1_threads_partial_update
description: 'Implements the PATCH method for the instance endpoint as described in
the class docstring.'
responses:
'200':
description: ''
tags:
- Discussion
summary: Discussion v1 threads partial update
x-summary-source: derived
delete:
operationId: discussion_v1_threads_delete
description: 'Implements the DELETE method for the instance endpoint as described in
the class docstring'
responses:
'204':
description: ''
tags:
- Discussion
summary: Discussion v1 threads delete
x-summary-source: derived
/discussion/v2/course_topics/{course_id}:
parameters:
- name: course_id
in: path
required: true
schema:
type: string
get:
operationId: discussion_v2_course_topics_read
summary: '**Use Cases**'
description: 'Retrieve the topic listing for a course.
**Example Requests**:
GET /api/discussion/v2/course_topics/course-v1:ExampleX+Subject101+2015
?topic_id={topic_id_1, topid_id_2}&order_by=course_structure'
parameters:
- name: course_id
in: path
description: Course ID
required: true
schema:
type: string
- name: topic_id
in: query
description: Comma-separated list of topic ids to filter
schema:
type: string
- name: order_by
in: query
description: Sort ordering for topics
required: false
schema:
type: string
enum:
- course_structure
- activity
- name
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/DiscussionTopicSerializerV2'
'401':
description: The requester is not authenticated.
'403':
description: The requester cannot access the specified course.
'404':
description: The requested course does not exist.
tags:
- Discussion
/discussion/v2/courses/{course_id}:
parameters:
- name: course_id
in: path
required: true
schema:
type: string
get:
operationId: discussion_v2_courses_read
summary: Retrieve general discussion metadata for a course
description: '**Example Requests**:
GET /api/discussion/v2/courses/course-v1:ExampleX+Subject101+2015'
parameters:
- name: course_id
in: path
description: Course ID
required: true
schema:
type: string
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/CourseMetadataSerailizer'
'401':
description: The requester is not authenticated.
'403':
description: The requester cannot access the specified course.
'404':
description: The requested course does not exist.
tags:
- Discussion
/discussion/v3/course_topics/{course_id}:
parameters:
- name: course_id
in: path
required: true
schema:
type: string
get:
operationId: discussion_v3_course_topics_read
summary: '**Use Cases**'
description: 'Retrieve the topic listing for a course.
**Example Requests**:
GET /api/discussion/v3/course_topics/course-v1:ExampleX+Subject101+2015'
responses:
'200':
description: ''
tags:
- Discussion
components:
schemas:
ReasonCodeSeralizer:
required:
- code
- label
type: object
properties:
code:
title: Code
description: A code for the an edit or close reason
type: string
minLength: 1
label:
title: Label
description: A user-friendly name text for the close or edit reason
type: string
minLength: 1
DiscussionTopicSerializerV2:
type: object
properties:
id:
title: Id
description: Provider-specific unique id for the topic
type: string
readOnly: true
minLength: 1
usage_key:
title: Usage key
description: Usage context for the topic
type: string
readOnly: true
minLength: 1
name:
title: Name
description: Topic name
type: string
readOnly: true
minLength: 1
thread_counts:
title: Thread counts
description: Mapping of thread counts by type of thread
type: object
readOnly: true
enabled_in_context:
title: Enabled in context
description: Whether this topic is enabled in its context
type: boolean
readOnly: true
BlackoutDate:
required:
- start
- end
type: object
properties:
start:
title: Start
description: The ISO 8601 timestamp for the start of the blackout period
type: string
format: date-time
end:
title: End
description: The ISO 8601 timestamp for the end of the blackout period
type: string
format: date-time
CourseMetadataSerailizer:
required:
- id
- blackouts
- thread_list_url
- following_thread_list_url
- topics_url
- allow_anonymous
- allow_anonymous_to_peers
- user_roles
- user_is_privileged
- provider
- enable_in_context
- group_at_subsection
- post_close_reasons
- edit_reasons
type: object
properties:
id:
title: Id
description: The identifier of the course
type: string
blackouts:
description: A list of objects representing blackout periods (during which discussions are read-only except for privileged users).
type: array
items:
$ref: '#/components/schemas/BlackoutDate'
thread_list_url:
title: Thread list url
description: The URL of the list of all threads in the course.
type: string
format: uri
minLength: 1
following_thread_list_url:
title: Following thread list url
description: thread_list_url with parameter following=True
type: string
format: uri
minLength: 1
topics_url:
title: Topics url
description: The URL of the topic listing for the course.
type: string
format: uri
minLength: 1
allow_anonymous:
title: Allow anonymous
description: A boolean indicating whether anonymous posts are allowed or not.
type: boolean
allow_anonymous_to_peers:
title: Allow anonymous to peers
description: A boolean indicating whether posts anonymous to peers are allowed or not.
type: boolean
user_roles:
description: A list of all the roles the requesting user has for this course.
type: array
items:
type: string
minLength: 1
user_is_privileged:
title: User is privileged
description: A boolean indicating if the current user has a privileged role
type: boolean
provider:
title: Provider
description: The discussion provider used by this course
type: string
minLength: 1
enable_in_context:
title: Enable in context
description: A boolean indicating whether in-context discussion is enabled for the course
type: boolean
group_at_subsection:
title: Group at subsection
description: A boolean indicating whether discussions should be grouped at subsection
type: boolean
post_close_reasons:
description: A list of reasons that can be specified by moderators for closing a post
type: array
items:
$ref: '#/components/schemas/ReasonCodeSeralizer'
edit_reasons:
description: A list of reasons that can be specified by moderators for editing a post, response, or comment
type: array
items:
$ref: '#/components/schemas/ReasonCodeSeralizer'
securitySchemes:
Basic:
type: http
scheme: basic