PHP code example of hotfix / leadfox

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

    

hotfix / leadfox example snippets



{
    $leadFoxAPI = new \Hotfix\LeadFox\Api([
        'key' => '...',
        'secret' => '...'
    ]);
    
    $response = $leadFoxAPI->call('contact/save', [
        'email' => '[email protected]',
        'firstname' => 'Api',
        'lastname' => 'Test',
        'lifecycle' => 'lead',
        'properties' => [
            'test' => 'Test',
            'phone' => '(819) 565-1234'
        ],
        'lists' => [1, 2, 3]
    ]);
} catch (Exception $e) {
    echo $e->getMessage();
    die();
}

$message = $response->message();
if($response->success()) {
    $data = $response->data();
    $log = $response->log();
}