Skip to content

Searches for WordPress users who are not yet enrolled in the course, for the add-student picker.

Limited to 100 candidates. Email addresses are only included for callers with the WordPress list_users capability. On multisite the search is restricted to users with capabilities on the current site.

Endpoint

  • Method: GET

  • Path: /admin/courses/{course_id}/users/search

  • Edition: Core

  • Controller: CourseAdminController@getOtherUsers

  • Route source: fluent-community/Modules/Course/Http/course_api.php:35

  • Controller source: fluent-community/Modules/Course/Http/Controllers/CourseAdminController.php

  • Requires a course admin for this course, or a WordPress user with manage_options.

Live sample

The request and response below were recorded against a running FluentCommunity install and then anonymised — member names, emails, avatars and post content are fictional, and long collections are trimmed to a few entries.

GET Search Course Users

GET
/admin/courses/{course_id}/users/search

Searches for WordPress users who are not yet enrolled in the course, for the add-student picker.

Controller: CourseAdminController@getOtherUsers
Route source: fluent-community/Modules/Course/Http/course_api.php:35

Authorizations

ApplicationPasswords

WordPress Application Passwords — use Basic auth with username:application_password.

Type
API Key (header: Authorization)

Parameters

Path Parameters

course_id*

Course ID extracted from the URL path.

Type
integer
Required

Query Parameters

search

Search read via $request->getSafe() in getOtherUsers().

Type
string

Responses

Successful response

application/json
JSON
{
  
"users": {
  
  
"current_page": 0,
  
  
"data": [
  
  
  
{
  
  
  
  
"ID": 0,
  
  
  
  
"display_name": "string",
  
  
  
  
"photo": "string",
  
  
  
  
"user_email": "string"
  
  
  
}
  
  
],
  
  
"first_page_url": "string",
  
  
"from": 0,
  
  
"last_page": 0,
  
  
"last_page_url": "string",
  
  
"links": [
  
  
  
{
  
  
  
  
"active": true,
  
  
  
  
"label": "string",
  
  
  
  
"url": "string"
  
  
  
}
  
  
],
  
  
"next_page_url": "string",
  
  
"path": "string",
  
  
"per_page": 0,
  
  
"prev_page_url": "string",
  
  
"to": 0,
  
  
"total": 0
  
}
}

Playground

Authorization
Variables
Key
Value

Samples

Powered by VitePress OpenAPI

FluentCommunity developer documentation