Wallogit.com
2017 © Pedro Peláez
The unofficial Infusionsoft API PHP SDK
Note: This PHP-iSDK is deprecated, and will be removed from Infusionsoft's public github on April, 30 2015. Please use infusionsoft-php instead., (*1)
This SDK allows developers to easily use the Infusionsoft API with PHP, (*2)
This SDK requires at least PHP 5.2, (*3)
git clone https://github.com/infusionsoft/PHP-iSDK.gitalternatively you can install using composerThere are two ways we can connect to the API., (*4)
First way is to use the src/conn.cfg.php configuration file, (*5)
A. You will need your Application Name and Your API Key, (*6)
You can find your application name in the url you goto to login. eg. https://YOURAPPNAME.infusionsoft.comYou can get your API Key by following this article on the User Guide http://ug.infusionsoft.com/article/AA-00442/0/How-do-I-enable-the-Infusionsoft-API-and-generate-an-API-Key.html
B. In src/conn.cfg.php file you will need to replace the following:, (*7)
connectionName - This can be anything you wantapplicationName - This is just the application name that we got in step 1APIKEYGOESHERE - This is the API Key you got in step 1We can pass in the Application Name and API Key directly into the cfgCon function, (*8)
A. You will need your Application Name and Your API Key, (*9)
You can find your application name in the url you goto to login. eg. https://YOURAPPNAME.infusionsoft.comYou can get your API Key by following this article on the User Guide http://ug.infusionsoft.com/article/AA-00442/0/How-do-I-enable-the-Infusionsoft-API-and-generate-an-API-Key.html
In the script you want to make the API call in you will need to do the following:, (*10)
require_once('src/isdk.php');$app = new iSDK();$app->cfgCon("connectionName");
OR$app->cfgCon("applicationName", "APIKEYGOESHERE");$contacts = $app->findByEmail('test@example.com',array('Id', 'FirstName', 'LastName', 'Email'));This will return a contact's Id, First Name, Last Name, and Email that has the email 'test@example.com'print_r($contacts);As of Version 1.8.3 the iSDK has the ability to log API calls to a CSV. By default logging is disabled., (*11)
To enable logging do the following:, (*12)
$app->enableLogging(1); //0 is off 1 is on$app->setLog('apilog.csv'); //This is the full path to the fileinfuDate('10/26/2013') will return '20131026T06:00:00'infuDate('10/26/2013','UK') will return '2013-26-10T06:00:00'