(fileStorage->files)
- list - List Files
- delete - Delete File
- download - Download File
- export - Export File
- get - Get File
- search - Search Files
- update - Rename or move File
List Files
declare(strict_types=1);
require 'vendor/autoload.php';
use Apideck\Unify;
use Apideck\Unify\Models\Components;
use Apideck\Unify\Models\Operations;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Unify\Apideck::builder()
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->setSecurity($security)->build();
$request = new Operations\FileStorageFilesAllRequest(
serviceId: 'salesforce',
filter: new Components\FilesFilter(
driveId: '1234',
folderId: 'root',
shared: true,
),
sort: new Components\FilesSort(
by: Components\FilesSortBy::UpdatedAt,
direction: Components\SortDirection::Desc,
),
passThrough: [
'search' => 'San Francisco',
],
fields: 'id,updated_at',
);
$responses = $sdk->fileStorage->files->list(
request: $request
);
foreach ($responses as $response) {
if ($response->httpMeta->response->getStatusCode() === 200) {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\FileStorageFilesAllRequest | ✔️ | The request object to use for the request. |
?Operations\FileStorageFilesAllResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\BadRequestResponse | 400 | application/json |
Errors\UnauthorizedResponse | 401 | application/json |
Errors\PaymentRequiredResponse | 402 | application/json |
Errors\NotFoundResponse | 404 | application/json |
Errors\UnprocessableResponse | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
Delete File
declare(strict_types=1);
require 'vendor/autoload.php';
use Apideck\Unify;
use Apideck\Unify\Models\Operations;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Unify\Apideck::builder()
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->setSecurity($security)->build();
$request = new Operations\FileStorageFilesDeleteRequest(
id: '<id>',
serviceId: 'salesforce',
);
$response = $sdk->fileStorage->files->delete(
request: $request
);
if ($response->deleteFileResponse !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\FileStorageFilesDeleteRequest | ✔️ | The request object to use for the request. |
?Operations\FileStorageFilesDeleteResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\BadRequestResponse | 400 | application/json |
Errors\UnauthorizedResponse | 401 | application/json |
Errors\PaymentRequiredResponse | 402 | application/json |
Errors\NotFoundResponse | 404 | application/json |
Errors\UnprocessableResponse | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
Download File
declare(strict_types=1);
require 'vendor/autoload.php';
use Apideck\Unify;
use Apideck\Unify\Models\Operations;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Unify\Apideck::builder()
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->setSecurity($security)->build();
$request = new Operations\FileStorageFilesDownloadRequest(
id: '<id>',
serviceId: 'salesforce',
fields: 'id,updated_at',
);
$response = $sdk->fileStorage->files->download(
request: $request
);
if ($response->getFileDownloadResponse !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\FileStorageFilesDownloadRequest | ✔️ | The request object to use for the request. |
?Operations\FileStorageFilesDownloadResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\BadRequestResponse | 400 | application/json |
Errors\UnauthorizedResponse | 401 | application/json |
Errors\PaymentRequiredResponse | 402 | application/json |
Errors\NotFoundResponse | 404 | application/json |
Errors\UnprocessableResponse | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
Export File
declare(strict_types=1);
require 'vendor/autoload.php';
use Apideck\Unify;
use Apideck\Unify\Models\Operations;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Unify\Apideck::builder()
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->setSecurity($security)->build();
$request = new Operations\FileStorageFilesExportRequest(
id: '<id>',
format: 'pdf',
serviceId: 'salesforce',
fields: 'id,updated_at',
);
$response = $sdk->fileStorage->files->export(
request: $request
);
if ($response->getFileDownloadResponse !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\FileStorageFilesExportRequest | ✔️ | The request object to use for the request. |
?Operations\FileStorageFilesExportResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\BadRequestResponse | 400 | application/json |
Errors\UnauthorizedResponse | 401 | application/json |
Errors\PaymentRequiredResponse | 402 | application/json |
Errors\NotFoundResponse | 404 | application/json |
Errors\UnprocessableResponse | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
Get File
declare(strict_types=1);
require 'vendor/autoload.php';
use Apideck\Unify;
use Apideck\Unify\Models\Operations;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Unify\Apideck::builder()
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->setSecurity($security)->build();
$request = new Operations\FileStorageFilesOneRequest(
id: '<id>',
serviceId: 'salesforce',
fields: 'id,updated_at',
);
$response = $sdk->fileStorage->files->get(
request: $request
);
if ($response->getFileResponse !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\FileStorageFilesOneRequest | ✔️ | The request object to use for the request. |
?Operations\FileStorageFilesOneResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\BadRequestResponse | 400 | application/json |
Errors\UnauthorizedResponse | 401 | application/json |
Errors\PaymentRequiredResponse | 402 | application/json |
Errors\NotFoundResponse | 404 | application/json |
Errors\UnprocessableResponse | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
Search Files
declare(strict_types=1);
require 'vendor/autoload.php';
use Apideck\Unify;
use Apideck\Unify\Models\Components;
use Apideck\Unify\Models\Operations;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Unify\Apideck::builder()
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->setSecurity($security)->build();
$request = new Operations\FileStorageFilesSearchRequest(
filesSearch: new Components\FilesSearch(
query: 'logo jpg',
),
serviceId: 'salesforce',
passThrough: [
'search' => 'San Francisco',
],
filter: new Components\FilesFilter(
driveId: '1234',
folderId: 'root',
shared: true,
),
fields: 'id,updated_at',
);
$response = $sdk->fileStorage->files->search(
request: $request
);
if ($response->getFilesResponse !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\FileStorageFilesSearchRequest | ✔️ | The request object to use for the request. |
?Operations\FileStorageFilesSearchResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\BadRequestResponse | 400 | application/json |
Errors\UnauthorizedResponse | 401 | application/json |
Errors\PaymentRequiredResponse | 402 | application/json |
Errors\NotFoundResponse | 404 | application/json |
Errors\UnprocessableResponse | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
Rename or move File
declare(strict_types=1);
require 'vendor/autoload.php';
use Apideck\Unify;
use Apideck\Unify\Models\Components;
use Apideck\Unify\Models\Operations;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Unify\Apideck::builder()
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->setSecurity($security)->build();
$request = new Operations\FileStorageFilesUpdateRequest(
id: '<id>',
updateFileRequest: new Components\UpdateFileRequest(
name: 'New Name.pdf',
description: 'Renamed PDF Document',
parentFolderId: '1234',
passThrough: [
new Components\PassThroughBody(
serviceId: '<id>',
extendPaths: [
new Components\ExtendPaths(
path: '$.nested.property',
value: [
'TaxClassificationRef' => [
'value' => 'EUC-99990201-V1-00020000',
],
],
),
],
),
],
),
serviceId: 'salesforce',
);
$response = $sdk->fileStorage->files->update(
request: $request
);
if ($response->updateFileResponse !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\FileStorageFilesUpdateRequest | ✔️ | The request object to use for the request. |
?Operations\FileStorageFilesUpdateResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\BadRequestResponse | 400 | application/json |
Errors\UnauthorizedResponse | 401 | application/json |
Errors\PaymentRequiredResponse | 402 | application/json |
Errors\NotFoundResponse | 404 | application/json |
Errors\UnprocessableResponse | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |