/pilot-api-client

A Pilot CRM API Client for PHP

Primary LanguagePHPMIT LicenseMIT

Pilot API Client

Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version Total Downloads License

A PHP Pilot CRM API Client

Installation

composer require zephia/pilot-api-client

Usage

Store

<?php

$config = [
    'app_key' => 'PILOT_APP_KEY',
    'debug' => true
];

$client = new Zephia\PilotApiClient\Client\PilotApiClient($config);

$lead_data = new \Zephia\PilotApiClient\Model\LeadData([
    'contact_type_id' => 1,
    'business_type_id' => 1,
    'suborigin_id' => "FFFF0000",
    'firstname' => 'John',
    'lastname' => 'Doe',
    'phone' => '+543512345678',
    'email' => 'john.doe@domain.com'
]);

// or programatically
$lead_data = (new \Zephia\PilotApiClient\Model\LeadData())
    ->setContactTypeId(1)
    ->setBusinessTypeId(1)
    ->setSuboriginId("FFFF0000")
    ->setFirstname("John")
    ->setLastname("Doe")
    ->setPhone("+543512345678")
    ->setEmail("john.doe@domain.com");

$client->storeLead($lead_data);

// Returns API response object.