Group Users

Schema #

The schema defines all the fields that exist within a group 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

Context: view, edit

List Group Users #

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

Definition #

GET /ldlms/v1/groups/<id>/users

Example Request #

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

Arguments #

id

Group ID to enroll group leader into.

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 Group User #

Arguments #

id

Group ID to enroll group leader into.

Required: 1

user_ids

User IDs to enroll into Group.

Required: 1

Definition #

POST /ldlms/v1/groups/<id>/users

Example Request #

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

Delete a Group User #

Arguments #

id

Group ID to enroll group leader into.

Required: 1

user_ids

User IDs to remove from Group.

Required: 1

Definition #

DELETE /ldlms/v1/groups/<id>/users

Example Request #

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