Skip to content

Latest commit

 

History

History
127 lines (88 loc) · 7.01 KB

README.md

File metadata and controls

127 lines (88 loc) · 7.01 KB

Apis

(connector->apis)

Overview

Available Operations

list

List APIs

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

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

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

$filter = new Components\ApisFilter(
    status: Components\ApiStatus::Beta,
);

$responses = $sdk->connector->apis->list(
    appId: 'dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX',
    limit: 20,
    filter: $filter,
    cursor: '<value>'

);


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
limit ?int Number of results to return. Minimum 1, Maximum 200, Default 20
filter ?Components\ApisFilter Apply filters {
"status": "beta"
}
cursor ?string Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response.

Response

?Operations\ConnectorApisAllResponse

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 API

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Apideck\Unify;

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



$response = $sdk->connector->apis->get(
    id: '<id>',
    appId: 'dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX'

);

if ($response->getApiResponse !== 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\ConnectorApisOneResponse

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 */*