Skip to content

Latest commit

 

History

History
298 lines (205 loc) · 9.39 KB

UsersApi.md

File metadata and controls

298 lines (205 loc) · 9.39 KB

Cloudinary\Provisioning\UsersApi

All URIs are relative to https://api.cloudinary.com/v1_1/provisioning/accounts/ACCOUNT_ID, except if the operation defines another base path.

Method HTTP request Description
createUser() POST /users Create user
deleteUser() DELETE /users/{user_id} Delete user
getUser() GET /users/{user_id} Get user
getUsers() GET /users Get users
updateUser() PUT /users/{user_id} Update user

createUser()

createUser($userRequest): \Cloudinary\Provisioning\Model\User

Create user

Create a new user.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Cloudinary\Provisioning\Api\UsersApi();

$userRequest = new \Cloudinary\Provisioning\Model\UserRequest(); // \Cloudinary\Provisioning\Model\UserRequest | User details

try {
    $result = $apiInstance->createUser($userRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UsersApi->createUser: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
userRequest \Cloudinary\Provisioning\Model\UserRequest User details [optional]

Return type

\Cloudinary\Provisioning\Model\User

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteUser()

deleteUser($userId): \Cloudinary\Provisioning\Model\SuccessResponse

Delete user

Delete a specific user.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Cloudinary\Provisioning\Api\UsersApi();

$userId = "0abed8dfcc039ea05e2a1d494fd442"; // string | The ID of the user.

try {
    $result = $apiInstance->deleteUser($userId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UsersApi->deleteUser: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
userId string The ID of the user.

Return type

\Cloudinary\Provisioning\Model\SuccessResponse

Authorization

basicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getUser()

getUser($userId): \Cloudinary\Provisioning\Model\User

Get user

Retrieve a specific user.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Cloudinary\Provisioning\Api\UsersApi();

$userId = "0abed8dfcc039ea05e2a1d494fd442"; // string | The ID of the user.

try {
    $result = $apiInstance->getUser($userId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UsersApi->getUser: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
userId string The ID of the user.

Return type

\Cloudinary\Provisioning\Model\User

Authorization

basicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getUsers()

getUsers($pending, $ids, $emails, $prefix, $subAccountId, $lastLogin, $from, $to, $unionType, $sortOrder, $sortBy, $page, $pageSize): \Cloudinary\Provisioning\Model\UsersResponse

Get users

Returns an array of all users in the account, or if conditions are specified, returns the relevant users.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Cloudinary\Provisioning\Api\UsersApi();

$pending = false; // bool | Whether to return pending users. **Default**: `false` (all users)
$ids = array('ids_example'); // string[] | A list of up to 100 user IDs.  When provided, other parameters are ignored.
$emails = array('emails_example'); // string[] | A list of up to 100 user Emails.  When provided, other parameters are ignored.
$prefix = "john"; // string | Returns users where the name begins with the specified case-insensitive string.
$subAccountId = "&#39;subAccountId_example&#39;"; // string | Only returns users who have access to the specified account.
$lastLogin = True; // bool | Specifies a date range for last login.
$from = 2023-01-01; // \DateTime | All last logins after this date, given in the format: yyyy-mm-dd.
$to = 2024-12-31; // \DateTime | All last logins before this date, given in the format: yyyy-mm-dd.
$unionType = "&#39;unionType_example&#39;"; // string | Whether to return users who last logged in within the specified date range (include) or those who didn't last log in within the range (exclude). **Possible values**: `include`, `exclude`. **Default**: `include`.
$sortOrder = "&#39;sortOrder_example&#39;"; // string | Control the order of returned users. **Possible values**: `desc` (default), `asc`.
$sortBy = "&#39;sortBy_example&#39;"; // string
$page = 56; // int
$pageSize = 56; // int

try {
    $result = $apiInstance->getUsers($pending, $ids, $emails, $prefix, $subAccountId, $lastLogin, $from, $to, $unionType, $sortOrder, $sortBy, $page, $pageSize);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UsersApi->getUsers: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
pending bool Whether to return pending users. Default: `false` (all users) [optional]
ids string[] A list of up to 100 user IDs. When provided, other parameters are ignored. [optional]
emails string[] A list of up to 100 user Emails. When provided, other parameters are ignored. [optional]
prefix string Returns users where the name begins with the specified case-insensitive string. [optional]
subAccountId string Only returns users who have access to the specified account. [optional]
lastLogin bool Specifies a date range for last login. [optional]
from \DateTime All last logins after this date, given in the format: yyyy-mm-dd. [optional]
to \DateTime All last logins before this date, given in the format: yyyy-mm-dd. [optional]
unionType string Whether to return users who last logged in within the specified date range (include) or those who didn't last log in within the range (exclude). Possible values: `include`, `exclude`. Default: `include`. [optional]
sortOrder string Control the order of returned users. Possible values: `desc` (default), `asc`. [optional]
sortBy string [optional]
page int [optional]
pageSize int [optional]

Return type

\Cloudinary\Provisioning\Model\UsersResponse

Authorization

basicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateUser()

updateUser($userId, $userRequest): \Cloudinary\Provisioning\Model\User

Update user

Update the details of a user.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Cloudinary\Provisioning\Api\UsersApi();

$userId = "0abed8dfcc039ea05e2a1d494fd442"; // string | The ID of the user.
$userRequest = new \Cloudinary\Provisioning\Model\UserRequest(); // \Cloudinary\Provisioning\Model\UserRequest | Updated user details

try {
    $result = $apiInstance->updateUser($userId, $userRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UsersApi->updateUser: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
userId string The ID of the user.
userRequest \Cloudinary\Provisioning\Model\UserRequest Updated user details [optional]

Return type

\Cloudinary\Provisioning\Model\User

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]