Course Users

Schema #

The schema defines all the fields that exist within a course user record. Any response from these endpoints can be expected to contain the fields below unless the `_filter` query parameter is used or the schema field only appears in a specific context.

id
integer

Unique identifier for the object.

Read only

Context: view, edit, embed

user_ids
array

The user IDs. Limit 50 per request.

Context: view, edit

List Course Users #

Query this endpoint to retrieve a collection of course users. The response you receive can be controlled and filtered using the URL query parameters below.

Definition #

GET /ldlms/v1/sfwd-courses/<id>/users

Example Request #

$ curl https://example.com/wp-json/ldlms/v1/sfwd-courses/<id>/users

Arguments #

id

Course ID.

Required: 1

context

Scope under which the request is made; determines fields present in response.

Default: view

One of: view, embed, edit

fields

Returned values.

Default: ids

One of: ids, objects

exclude

Ensure result set excludes specific IDs.

include

Limit result set to specific IDs.

offset

Offset the result set by a specific number of items.

order

Order sort attribute ascending or descending.

Default: asc

One of: asc, desc

page

Current page of the collection.

Default: 1

per_page

Maximum number of items to be returned in result set.

Default: 10

search

Limit results to those matching a string.

roles

Limit result set to users matching at least one specific role provided. Accepts csv list or single role.

slug

Limit result set to users with one or more specific slugs.

Update a Course User #

Arguments #

id

Course ID.

Required: 1

user_ids

User IDs to enroll into Course. Limit 50 per request.

Required: 1

Definition #

POST /ldlms/v1/sfwd-courses/<id>/users

Example Request #

$ curl -X POST https://example.com/wp-json/ldlms/v1/sfwd-courses/<id>/users -d '{"user_ids":[ 1,2 ]}'

Delete a Course User #

Arguments #

id

Course ID.

Required: 1

user_ids

User IDs to remove from Group. Limit 50 per request.

Required: 1

Definition #

DELETE /ldlms/v1/sfwd-courses/<id>/users

Example Request #

$ curl -X DELETE https://example.com/wp-json/ldlms/v1/sfwd-courses/<id>/users