PHP code example of memurame / abacus-php-rest-api

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

    

memurame / abacus-php-rest-api example snippets


use AbacusAPIClient\ResourceType;
$addresses = $abacusClient->resource(ResourceType::ADDRESSES)->run();

use AbacusAPIClient\ResourceType;
$address = $abacusClient->resource(ResourceType::ADDRESSES)->id('02b95ac0-e9ed-e201-175a-c2d220524153')->run();

use AbacusAPIClient\ResourceType;
$addresses = $abacusClient->resource(ResourceType::SUBJECTS)
    ->filter('SubjectId', 'eq', 8)
    ->limit(3)
    ->order('Id', 'desc')
    ->select('FirstName')
    ->expand('Addresses', 'Communications')
    ->all()
    ->run();

$values = $address->getValues();

$values = $address->getValue('SubjectId');

$address->setValue('City', 'Solothurn');
OR
$address->setValues([
    'City' => 'Solothurn', 
    'PostCode' => 3232
]);

$address->save();

use AbacusAPIClient\ResourceType;
$address = $abacusClient->resource(ResourceType::ADDRESSES);
$address->setValues({
    'SubjectId' => 0,
    'Street'    => 'Hausenstrasse',
    ...
    ...
})

$address->save();

use AbacusAPIClient\ResourceType;

$abacusClient->resource( ResourceType::ADDRESSES );