The Apideck OpenAPI Spec: SDK Optimized

3.6.0 2024-11-12 14:01 UTC

README

Table of Contents

Installation

Requirements

PHP 7.3 and later. Should also work with PHP 8.0 but has not been tested.

Composer

Install the latest SDK using composer:

$ composer require apideck-libraries/php-sdk

Getting started

The module supports all Apideck API endpoints. For complete information about the API, head to the docs.

Configuration

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
);

Example

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);

Apideck Unified Apis

The following Apis are currently available:

AccountingApi

Read the full documentation of the AccountingApi here.

AtsApi

Read the full documentation of the AtsApi here.

ConnectorApi

Read the full documentation of the ConnectorApi here.

CrmApi

Read the full documentation of the CrmApi here.

EcommerceApi

Read the full documentation of the EcommerceApi here.

FileStorageApi

Read the full documentation of the FileStorageApi here.

HrisApi

Read the full documentation of the HrisApi here.

IssueTrackingApi

Read the full documentation of the IssueTrackingApi here.

LeadApi

Read the full documentation of the LeadApi here.

PosApi

Read the full documentation of the PosApi here.

SmsApi

Read the full documentation of the SmsApi here.

VaultApi

Read the full documentation of the VaultApi here.

WebhookApi

Read the full documentation of the WebhookApi here.

Support

Open an issue!

License

MIT