PHP code example of aurigma / php-asset-storage-client

1. Go to this page and download the library: Download aurigma/php-asset-storage-client 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/ */

    

aurigma / php-asset-storage-client example snippets



 Configure API key authorization: apiKey
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');

// Configure OAuth2 access token for authorization: oauth2
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\ArtifactsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$tenant_id = 56; // int | Tenant identifier
$file = "/path/to/file.txt"; // \SplFileObject | Entity file content
$description = 'description_example'; // string | Artifact description
$group = 'group_example'; // string | Artifact group
$alias = 'alias_example'; // string | Artifact alias (special name within group)
$type = new \OpenAPI\Client\Model\ArtifactType(); // \OpenAPI\Client\Model\ArtifactType
$format = 'format_example'; // string | Artifact file format

try {
    $result = $apiInstance->artifactsCreate($tenant_id, $file, $description, $group, $alias, $type, $format);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ArtifactsApi->artifactsCreate: ', $e->getMessage(), PHP_EOL;
}

composer 
json
{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/aurigma/php-asset-storage-client.git"
    }
  ],
  "