You are here

public function Users::getAll in Auth0 Single Sign On 8.2

Search all Users. Required scopes:

  • "read:users" - For any call to this endpoint.
  • "read:user_idp_tokens" - To retrieve the "access_token" field for logged-in identities.

@link https://auth0.com/docs/users/search/v3 @link https://auth0.com/docs/api/management/v2#!/Users/get_users

Parameters

array $params Search parameters to send::

  • "fields", "include_fields", "page", and "per_page" keys here will override the explicit parameters.
  • Queries using "search_engine" set to "v2" should be migrated to v3; see search v3 @link below.

null|string|array $fields Fields to include or exclude from the result.:

  • Including only the fields required can speed up API calls significantly.
  • Arrays will be converted to comma-separated strings.

null|boolean $include_fields True to include $fields, false to exclude $fields.:

null|integer $page Page number to get, zero-based.:

null|integer $per_page Number of results to get, null to return the default number.:

Return value

mixed

Throws

\Exception Thrown by the HTTP client when there is a problem with the API call.

1 call to Users::getAll()
Users::search in vendor/auth0/auth0-php/src/API/Management/Users.php
Wrapper for self::getAll().

File

vendor/auth0/auth0-php/src/API/Management/Users.php, line 127

Class

Users
Class Users. Handles requests to the Users endpoint of the v2 Management API.

Namespace

Auth0\SDK\API\Management

Code

public function getAll(array $params = [], $fields = null, $include_fields = null, $page = null, $per_page = null) {

  // Fields to include/exclude.
  if (!isset($params['fields']) && null !== $fields) {
    $params['fields'] = $fields;
  }
  if (isset($params['fields'])) {
    if (is_array($params['fields'])) {
      $params['fields'] = implode(',', $params['fields']);
    }
    if (!isset($params['include_fields']) && null !== $include_fields) {
      $params['include_fields'] = (bool) $include_fields;
    }
  }
  $params = $this
    ->normalizePagination($params, $page, $per_page);
  return $this->apiClient
    ->method('get')
    ->addPath('users')
    ->withDictParams($params)
    ->call();
}