openedx.core.djangoapps.programs.rest_api.v1 package#

Submodules#

openedx.core.djangoapps.programs.rest_api.v1.urls module#

REST APIs for Programs.

openedx.core.djangoapps.programs.rest_api.v1.views module#

Views for the Programs REST API v1.

class openedx.core.djangoapps.programs.rest_api.v1.views.ProgramProgressDetailView(**kwargs)#

Bases: APIView

Endpoints For Program Progress Meter

get(request: HttpRequest, program_uuid: str) HttpResponse#

Retrieves progress details of a learner in a specified program.

Example Request

GET api/dashboard/v1/programs/{program_uuid}/progress_details/

Parameters

  • program_uuid: A string representation of the uuid of the program.

Response Values

If the request for information about the program is successful, an HTTP 200 “OK” response is returned.

The HTTP 200 response has the following values.

  • urls: Urls to enroll/purchase a course or view program record.

  • program_data: Holds meta information about the program.

  • course_data: Learner’s progress details for all courses in the program (in-progress/remaining/completed).

  • certificate_data: Details about learner’s certificates status for all courses in the program and the

    program itself.

  • industry_pathways: Industry pathways for the program, comes under additional credit opportunities.

  • credit_pathways: Credit pathways for the program, comes under additional credit opportunities.

Example Response

{
“urls”: {

“program_listing_url”: “/dashboard/programs/”, “track_selection_url”: “/course_modes/choose/”, “commerce_api_url”: “/api/commerce/v1/baskets/”, “buy_button_url”: “http://example.com/basket/add/?”, “program_record_url”: “https://example.com/records/programs/8675309

}, “program_data”: {

“uuid”: “a156a6e2-de91-4ce7-947a-888943e6b12a”, “title”: “Demonstration Program”, “subtitle”: “”, “type”: “MicroMasters”, “status”: “active”, “marketing_slug”: “demo-program”, “marketing_url”: “micromasters/demo-program”, “authoring_organizations”: [], “card_image_url”: “http://example.com/asset-v1:DemoX+Demo_Course.jpg”, “is_program_eligible_for_one_click_purchase”: false, “pathway_ids”: [

1, 2

], “is_learner_eligible_for_one_click_purchase”: false, “skus”: [“AUD90210”],

}, “course_data”: {

“uuid”: “a156a6e2-de91-4ce7-947a-888943e6b12a”, “completed”: [], “in_progress”: [], “not_started”: [

{

“key”: “example+DemoX”, “uuid”: “fe1a9ad4-a452-45cd-80e5-9babd3d43f96”, “title”: “Demonstration Course”, “course_runs”: [], “entitlements”: [], “owners”: [], “image”: “”, “short_description”: “”, “type”: “457f07ec-a78f-45b4-ba09-5fb176520d8a”,

}

],

}, “certificate_data”: [{

“type”: “course”, “title”: “Demo Course”, ‘url’: “/certificates/8675309”,

}], “industry_pathways”: [

{

“id”: 2, “uuid”: “1b8fadf1-f6aa-4282-94e3-325b922a027f”, “name”: “Demo Industry Pathway”, “org_name”: “example”, “email”: “example@example.com”, “description”: “Sample demo industry pathway”, “destination_url”: “http://example.edu/online/pathways/example-methods”, “pathway_type”: “industry”, “program_uuids”: [

“a156a6e2-de91-4ce7-947a-888943e6b12a”

]

}

], “credit_pathways”: [

{

“id”: 1, “uuid”: “86b9701a-61e6-48a2-92eb-70a824521c1f”, “name”: “Demo Credit Pathway”, “org_name”: “example”, “email”: “example@example.com”, “description”: “Sample demo credit pathway!”, “destination_url”: “http://example.edu/online/pathways/example-thinking”, “pathway_type”: “credit”, “program_uuids”: [

“a156a6e2-de91-4ce7-947a-888943e6b12a”

]

}

]

}

permission_classes = (<class 'rest_framework.permissions.IsAuthenticated'>,)#
class openedx.core.djangoapps.programs.rest_api.v1.views.Programs(**kwargs)#

Bases: APIView

Program endpoints

get(request: HttpRequest, enterprise_uuid: str = '') HttpResponse#

For a learner, get list of enrolled programs with progress. If an enterprise UUID ias provided, filter out all non-enterprise enrollments for the learner.

Example Request

GET /api/dashboard/v1/programs/{enterprise_uuid}/

Parameters

  • enterprise_uuid: UUID of an enterprise customer.

Example Response

[
{

“uuid”: “ff41a5eb-2a73-4933-8e80-a1c66068ed2c”, “title”: “Demonstration Program”, “type”: “MicroMasters”, “banner_image”: {

“large”: {

“url”: “http://example.com/images/foo.large.jpg”, “width”: 1440, “height”: 480

}, “medium”: {

“url”: “http://example.com/images/foo.medium.jpg”, “width”: 726, “height”: 242

}, “small”: {

“url”: “http://example.com/images/foo.small.jpg”, “width”: 435, “height”: 145

}, “x-small”: {

“url”: “http://example.com/images/foo.x-small.jpg”, “width”: 348, “height”: 116

}

}, “authoring_organizations”: [

{

“key”: “example”

}

], “progress”: {

“uuid”: “ff41a5eb-2a73-4933-8e80-a1c66068ed2c”, “completed”: 0, “in_progress”: 0, “not_started”: 2

}

}

]

permission_classes = (<class 'rest_framework.permissions.IsAuthenticated'>,)#

Module contents#