PHP code example of deepser / api-php

1. Go to this page and download the library: Download deepser/api-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/ */

    

deepser / api-php example snippets




 = 'https://your.deepser.net';
$username = 'username';
$password = 'password';
// create a deep desk object
\Deepser\Deepser::init($host, $username, $password);

// ...



 = 'https://your.deepser.net';
$username = 'username';
$token = 'mytokenhere';
// create a deep desk object
\Deepser\Deepser::init($host, $token);

// ...

// ...
// load an existing operation by id
$operation = new \Deepser\Entity\Service\Operation();
$operation->load(1000);
//...
// create new operation object
$operation = new \Deepser\Entity\Service\Operation();
$operation->setTitle('My new ticket');
$operation->setDescription('can you help me?');
$operation->setType(123);
$operation->save();


// ...
// load an existing user by id
$user = new \Deepser\Entity\User();
$user->load(600);

// load user by username
$user = new \Deepser\Entity\User();
$user->load('myusername', 'username');

//...
// load user collection
$userCollection = \Deepser\Entity\User::getCollection();
$userCollection->addFilter('company_id', 'eq', 123);
foreach($userCollection as $user){
    echo $user->getFirstname();
}


// ...
// load an existing company by id
$company = new \Deepser\Entity\Company();
$company->load(600);
//...
// load company collection
$companyCollection = \Deepser\Entity\Company::getCollection();
$companyCollection->addFilter('name', 'like', '%ACME%');
foreach($companyCollection as $company){
    echo $company->getName();
}

bash
$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar 
bash
$ php composer.phar update