Skip to content

Latest commit

 

History

History
122 lines (84 loc) · 7.13 KB

File metadata and controls

122 lines (84 loc) · 7.13 KB

Connector.Connectors

Overview

Available Operations

  • list - List Connectors
  • get - Get Connector

list

List Connectors

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Apideck\Unify;
use Apideck\Unify\Models\Components;

$sdk = Unify\Apideck::builder()
    ->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
    ->setSecurity(
        '<YOUR_BEARER_TOKEN_HERE>'
    )
    ->build();

$filter = new Components\ConnectorsFilter(
    unifiedApi: Components\UnifiedApiId::FileStorage,
);

$responses = $sdk->connector->connectors->list(
    limit: 20,
    filter: $filter

);


foreach ($responses as $response) {
    if ($response->httpMeta->response->getStatusCode() === 200) {
        // handle response
    }
}

Parameters

Parameter Type Required Description Example
appId ?string The ID of your Unify application dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX
cursor ?string Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response.
limit ?int Number of results to return. Minimum 1, Maximum 200, Default 20
filter ?Components\ConnectorsFilter Apply filters {
"unified_api": "file-storage"
}

Response

?Operations\ConnectorConnectorsAllResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\PaymentRequiredResponse 402 application/json
Errors\APIException 4XX, 5XX */*

get

Get Connector

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Apideck\Unify;

$sdk = Unify\Apideck::builder()
    ->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
    ->setSecurity(
        '<YOUR_BEARER_TOKEN_HERE>'
    )
    ->build();



$response = $sdk->connector->connectors->get(
    id: '<id>'
);

if ($response->getConnectorResponse !== null) {
    // handle response
}

Parameters

Parameter Type Required Description Example
id string ✔️ ID of the record you are acting upon.
appId ?string The ID of your Unify application dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX

Response

?Operations\ConnectorConnectorsOneResponse

Errors

Error Type Status Code Content Type
Errors\UnauthorizedResponse 401 application/json
Errors\PaymentRequiredResponse 402 application/json
Errors\NotFoundResponse 404 application/json
Errors\APIException 4XX, 5XX */*