nelc / futurex-openedx-extensions

Open edX APIs and reporting tools
Other
0 stars 0 forks source link

feat: course details and course statuses APIs #6

Closed shadinaif closed 4 months ago

shadinaif commented 5 months ago

Fixes:

New:

Course Details

GET /api/fx/courses/v1/courses?page=<pageNumber>&page_size=<pageSize>&tenant_ids=<tenantIds>&search_text=<searchText>&sort=<sortFields>

<pageNumber> (optional): page number used by pagination. If not passed, the first page will be returned
<pageSize> (optional): page size used by pagination. If not passed, it’ll be assumed as 20 records
<tenantIds> (optional): a comma-separated list of the tenant IDs to get the information for. If not provided, the API will assume the list of all accessible tenants by the user
<searchText> (optional): filter to be used against the course display name and code
<sortFields> (optional): sort the result by the given fields. The default is display_name. The value can be one or more fields, with the use of ( - ) to indicate descending sorting (id, self_paced, enrolled_count, active_count, certificates_count, display_name, org)

Examples:

The first page of the list of courses for all accessible tenants

GET /api/fx/courses/v1/courses

The first page of the list of courses for all accessible tenants, sorted by enrolled_count descending then display_name ascending

GET /api/fx/courses/v1/courses&sort=-enrolled_count,display_name

The second page of the list of courses for all accessible tenants, for those having Sh in the display name or code

GET /api/fx/courses/v1/courses?page=2&search_text=Sh

Course Statuses

GET /api/fx/statistics/v1/course_statuses/?tenant_ids=<tenantIds>

Total number of courses per status of course. There are six possible statuses, which are a composition of enrollment type (instructor-paced and self-paced) with status (ongoing, archived, and upcoming):

<tenantIds> (optional): a comma-separated list of the tenant IDs to get the information for. If not provided, the API will assume the list of all accessible tenants by the user

Examples:

Courses count in all accessible tenants

GET /api/fx/statistics/v1/course_statuses/

Courses count in tenants 1, 4, and 99

GET /api/fx/statistics/v1/course_statuses/?tenant_ids=1,4,99
OmarIthawi commented 5 months ago

still haven't finished reviewing it, will try to do that do by tomorrow morning

OmarIthawi commented 4 months ago

@shadinaif this has been deployed to production. Should we merge it?