Skip to content

Unify Certificate Generation and Regeneration APIs into a Single Endpoint #36961

Open
@awais786

Description

@awais786

These apis can be converted into one single api.

Currently, we have three separate API endpoints for initiating certificate-related tasks:

path('enable_certificate_generation', api.enable_certificate_generation, name='enable_certificate_generation'),

enable_certificate_generation - enables or disables self-generated certificates for students.
start_certificate_generation – starts generation for all enrolled students.
start_certificate_regeneration – regenerates certificates based on provided certificate_statuses.

All endpoints perform similar operations (triggering background tasks for a course), but differ slightly in required input and logic. To simplify API usage, reduce duplication, and improve maintainability, we propose merging both endpoints into a single unified API.

Proposed Changes:

Introduce a unified API endpoint:
/certificate_task/<course_id>

Use a mode parameter in POST data to determine the action:

generate
regenerate
toggle


You'll also need to update the frontend code to replace all usages of the old endpoints with the new unified API.

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