Skip to content

Migrate Enrollment API callers from v1 to v2 (FC-0118) #1936

Description

@taimoor-ahmed-1

Summary

The Enrollment REST API on edx-platform has been standardized under FC-0118 (ADRs 0025–0040) and re-released as /api/enrollment/v2/. frontend-app-learning is one of four MFEs that currently call the v1 endpoints and needs to migrate.

The v1 endpoints remain live (no immediate breakage). The v2 endpoints add a standardized error envelope, OpenAPI 3.x schemas, and consistent auth (JwtAuthentication + SessionAuthenticationAllowInactiveUser, no BearerAuthentication/OAuth2Authentication).

Endpoints to migrate

Old URL New URL
GET /api/enrollment/v1/enrollment GET /api/enrollment/v2/enrollment/
POST /api/enrollment/v1/enrollment POST /api/enrollment/v2/enrollment/

Call sites (grepped 2026-07-03)

GET /api/enrollment/v1/enrollment — list caller's enrollments

  • src/courseware/course/course-exit/data/api.js:32,35 — Course Exit / recommendations screen

POST /api/enrollment/v1/enrollment — enroll

  • src/alerts/enrollment-alert/data/api.js:6,7 — Enrollment Alert banner on the outline (postCourseEnrollment)

Tests referencing the v1 URL (update alongside):

  • src/course-home/outline-tab/OutlineTab.test.jsx

Notes on the response envelope

Errors now follow the ADR 0029 standardized format. Code that reads response.data.detail may need to read response.data.error.detail. Success payloads are unchanged.

References

  • edx-platform PRs #38724, #38773, #38796
  • FC-0118 ADRs: docs/decisions/0025-* through 0040-* on edx-platform

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions