Course Users

Schema #

The schema defines all the fields that exist within a course users 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 user.

Read only

Context: embed, view, edit

username
string

Login name for the user.

Context: edit

name
string

Display name for the user.

Context: embed, view, edit

first_name
string

First name for the user.

Context: edit

last_name
string

Last name for the user.

Context: edit

email
string, email

The email address for the user.

Context: edit

url
string, uri

URL of the user.

Context: embed, view, edit

description
string

Description of the user.

Context: embed, view, edit

locale
string

Locale for the user.

Context: edit

One of: , en_US, de_DE, en_GB, es_ES, fr_FR

nickname
string

The nickname for the user.

Context: edit

slug
string

An alphanumeric identifier for the user.

Context: embed, view, edit

registered_date
string, datetime (details)

Registration date for the user.

Read only

Context: edit

roles
array

Roles assigned to the user.

Context: edit

password
string

Password for the user (never included).

Context:

capabilities
object

All capabilities assigned to the user.

Read only

Context: edit

extra_capabilities
object

Any extra capabilities assigned to the user.

Read only

Context: edit

avatar_urls
object

Avatar URLs for the user.

Read only

Context: embed, view, edit

meta
object

Meta fields.

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/v2/sfwd-courses/<id>/users

Example Request #

$ curl https://example.com/wp-json/ldlms/v2/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

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.

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

orderby

Sort collection by object attribute.

Default: name

One of: id, include, name, registered_date, slug, include_slugs, email, url

slug

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

roles

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

who

Limit result set to users who are considered authors.

One of: authors

Update a Course Users #

Arguments #

id

Course ID.

Required: 1

user_ids

User IDs to update in Course. Limit 50 per request.

Required: 1

Definition #

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

Example Request #

Delete a Course Users #

Arguments #

id

Course ID.

Required: 1

user_ids

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

Required: 1

Definition #

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

Example Request #

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