aurigma / php-asset-storage-client
PHP API Client for Asset Storage service of Customer's Canvas web-to-print system.
Requires
- php: ^7.4 || ^8.0
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.3
- guzzlehttp/psr7: ^1.7 || ^2.0
- jumbojett/openid-connect-php: ^0.9.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.5
- phpunit/phpunit: ^8.0 || ^9.0
This package is auto-updated.
Last update: 2024-12-14 06:30:06 UTC
README
======================================================
This module is a PHP API client for Asset Storage service which is a part of Customer's Canvas web-to-print system. It is supposed that you are familiar with its services and understand how to use its APIs. To learn more about Customer's Canvas and its services, refer the Getting Started section of its documentation.
Pre-requisites
To be able to use this package, you need to meet the following requirements:
- You must have an account at Customer's Canvas.
For other platforms, see the Backend services article in Customer's Canvas documentation.
Installation
composer require aurigma/php-asset-storage-client
Requirements
PHP 7.2 and later.
Composer
To install the bindings via Composer, add the following to composer.json
:
{ "repositories": [ { "type": "vcs", "url": "https://github.com/aurigma/php-asset-storage-client.git" } ], "require": { "aurigma/php-asset-storage-client": "*@dev" } }
Then run composer install
Getting Started
Please follow the installation procedure.
Receive an access token through your backend as explained in the documentation and deliver it to your app.
Then run the following:
<?php require_once(__DIR__ . '/vendor/autoload.php'); // 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; } ?>
Tests
To run the tests, use:
composer install vendor/bin/phpunit
Author
Aurigma Inc info@aurigma.com (https://customerscanvas.com)
API Endpoints
All URIs are relative to https://dm-assetstorage.azurewebsites.net/
Models
- ArtifactDto
- ArtifactType
- BatchConflictDto
- BatchCopyInput
- BatchDeleteInput
- BatchUpdateOwnerInput
- BatchUpdateParentFolderInput
- BuildInfoModel
- CollectionContentOfColorProfileDto
- CollectionContentOfDataSchemaDto
- CollectionContentOfDataSetDto
- CollectionContentOfDesignDto
- CollectionContentOfFontDto
- CollectionContentOfImageDto
- CollectionDto
- ColorProfileClass
- ColorProfileDto
- ColorProfileMetadata
- ColorSpace
- ConflictDto
- ConflictResolvingStrategy
- ConflictType
- CreateCollectionDto
- CreateFolderDto
- CreateTenantDto
- DataSchemaDto
- DataSchemaMetadata
- DataSetDto
- DataSetMetadata
- DesignDto
- DesignFontMetadata
- DesignMetadata
- DesignSurfaceMetadata
- FolderContentOfColorProfileDto
- FolderContentOfDataSchemaDto
- FolderContentOfDataSetDto
- FolderContentOfDesignDto
- FolderContentOfFontDto
- FolderContentOfImageDto
- FolderDto
- FolderInfoDto
- FontDto
- FontMetadata
- ImageDto
- ImageMetadata
- ImagePageMetadata
- NameConflictDto
- PagedOfArtifactDto
- PagedOfColorProfileDto
- PagedOfDataSchemaDto
- PagedOfDataSetDto
- PagedOfDesignDto
- PagedOfFontDto
- PagedOfImageDto
- PagedOfTenantDto
- PreviewDto
- PreviewMetadata
- ProblemDetails
- TenantDto
- UpdateCollectionDto
- UpdateFolderDto
- UpdateTenantDto