PHP code example of aracoool / salesforce-client

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

    

aracoool / salesforce-client example snippets


use SalesForce\Authentication\Authentication;
use SalesForce\Authentication\PasswordAuthentication;

E_HOST,
    'client id',
    'client secret',
    'username',
    'password + access token'
));

try {
    $result = $client->get('/sobjects/Account/0013600001UltKTAAZ');
    print_r($result);
} catch (Exception $e) {
    echo $e->getMessage() . PHP_EOL;
}

...

$soqlBuilder = new \SalesForce\Soql\Builder();
$soqlBuilder->select(['name'])
    ->from('Account');

try {
    $result = $client->get($soqlBuilder->build());
    print_r($result);
} catch (Exception $e) {
    echo $e->getMessage() . PHP_EOL;
}