Api::fetch_users_with_args( $args )
Get the List of Users by arguments.
Return
(array) An array of data from the Zoom API.
Source
File: src/Tribe/Meetings/Zoom/Api.php
public function fetch_users_with_args( $args ) {
if ( ! $this->get_token_authorization_header() ) {
return [];
}
$data = '';
$this->get(
self::$api_base . 'users',
[
'headers' => [
'Authorization' => $this->get_token_authorization_header(),
'Content-Type' => 'application/json; charset=utf-8',
],
'body' => ! empty( $args ) ? $args : null,
],
200
)->then(
static function ( array $response ) use ( &$data ) {
$body = json_decode( $response['body'] );
if (
! (
isset( $response['body'] )
&& false !== ( $body = json_decode( $response['body'], true ) )
&& isset( $body['users'] )
)
) {
do_action( 'tribe_log', 'error', __CLASS__, [
'action' => __METHOD__,
'message' => 'Zoom API users response is malformed.',
'response' => $body,
] );
return [];
}
$data = $body;
}
)->or_catch(
static function ( \WP_Error $error ) {
do_action( 'tribe_log', 'error', __CLASS__, [
'action' => __METHOD__,
'code' => $error->get_error_code(),
'message' => $error->get_error_message(),
] );
}
);
return $data;
}
Changelog
| Version | Description |
|---|---|
| 1.8.2 | Introduced. |