PHP 7.3 and later. Should also work with PHP 8.0 but has not been tested.
Install the latest SDK using composer:
$ composer require apideck-libraries/php-sdk
The module supports all Apideck API endpoints. For complete information about the API, head to the docs.
A new Apideck instance is initialized by passing in required settings to the configuration.
require('vendor/autoload.php');
use Apideck\Client\Apideck;
use Apideck\Client\ApideckConfiguration;
$config = new ApideckConfiguration('<insert-api-key-here>', '<insert-application-id-here>', '<insert-consumer-id-here>');
$apideck = new Apideck($config);
Top level parameters (except for apiKey) can be overriden in specific resource calls.
<?php
// Declare Unify Api to use
$crmApi = $apideck->getCrmApi();
// Override consumerId serviceId as declared in initial configuration for this operation.
$serviceId = 'salesforce';
$response = $crmApi->contactsAll(
false,
null,
null,
$serviceId,
null,
10
);
Retrieving a list of all contacts and updating the first record with a new address.
<?php
require('vendor/autoload.php');
use Apideck\Client\Apideck;
use Apideck\Client\ApideckConfiguration;
use Apideck\Client\Model\Contact;
use Apideck\Client\Model\Address;
use Apideck\Client\Model\PhoneNumber;
$config = new ApideckConfiguration('<insert-api-key-here>', '<insert-application-id-here>', '<insert-consumer-id-here>');
$apideck = new Apideck($config);
$crmApi = $apideck->getCrmApi();
$response = $crmApi->contactsAll(false, null, null, $serviceId, null, 10);
$data = $response->getData();
$result = $crmApi->contactsUpdate([
$data[0]->getId(),
new Contact([
"name" => "John Doe",
"first_name" => "John",
"last_name" => "Doe",
"addresses" => [
new Address([
"city" => "Hoboken",
"line1" => "Streetname 19",
"state" => "NY"
])
],
"phone_numbers" => [
new PhoneNumber([
"number" => "0486565656",
"phoneType" => "home"
])
]
])
]);
var_dump($result);
The following Apis are currently available:
Read the full documentation of the AccountingApi here.
Read the full documentation of the AtsApi here.
Read the full documentation of the ConnectorApi here.
Read the full documentation of the CrmApi here.
Read the full documentation of the EcommerceApi here.
Read the full documentation of the FileStorageApi here.
Read the full documentation of the HrisApi here.
Read the full documentation of the IssueTrackingApi here.
Read the full documentation of the LeadApi here.
Read the full documentation of the PosApi here.
Read the full documentation of the SmsApi here.
Read the full documentation of the VaultApi here.
Read the full documentation of the WebhookApi here.
Open an issue!