VOOZH about

URL: https://developers.apideck.com/sdks/php

⇱ PHP SDK - Apideck


Apideck CLI: Query 200+ SaaS APIs from your terminal. No SDK needed. Read more

Apideck Documentation Page
v10.24.45
Talk to an Expert

PHP SDK

Apideck offers a native SDK for PHP. Choose one language below to see our API Reference in your application’s language.

Command Line
composer require "apideck-libraries/sdk-php"

AI Skills for PHP

Using an AI coding agent? Install the apideck-php skill to teach your agent how to use the PHP SDK — including methods, authentication, and best practices.

npx skills add apideck/api-skills --skill apideck-php

Learn more about building with LLMs


Getting started

The module supports all Apideck API endpoints. For complete information about the API, head to the docs. All endpoints require a valid apiKey so that's the only required parameter to initialize a new Apideck client

PHP
declare(strict_types=1);

require 'vendor/autoload.php';

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

$sdk = Unify\Apideck::builder()
 ->setSecurity(
 '<YOUR_BEARER_TOKEN_HERE>'
 )
 ->setConsumerId('<insert-consumer-id-here>')
 ->setAppId('<insert-application-id-here>')
 ->build();

$request = new Operations\CrmContactsAllRequest(
 serviceId: 'salesforce',
 filter: new Components\ContactsFilter(
 firstName: 'Elon',
 lastName: 'Musk',
 email: 'elon@tesla.com',
 companyId: '12345',
 ownerId: '12345',
 ),
 sort: new Components\ContactsSort(
 by: Components\ContactsSortBy::CreatedAt,
 direction: Components\SortDirection::Desc,
 ),
 passThrough: [
 'search' => 'San Francisco',
 ],
 fields: 'id,updated_at',
);

$responses = $sdk->crm->contacts->list(
 request: $request
);


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