You are here

public function ApiClient::usersInfo in Rocket.Chat 8

Same name and namespace in other branches
  1. 8.2 modules/rocket_chat_api/src/RocketChat/ApiClient.php \Drupal\rocket_chat_api\RocketChat\ApiClient::usersInfo()

Retrieve User information.

Parameters

string $userId: The userId to look up.

string $userName: The username to look up.

Return value

array Result array.

File

modules/rocket_chat_api/src/RocketChat/ApiClient.php, line 391

Class

ApiClient
Class ApiClient.

Namespace

Drupal\rocket_chat_api\RocketChat

Code

public function usersInfo($userId = NULL, $userName = NULL) {
  $req = [];
  $req['query'] = [];
  if (!empty($userId)) {
    $req['query']['userId'] = $userId;
  }
  if (!empty($userName)) {
    $req['query']['username'] = $userName;
  }
  return $this
    ->getFromRocketChat('users.info', $req);
}