PHP code example of orion-crm / client-php

1. Go to this page and download the library: Download orion-crm/client-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

orion-crm / client-php example snippets


$client = new Orion\Component\Client\Client([
    'token' => 'qwe123',
    'version' => 'v1',
    'host' => 'http://localhost:8000'
]);

$lead = new \Orion\Component\Client\Crm\Lead();
$lead->setName('Hello api!');
$lead->setPrice(10000);

$contact = new \Orion\Component\Client\Crm\Contact();
$contact->setName('Hello api!');
$contact->setPhone('+78332207107');

$company = new \Orion\Component\Client\Crm\Company();
$company->setName('Hello api!');
$company->setPhone('+78332207107');

$issue = new \Orion\Component\Client\Issue\Issue();
$issue->setContent('Hello api!');
$issue->setResult('Issue api is done');
$issue->setObjectId(1);
$issue->setObjectClass('lead');
$issue->setExecutorId(1);
$issue->setType(1);
// $issue->setType(null); NULL - is comment
$issue->setDeadlineAt(new \DateTime);
// $issue->setDeadlineAt('2017-10-10 10:10:10');