Skip to content

Latest commit

 

History

History
350 lines (244 loc) · 11.8 KB

ResourcesApi.md

File metadata and controls

350 lines (244 loc) · 11.8 KB

Swagger\Client\ResourcesApi

All URIs are relative to https://localhost/v1

Method HTTP request Description
addResource POST /resources
deleteResource DELETE /resources/{id}
getResource GET /resources/{id}
getResources GET /resources
resourcesUploadPost POST /resources/upload
updateResource PUT /resources/{id}

addResource

\Swagger\Client\Model\Resource addResource($resource)

Create a new resource

Example

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

// Configure API key authorization: APIKeyHeader
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-API-KEY', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer');
// Configure API key authorization: JWTHeader
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Authorization-JWT', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Authorization-JWT', 'Bearer');

$api_instance = new Swagger\Client\Api\ResourcesApi();
$resource = new \Swagger\Client\Model\NewResource(); // \Swagger\Client\Model\NewResource | 

try {
    $result = $api_instance->addResource($resource);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ResourcesApi->addResource: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
resource \Swagger\Client\Model\NewResource

Return type

\Swagger\Client\Model\Resource

Authorization

APIKeyHeader, JWTHeader

HTTP request headers

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

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

deleteResource

\Swagger\Client\Model\Resource deleteResource($id)

Delete a resource

Example

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

// Configure API key authorization: APIKeyHeader
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-API-KEY', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer');
// Configure API key authorization: JWTHeader
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Authorization-JWT', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Authorization-JWT', 'Bearer');

$api_instance = new Swagger\Client\Api\ResourcesApi();
$id = "id_example"; // string | Resource Id

try {
    $result = $api_instance->deleteResource($id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ResourcesApi->deleteResource: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id string Resource Id

Return type

\Swagger\Client\Model\Resource

Authorization

APIKeyHeader, JWTHeader

HTTP request headers

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

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

getResource

\Swagger\Client\Model\Resource getResource($id)

Get a resource

Example

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

// Configure API key authorization: APIKeyHeader
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-API-KEY', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer');
// Configure API key authorization: JWTHeader
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Authorization-JWT', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Authorization-JWT', 'Bearer');

$api_instance = new Swagger\Client\Api\ResourcesApi();
$id = "id_example"; // string | Resource Id

try {
    $result = $api_instance->getResource($id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ResourcesApi->getResource: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id string Resource Id

Return type

\Swagger\Client\Model\Resource

Authorization

APIKeyHeader, JWTHeader

HTTP request headers

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

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

getResources

\Swagger\Client\Model\Resource[] getResources($type, $account_id, $scope)

Get all resources

Example

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

// Configure API key authorization: APIKeyHeader
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-API-KEY', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer');
// Configure API key authorization: JWTHeader
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Authorization-JWT', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Authorization-JWT', 'Bearer');

$api_instance = new Swagger\Client\Api\ResourcesApi();
$type = "type_example"; // string | 
$account_id = 56; // int | 
$scope = "scope_example"; // string | 

try {
    $result = $api_instance->getResources($type, $account_id, $scope);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ResourcesApi->getResources: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
type string [optional]
account_id int [optional]
scope string [optional]

Return type

\Swagger\Client\Model\Resource[]

Authorization

APIKeyHeader, JWTHeader

HTTP request headers

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

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

resourcesUploadPost

\Swagger\Client\Model\Resource resourcesUploadPost($fid, $image, $description, $scope)

Upload image resource

Example

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

// Configure API key authorization: APIKeyHeader
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-API-KEY', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer');
// Configure API key authorization: JWTHeader
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Authorization-JWT', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Authorization-JWT', 'Bearer');

$api_instance = new Swagger\Client\Api\ResourcesApi();
$fid = "fid_example"; // string | 
$image = "/path/to/file.txt"; // \SplFileObject | image
$description = "description_example"; // string | 
$scope = "scope_example"; // string | 

try {
    $result = $api_instance->resourcesUploadPost($fid, $image, $description, $scope);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ResourcesApi->resourcesUploadPost: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
fid string
image \SplFileObject image
description string [optional]
scope string [optional]

Return type

\Swagger\Client\Model\Resource

Authorization

APIKeyHeader, JWTHeader

HTTP request headers

  • Content-Type: multipart/form-data, application/x-www-form-urlencoded
  • Accept: application/json

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

updateResource

\Swagger\Client\Model\Resource updateResource($id, $resource)

Update a resource

Example

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

// Configure API key authorization: APIKeyHeader
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-API-KEY', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer');
// Configure API key authorization: JWTHeader
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Authorization-JWT', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Authorization-JWT', 'Bearer');

$api_instance = new Swagger\Client\Api\ResourcesApi();
$id = "id_example"; // string | Resource Id
$resource = new \Swagger\Client\Model\UpdateResource(); // \Swagger\Client\Model\UpdateResource | 

try {
    $result = $api_instance->updateResource($id, $resource);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ResourcesApi->updateResource: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id string Resource Id
resource \Swagger\Client\Model\UpdateResource

Return type

\Swagger\Client\Model\Resource

Authorization

APIKeyHeader, JWTHeader

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: application/json

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