(connector->apis)
List APIs
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
}
}
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. |
?Operations\ConnectorApisAllResponse
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 API
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
}
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
id |
string | ✔️ | ID of the record you are acting upon. | |
appId |
?string | ➖ | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX |
?Operations\ConnectorApisOneResponse
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 | */* |