darkgoldblade01/infusionsoft

There is no license information available for the latest version (v0.0.3.1) of this package.

Infusionsoft PHP API - an easy to use version of the PHP Infusionsoft API using GuzzleHTTP.

v0.0.3.1 2017-08-24 02:54 UTC

This package is auto-updated.

Last update: 2024-03-13 03:13:05 UTC


README

Master Branch

Build Status

Dev Branch

Build Status

Infusionsoft PHP API - an easy to use version of the PHP Infusionsoft API using GuzzleHTTP.

Requirements

PHP 7.0 and later

Installation & Usage

Composer

To install the bindings via Composer:

composer require darkgoldblade01/infusionsoft

Getting Started

Getting started is easy, you just have to pass the variables required to use the endpoints you want. For instance, the access token is not required if you are using the authorzation endpoints, but everything is required for any other request.

<?php
$infusionsoft = new darkgoldblade01\Infusionsoft\Infusionsoft([
    'client_id' => '_YOUR_CLIENT_ID_',
    'client_secret' => '_YOUR_CLIENT_SECRET_',
    'redirect_uri' => '_YOUR_REDIRECT_URI_',
    'access_token' => '_YOUR_ACCESS_TOKEN_ARRAY_'
]);

Authroization

Generate the URLs required, along with retreiving access tokens, and refreshing tokens.

Setup

<?php
$infusionsoft = new darkgoldblade01\Infusionsoft\Infusionsoft([
    'client_id' => '_YOUR_CLIENT_ID_',
    'client_secret' => '_YOUR_CLIENT_SECRET_',
    'redirect_uri' => '_YOUR_REDIRECT_URI_',
]);

Generate Authroization URL

This will return the URL required to authroize a user, and redirect them back to your application

$url = $infusionsoft->authorize()->getAuthorizationUrl();

Get Token from Response Code

This will exchange the code variable in the URL on a redirect from Infusionsoft for an access token, verifying it against the client_id, client_secret, and redirect_uri.

$code = $_GET['code'];
$token = $infusionsoft->authorize()->getToken($code);

Refresh Token

This will refresh the access token you have by sending the refresh code, and getting the response back.

$refreshedToken = $infusionsoft->authorize()->refreshToken();

Campaigns

Get, update, and delete campaigns.

Setup

<?php
$infusionsoft = new darkgoldblade01\Infusionsoft\Infusionsoft([
    'client_id' => '_YOUR_CLIENT_ID_',
    'client_secret' => '_YOUR_CLIENT_SECRET_',
    'redirect_uri' => '_YOUR_REDIRECT_URI_',
    'access_token' => '_YOUR_ACCESS_TOKEN_ARRAY_',
]);

List All Campaigns

This will return all of the campaigns in Infusionsoft, results are paginated.

$campaigns = $infusionsoft->campaigns()->listCampaigns();

Get a Specific Campaign

This will return the campaign you specify by using the ID.

$campaign = $infusionsoft->campaigns()->getCampaign($campaignId);

Contacts

Get, update, and delete contacts.

Setup

<?php
$infusionsoft = new darkgoldblade01\Infusionsoft\Infusionsoft([
    'client_id' => '_YOUR_CLIENT_ID_',
    'client_secret' => '_YOUR_CLIENT_SECRET_',
    'redirect_uri' => '_YOUR_REDIRECT_URI_',
    'access_token' => '_YOUR_ACCESS_TOKEN_ARRAY_',
]);

List All Contacts

This will return all of the contacts in Infusionsoft, results are paginated.

$campaigns = $infusionsoft->contacts()->listContacts();

Get a Specific Campaign

This will return the contact you specify by using the ID.

$campaign = $infusionsoft->contacts()->getContact($contactId);