PHP code example of pipelinersales / pipeliner-api-client
1. Go to this page and download the library: Download pipelinersales/pipeliner-api-client 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/ */
pipelinersales / pipeliner-api-client example snippets
try {
// load all accounts (up to a maximum of 25)
$pipeliner->accounts->get();
// load a specified account by id
$pipeliner->accounts->getById('ID-219034053254');
}catch (PipelinerHttpException $e) {
// something went wrong
}
// load up to 10 accounts and sort them by the organization name
$pipeliner->accounts->get(array('limit' => 10, 'sort' => 'ORGANIZATION'));
// load up to 5 accounts which were modified in the last week
$criteria = new Criteria();
$criteria->limit(5)->after(new DateTime('-7 days midnight'));
$pipeliner->accounts->get($criteria);
// load accounts whose organization name contains the string 'co'
$pipeliner->accounts->get(Filter::contains('ORGANIZATION', 'co'));
// load up to 10 accounts whose name starts with the letter A ordered by name in an ascending order
$pipeliner->accounts->get(
Criteria::limit(10)->filter(Filter::startsWith('A'))->sort('NAME')
);
$collection = $pipeliner->accounts->get();
// entity collections can be accessed like arrays
$firstAccount = $collection[0];
foreach ($collection as $account) {
// do something with each account
}
$accounts = $pipeliner->accounts->get();
// this is allowed
$accounts[0]->setEmail1('[email protected]');
// this throws an exception
$accounts[0] = $pipeliner->accounts->getById('ID-3452134134');
// default limit 25 items
$accounts = $client->accounts->get();
$accountIterator = $client->accounts->getEntireRangeIterator($accounts);
$emails = array();
// this will iterate over ALL of the results (even beyond the 25)
foreach ($accountIterator as $account) {
$emails[] = $account->getEmail1();
if (!$accountIterator->nextDataAvailable() and !$accountIterator->atEnd()) {
// next iteration will issue a HTTP request
}
}
try {
$account = $pipeliner->accounts->create();
// mandatory fields in the account are empty, so the server will refuse to save it
$pipeliner->accounts->save($account);
}catch (PipelinerHttpException $e) {
echo $e->getErrorMessage();
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.