Git Product home page Git Product logo

isdk's Introduction

PHP iSDK

Note: This PHP-iSDK is deprecated, and will be removed from Infusionsoft's public github on April, 30 2015. Please use infusionsoft-php instead.

This SDK allows developers to easily use the Infusionsoft API with PHP

Install Instructions

This SDK requires at least PHP 5.2

  1. Clone the repository to your system
  • git clone https://github.com/infusionsoft/PHP-iSDK.git
  • alternatively you can install using composer
  1. Copy the "src" folder (or its contents) to the folder that will hold the SDK

Configuration

There are two ways we can connect to the API.

  1. First way is to use the src/conn.cfg.php configuration file

    A. You will need your Application Name and Your API Key

    B. In src/conn.cfg.php file you will need to replace the following:

    • connectionName - This can be anything you want
    • applicationName - This is just the application name that we got in step 1
    • APIKEYGOESHERE - This is the API Key you got in step 1
  2. We can pass in the Application Name and API Key directly into the cfgCon function

    A. You will need your Application Name and Your API Key

Making Your First API Call

In the script you want to make the API call in you will need to do the following:

  1. We need to require the iSDK
  • require_once('src/isdk.php');
  1. Next we need to create an object
  • $app = new iSDK();
  1. Next we need to create the connection
  • $app->cfgCon("connectionName"); OR
  • $app->cfgCon("applicationName", "APIKEYGOESHERE");
  1. Next we will make our first API call using the ContactService.findByEmail method. This method returns contact information by an email address we send
  • $contacts = $app->findByEmail('[email protected]',array('Id', 'FirstName', 'LastName', 'Email'));
  • This will return a contact's Id, First Name, Last Name, and Email that has the email '[email protected]'
  1. Finally we want to print the return information to the browser window
  • print_r($contacts);

How to Use Logging

As of Version 1.8.3 the iSDK has the ability to log API calls to a CSV. By default logging is disabled.

To enable logging do the following:

  1. In the script you want to log the API Calls of add this after you create the object
  • $app->enableLogging(1); //0 is off 1 is on
  1. (Optional) You can set the location of the CSV. By default the csv is created in the same directory as isdk.php
  • $app->setLog('apilog.csv'); //This is the full path to the file

Misc Functions

  1. infuDate() - formats your date string for use with the API. Has an optional parameter for doing UK date formats.
  • infuDate('10/26/2013') will return '20131026T06:00:00'
  • infuDate('10/26/2013','UK') will return '2013-26-10T06:00:00'

iSDK

isdk's People

Contributors

jakedewitt avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.