openapi: 3.0.3
info:
title: Open edX API
description: APIs for access to Open edX information
contact:
email: [email protected]
version: v1
servers:
- url: https://open.kaznu.kz/api
paths:
/agreements/v1/integrity_signature/{course_id}:
get:
operationId: agreements_v1_integrity_signature_read
summary: In order to check whether the user has signed the integrity agreement
for a given course.
description: "Should return the following:\n username (str)\n course_id\
\ (str)\n created_at (str)\n\nIf a username is not given, it should default\
\ to the requesting user (or masqueraded user).\nOnly staff should be able\
\ to access this endpoint for other users."
tags:
- agreements
parameters:
- name: course_id
in: path
required: true
schema:
type: string
responses:
'200':
description: ''
post:
operationId: agreements_v1_integrity_signature_create
description: "Create an integrity signature for the requesting user and course.\
\ If a signature\nalready exists, returns the existing signature instead of\
\ creating a new one.\n\n/api/agreements/v1/integrity_signature/{course_id}\n\
\nExample response:\n {\n username: \"janedoe\",\n course_id:\
\ \"org.2/course_2/Run_2\",\n created_at: \"2021-04-23T18:25:43.511Z\"\
\n }"
tags:
- agreements
parameters:
- name: course_id
in: path
required: true
schema:
type: string
responses:
'201':
description: ''
/agreements/v1/lti_pii_signature/{course_id}:
post:
operationId: agreements_v1_lti_pii_signature_create
description: "Create an LTI PII signature for the requesting user and course.\
\ If a signature\nalready exists, returns the existing signature instead of\
\ creating a new one.\n\n/api/agreements/v1/lti_pii_signature/{course_id}\n\
\nExample response:\n {\n username: \"janedoe\",\n course_id:\
\ \"org.2/course_2/Run_2\",\n created_at: \"2021-04-23T18:25:43.511Z\"\
\n }"
tags:
- agreements
parameters:
- name: course_id
in: path
required: true
schema:
type: string
responses:
'201':
description: ''
/bookmarks/v1/bookmarks/:
get:
operationId: bookmarks_v1_bookmarks_list
summary: Get a paginated list of bookmarks for a user.
description: 'The list can be filtered by passing parameter "course_id=<course_id>"
to only include bookmarks from a particular course.
The bookmarks are always sorted in descending order by creation date.
Each page in the list contains 10 bookmarks by default. The page
size can be altered by passing parameter "page_size=<page_size>".
To include the optional fields pass the values in "fields" parameter
as a comma separated list. Possible values are:
* "display_name"
* "path"
**Example Requests**
GET /api/bookmarks/v1/bookmarks/?course_id={course_id1}&fields=display_name,path'
tags:
- bookmarks
parameters:
- name: page
in: query
required: false
description: A page number within the paginated result set.
schema:
type: integer
- name: page_size
in: query
required: false
description: Number of results to return per page.
schema:
type: integer
- name: course_id
in: query
required: false
description: The id of the course to limit the list
schema:
type: string
- name: fields
in: query
required: false
description: 'The fields to return: display_name, path.'
schema:
type: string
responses:
'200':
description: ''
content:
application/json:
schema:
required:
- count
- results
type: object
properties:
count:
type: integer
next:
type: string
format: uri
nullable: true
previous:
type: string
format: uri
nullable: true
results:
type: array
items:
$ref: '#/components/schemas/Bookmark'
post:
operationId: bookmarks_v1_bookmarks_create
summary: Create a new bookmark for a user.
description: 'The POST request only needs to contain one parameter "usage_id".
Http400 is returned if the format of the request is not correct,
the usage_id is invalid or a block corresponding to the usage_id
could not be found.
**Example Requests**
POST /api/bookmarks/v1/bookmarks/
Request data: {"usage_id": <usage-id>}'
tags:
- bookmarks
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Bookmark'
responses:
'201':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/Bookmark'
/bookmarks/v1/bookmarks/{username},{usage_id}/:
get:
operationId: bookmarks_v1_bookmarks_read
summary: Get a specific bookmark for a user.
description: '**Example Requests**
GET /api/bookmarks/v1/bookmarks/{username},{usage_id}?fields=display_name,path'
tags:
- bookmarks
parameters:
- name: username
in: path
required: true
schema:
type: string
- name: usage_id
in: path
required: true
schema:
type: string
responses:
'200':
description: ''
delete:
operationId: bookmarks_v1_bookmarks_delete
description: DELETE /api/bookmarks/v1/bookmarks/{username},{usage_id}
tags:
- bookmarks
parameters:
- name: username
in: path
required: true
schema:
type: string
- name: usage_id
in: path
required: true
schema:
type: string
responses:
'204':
description: ''
/certificates/v0/certificates/{username}/:
get:
operationId: certificates_v0_certificates_read
summary: Get a paginated list of certificates for a user.
description: "**Use Case**\n\nGet the list of viewable course certificates for\
\ a specific user.\n\n**Example Request**\n\nGET /api/certificates/v0/certificates/{username}\n\
\n**GET Response Values**\n\n If the request for information about the\
\ user's certificates is successful,\n an HTTP 200 \"OK\" response is returned.\n\
\n The HTTP 200 response contains a list of dicts with the following keys/values.\n\
\n * username: A string representation of an user's username passed in\
\ the request.\n\n * course_id: A string representation of a Course ID.\n\
\n * course_display_name: A string representation of the Course name.\n\
\n * course_organization: A string representation of the organization associated\
\ with the Course.\n\n * certificate_type: A string representation of the\
\ certificate type.\n Can be honor|verified|professional\n\n * created_date:\
\ Date/time the certificate was created, in ISO-8661 format.\n\n * status:\
\ A string representation of the certificate status.\n\n * is_passing:\
\ True if the certificate has a passing status, False if not.\n\n * download_url:\
\ A string representation of the certificate url.\n\n * grade: A string\
\ representation of a float for the user's course grade.\n\n**Example GET\
\ Response**\n\n [{\n \"username\": \"bob\",\n \"course_id\"\
: \"edX/DemoX/Demo_Course\",\n \"certificate_type\": \"verified\",\n\
\ \"created_date\": \"2015-12-03T13:14:28+0000\",\n \"status\"\
: \"downloadable\",\n \"is_passing\": true,\n \"download_url\"\
: \"http://www.example.com/cert.pdf\",\n \"grade\": \"0.98\"\n }]"
tags:
- certificates
parameters:
- name: username
in: path
required: true
schema:
type: string
- name: username
in: path
required: true
description: The users to get certificates for
schema:
type: string
responses:
'200':
description: ''
/certificates/v0/certificates/{username}/courses/{course_id}/:
get:
operationId: certificates_v0_certificates_courses_read
description: Retrieves certificate information for a user in a specified course
run.
tags:
- certificates
parameters:
- name: username
in: path
required: true
schema:
type: string
- name: course_id
in: path
required: true
schema:
type: string
responses:
'200':
description: ''
/change_email_settings:
post:
operationId: change_email_settings_create
description: Modify logged-in user's setting for receiving emails from a course.
tags:
- change_email_settings
responses:
'201':
description: ''
/cohorts/v1/courses/{course_key_string}/cohorts/{cohort_id}:
get:
operationId: cohorts_v1_courses_cohorts_read
description: Endpoint to get either one or all cohorts.
tags:
- cohorts
parameters:
- name: course_key_string
in: path
required: true
schema:
type: string
- name: cohort_id
in: path
required: true
schema:
type: string
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties: {}
post:
operationId: cohorts_v1_courses_cohorts_create
description: Endpoint to create a new cohort, must not include cohort_id.
tags:
- cohorts
parameters:
- name: course_key_string
in: path
required: true
schema:
type: string
- name: cohort_id
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
type: object
properties: {}
responses:
'201':
description: ''
content:
application/json:
schema:
type: object
properties: {}
patch:
operationId: cohorts_v1_courses_cohorts_partial_update
description: Endpoint to update a cohort name and/or assignment type.
tags:
- cohorts
parameters:
- name: course_key_string
in: path
required: true
schema:
type: string
- name: cohort_id
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
type: object
properties: {}
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties: {}
/cohorts/v1/courses/{course_key_string}/cohorts/{cohort_id}/users/{username}:
get:
operationId: cohorts_v1_courses_cohorts_users_read
description: Lists the users in a specific cohort.
tags:
- cohorts
parameters:
- name: course_key_string
in: path
required: true
schema:
type: string
- name: cohort_id
in: path
required: true
schema:
type: string
- name: username
in: path
required: true
schema:
type: string
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/CohortUsersAPI'
post:
operationId: cohorts_v1_courses_cohorts_users_create
description: Add given users to the cohort.
tags:
- cohorts
parameters:
- name: course_key_string
in: path
required: true
schema:
type: string
- name: cohort_id
in: path
required: true
schema:
type: string
- name: username
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CohortUsersAPI'
responses:
'201':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/CohortUsersAPI'
delete:
operationId: cohorts_v1_courses_cohorts_users_delete
description: Removes and user from a specific cohort.
tags:
- cohorts
parameters:
- name: course_key_string
in: path
required: true
schema:
type: string
- name: cohort_id
in: path
required: true
schema:
type: string
- name: username
in: path
required: true
schema:
type: string
responses:
'204':
description: ''
/cohorts/v1/courses/{course_key_string}/users:
post:
operationId: cohorts_v1_courses_users_create
description: 'View method that accepts an uploaded file (using key "uploaded-file")
containing cohort assignments for users. This method spawns a celery task
to do the assignments, and a CSV file with results is provided via data downloads.'
tags:
- cohorts
parameters:
- name: course_key_string
in: path
required: true
schema:
type: string
responses:
'201':
description: ''
/cohorts/v1/settings/{course_key_string}:
get:
operationId: cohorts_v1_settings_read
description: Endpoint to fetch the course cohort settings.
tags:
- cohorts
parameters:
- name: course_key_string
in: path
required: true
schema:
type: string
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties: {}
put:
operationId: cohorts_v1_settings_update
description: Endpoint to set the course cohort settings.
tags:
- cohorts
parameters:
- name: course_key_string
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
type: object
properties: {}
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties: {}
/commerce/v0/baskets/:
post:
operationId: commerce_v0_baskets_create
description: Attempt to enroll the user.
tags:
- commerce
responses:
'201':
description: ''
/commerce/v0/baskets/{basket_id}/order/:
get:
operationId: commerce_v0_baskets_order_list
description: HTTP handler.
tags:
- commerce
parameters:
- name: basket_id
in: path
required: true
schema:
type: string
responses:
'200':
description: ''
/commerce/v1/courses/:
get:
operationId: commerce_v1_courses_list
description: List courses and modes.
tags:
- commerce
responses:
'200':
description: ''
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/commerce.Course'
/commerce/v1/courses/{course_id}/:
get:
operationId: commerce_v1_courses_read
description: Retrieve, update, or create courses/modes.
tags:
- commerce
parameters:
- name: course_id
in: path
required: true
schema:
type: string
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/commerce.Course'
put:
operationId: commerce_v1_courses_update
description: Retrieve, update, or create courses/modes.
tags:
- commerce
parameters:
- name: course_id
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/commerce.Course'
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/commerce.Course'
patch:
operationId: commerce_v1_courses_partial_update
description: Retrieve, update, or create courses/modes.
tags:
- commerce
parameters:
- name: course_id
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/commerce.Course'
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/commerce.Course'
/commerce/v1/orders/{number}/:
get:
operationId: commerce_v1_orders_read
description: HTTP handler.
tags:
- commerce
parameters:
- name: number
in: path
required: true
schema:
type: string
responses:
'200':
description: ''
/completion/v1/completion-batch:
post:
operationId: completion_v1_completion-batch_create
summary: Inserts a batch of completions.
description: "REST Endpoint Format:\n```\n{\n \"username\": \"username\",\n\
\ \"course_key\": \"course-key\",\n \"blocks\": {\n \"block_key1\": 0.0,\n\
\ \"block_key2\": 1.0,\n \"block_key3\": 1.0,\n }\n}\n```\n\n**Returns**\n\
\nA Response object, with an appropriate status code.\n\nIf successful, status\
\ code is 200.\n```\n{\n \"detail\" : _(\"ok\")\n}\n```\n\nOtherwise, a\
\ 400 or 404 may be returned, and the \"detail\" content will explain the\
\ error."
tags:
- completion
responses:
'201':
description: ''
/completion/v1/subsection-completion/{username}/{course_key}/{subsection_id}:
get:
operationId: completion_v1_subsection-completion_read
description: Returns completion for a (user, subsection, course).
tags:
- completion
parameters:
- name: username
in: path
required: true
schema:
type: string
- name: course_key
in: path
required: true
schema:
type: string
- name: subsection_id
in: path
required: true
schema:
type: string
responses:
'200':
description: ''
/course_experience/v1/course_deadlines_info/{course_key_string}:
get:
operationId: course_experience_v1_course_deadlines_info_read
summary: '**Use Cases**'
description: "Request course deadline info for mobile\n\n**Example Requests**\n\
\n GET api/course_experience/v1/course_deadlines_info/{course_key}\n\n\
**Response Values**\n\n Body consists of the following fields:\n\n dates_banner_info:\
\ (obj)\n missed_deadlines: (bool) Whether the user has missed any\
\ graded content deadlines for the given course.\n missed_gated_content:\
\ (bool) Whether the user has missed any gated content for the given course.\n\
\ content_type_gating_enabled: (bool) Whether content type gating is\
\ enabled for this enrollment.\n verified_upgrade_link: (str) The URL\
\ to ecommerce IDA for purchasing the verified upgrade.\n\n**Returns**\n\n\
\ * 200 on success with above fields.\n * 401 if the user is not authenticated.\n\
\ * 404 if the course is not available or cannot be seen."
tags:
- course_experience
parameters:
- name: course_key_string
in: path
required: true
schema:
type: string
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/CourseDeadlinesMobile'
/course_experience/v1/reset_course_deadlines:
post:
operationId: course_experience_v1_reset_course_deadlines_create
description: "Set the start_date of a schedule to today, which in turn will\
\ adjust due dates for\nsequentials belonging to a self paced course\n\nRequest\
\ Parameters:\n course_key: course key\n research_event_data: any data\
\ that should be included in the research tracking event\n Example:\
\ sending the location of where the reset deadlines banner (i.e. outline-tab)\n\
\nIMPORTANT NOTE: If updates are happening to the logic here, ALSO UPDATE\
\ the `reset_course_deadlines`\nfunction in common/djangoapps/util/views.py\
\ as well."
tags:
- course_experience
responses:
'201':
description: ''
/course_home/course_metadata/{course_key_string}:
get:
operationId: course_home_course_metadata_read
summary: '**Use Cases**'
description: "Request Course metadata details for the Course Home MFE that every\
\ page needs.\n\n**Example Requests**\n\n GET api/course_home/v1/course_metadata/{course_key}\n\
\n**Response Values**\n\n Body consists of the following fields:\n\n \
\ course_id: (str) The Course's id (Course Run key)\n username: (str)\
\ The requesting (or masqueraded) user. Returns None for an\n unauthenticated\
\ user.\n is_enrolled: (bool) Indicates if the user is enrolled in the\
\ course\n is_self_paced: (bool) Indicates if the course is self paced\n\
\ is_staff: (bool) Indicates if the user is staff\n original_user_is_staff:\
\ (bool) Indicates if the original user has staff access\n Used for\
\ when masquerading to distinguish between the original requesting user\n\
\ and the user being masqueraded as.\n number: (str) The Course's\
\ number\n org: (str) The Course's organization\n tabs: List of Course\
\ Tabs to display. They are serialized as:\n tab_id: (str) The tab's\
\ id\n title: (str) The title of the tab to display\n url: (str)\
\ The url to view the tab\n title: (str) The Course's display title\n \
\ celebrations: (dict) a dict of celebration data\n user_timezone: (str)\
\ The timezone of the given user\n can_view_certificate: Flag to determine\
\ whether or not the learner can view their course certificate.\n\n**Returns**\n\
\n * 200 on success with above fields.\n * 404 if the course is not\
\ available or cannot be seen."
tags:
- course_home
parameters:
- name: course_key_string
in: path
required: true
schema:
type: string
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/CourseHomeMetadata'
/course_home/dates/{course_key_string}:
get:
operationId: course_home_dates_read
summary: '**Use Cases**'
description: "Request details for the Dates Tab\n\n**Example Requests**\n\n\
\ GET api/course_home/v1/dates/{course_key}\n\n**Response Values**\n\n\
\ Body consists of the following fields:\n\n course_date_blocks: List\
\ of serialized DateSummary objects. Each serialization has the following\
\ fields:\n complete: (bool) Meant to only be used by assignments.\
\ Indicates completeness for an\n assignment.\n date: (datetime)\
\ The date time corresponding for the event\n date_type: (str) The\
\ type of date (ex. course-start-date, assignment-due-date, etc.)\n \
\ description: (str) The description for the date event\n learner_has_access:\
\ (bool) Indicates if the learner has access to the date event\n link:\
\ (str) An absolute link to content related to the date event\n \
\ (ex. verified link or link to assignment)\n title: (str) The title\
\ of the date event\n dates_banner_info: (obj)\n content_type_gating_enabled:\
\ (bool) Whether content type gating is enabled for this enrollment.\n \
\ missed_deadlines: (bool) Indicates whether the user missed any graded\
\ content deadlines\n missed_gated_content: (bool) Indicates whether\
\ the user missed gated content\n verified_upgrade_link: (str) The\
\ link for upgrading to the Verified track in a course\n has_ended: (bool)\
\ Indicates whether course has ended\n learner_is_full_access: (bool) Indicates\
\ if the user is verified in the course\n user_timezone: (str) The user's\
\ preferred timezone\n\n**Returns**\n\n * 200 on success with above fields.\n\
\ * 401 if the user is not authenticated.\n * 403 if the user does not\
\ have access to the course.\n * 404 if the course is not available or\
\ cannot be seen."
tags:
- course_home
parameters:
- name: course_key_string
in: path
required: true
schema:
type: string
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/DatesTab'
/course_home/dismiss_welcome_message:
post:
operationId: course_home_dismiss_welcome_message_create
description: ''
tags:
- course_home
responses:
'201':
description: ''
/course_home/navigation/{course_key_string}:
get:
operationId: course_home_navigation_read
description: Get the visible course blocks (from course to vertical types) for
the given course.
tags:
- course_home
parameters:
- name: course_key_string
in: path
required: true
schema:
type: string
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/CourseBlock'
/course_home/outline/{course_key_string}:
get:
operationId: course_home_outline_read
summary: '**Use Cases**'
description: "Request details for the Outline Tab\n\n**Example Requests**\n\n\
\ GET api/course_home/v1/outline/{course_key}\n\n**Response Values**\n\n\
\ Body consists of two possible shapes.\n\n For a good 200 response,\
\ the response will include:\n\n access_expiration: An object detailing\
\ when access to this course will expire\n expiration_date: (str) When\
\ the access expires, in ISO 8601 notation\n masquerading_expired_course:\
\ (bool) Whether this course is expired for the masqueraded user\n \
\ upgrade_deadline: (str) Last chance to upgrade, in ISO 8601 notation (or\
\ None if can't upgrade anymore)\n upgrade_url: (str) Upgrade link\
\ (or None if can't upgrade anymore)\n course_blocks:\n blocks:\
\ List of serialized Course Block objects. Each serialization has the following\
\ fields:\n id: (str) The usage ID of the block.\n type:\
\ (str) The type of block. Possible values the names of any\n \
\ XBlock type in the system, including custom blocks. Examples are\n \
\ course, chapter, sequential, vertical, html, problem, video,\
\ and\n discussion.\n display_name: (str) The display\
\ name of the block.\n lms_web_url: (str) The URL to the navigational\
\ container of the\n xBlock on the web LMS.\n children:\
\ (list) If the block has child blocks, a list of IDs of\n \
\ the child blocks.\n resume_block: (bool) Whether the block is\
\ the resume block\n has_scheduled_content: (bool) Whether the\
\ block has more content scheduled for the future\n course_goals:\n \
\ selected_goal:\n days_per_week: (int) The number of days\
\ the learner wants to learn per week\n subscribed_to_reminders:\
\ (bool) Whether the learner wants email reminders about their goal\n \
\ weekly_learning_goal_enabled: Flag indicating if this feature is enabled\
\ for this call\n course_tools: List of serialized Course Tool objects.\
\ Each serialization has the following fields:\n analytics_id: (str)\
\ The unique id given to the tool.\n title: (str) The display title\
\ of the tool.\n url: (str) The link to access the tool.\n dates_banner_info:\
\ (obj)\n content_type_gating_enabled: (bool) Whether content type\
\ gating is enabled for this enrollment.\n missed_deadlines: (bool)\
\ Whether the user has missed any graded content deadlines for the given course.\n\
\ missed_gated_content: (bool) Whether the user has missed any gated\
\ content for the given course.\n verified_upgrade_link: (str) The\
\ URL to ecommerce IDA for purchasing the verified upgrade.\n dates_widget:\n\
\ course_date_blocks: List of serialized Course Dates objects. Each\
\ serialization has the following fields:\n complete: (bool) Meant\
\ to only be used by assignments. Indicates completeness for an\n \
\ assignment.\n date: (datetime) The date time corresponding\
\ for the event\n date_type: (str) The type of date (ex. course-start-date,\
\ assignment-due-date, etc.)\n description: (str) The description\
\ for the date event\n learner_has_access: (bool) Indicates if\
\ the learner has access to the date event\n link: (str) An absolute\
\ link to content related to the date event\n (ex. verified\
\ link or link to assignment)\n title: (str) The title of the date\
\ event\n dates_tab_link: (str) The URL to the Dates Tab\n user_timezone:\
\ (str) The timezone of the given user\n enroll_alert:\n can_enroll:\
\ (bool) Whether the user can enroll in the given course\n extra_text:\
\ (str)\n enrollment_mode: (str) Current enrollment mode. Null if the user\
\ is not enrolled.\n handouts_html: (str) Raw HTML for the handouts section\
\ of the course info\n has_ended: (bool) Indicates whether course has ended\n\
\ offer: An object detailing upgrade discount information\n cod
# --- truncated at 32 KB (444 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/al-farabi-kazakh-national-university/refs/heads/main/openapi/al-farabi-kazakh-national-university-open-edx.yaml