PHP code example of cloudinary / permissions

1. Go to this page and download the library: Download cloudinary/permissions library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

cloudinary / permissions example snippets





onfigure Cloudinary Account URL
$config = Cloudinary\Permissions\Configuration::getDefaultConfiguration()
              ->setCloudinaryAccountUrl('account://provisioning_key:provisioning_secret@account_id');

$apiInstance = new Cloudinary\Permissions\Api\CustomPoliciesApi(null, $config);


Instance = new Cloudinary\Permissions\Api\CustomPoliciesApi();


Instance = new Cloudinary\Permissions\Api\CustomPoliciesApi();

$scopeType = "&#39;scopeType_example&#39;"; // string | Specifies the level for retrieving policies, either at the account level or within product environments.
$scopeId = "&#39;scopeId_example&#39;"; // string | The ID of a specific product environment where the policy is applied. This parameter is only relevant if `scope_type` is \"prodenv\". Find your product environment IDs in the [Product Environments](https://console.cloudinary.com/settings/product-environments) page of the Console Settings. - <product_environment_id>
$enabled = true; // bool | Filter policies by enabled status (true/false).
$cursor = "&#39;cursor_example&#39;"; // string | A pagination cursor for fetching subsequent results.

try {
    $result = $apiInstance->getCustomPolicies($scopeType, $scopeId, $enabled, $cursor);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CustomPoliciesApi->getCustomPolicies: ', $e->getMessage(), PHP_EOL;
}