Download the PHP package infusionsoft/php-sdk without Composer
On this page you can find all versions of the php package infusionsoft/php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download infusionsoft/php-sdk
More information about infusionsoft/php-sdk
Files in infusionsoft/php-sdk
Package php-sdk
Short Description PHP SDK for the Infusionsoft
License MIT
Homepage https://developer.infusionsoft.com
Informations about the package php-sdk
Infusionsoft PHP SDK
Version Notes
This version implements RESTful endpoints, a new version of Guzzle, and a restructured request handler.
As of version 1.6, PHP 8.1+ is required.
Breaking Change
With the Guzzle 7 upgrade, there was a refactor on the request
function name in Infusionsoft\Http\ClientInterface. If you created a custom HttpClient, you'll need to update to use the new function name of call
If you use the Contacts
, Orders
or Products
services, there are now two different classes handling each service - one for REST, one for XML-RPC. This version of the SDK will load the REST class by default. If you still need the XML-RPC class, pass 'xml'
as an argument when requesting the object: $infusionsoft->orders('xml')'
Kudos to toddstoker and mattmerrill for their contributions to this release.
Install
Using the composer CLI:
Or manually add it to your composer.json:
Authentication
Currently Keap supports two types of authentication for our APIs: the OAuth2 Access Code Grant and API Keys.
Developers of third-party integrations should always use our OAuth2 authentication, but developers building integrations for a single tenant may find the use of API Keys much simpler.
OAuth2 Access Code Grant
The client ID and secret are the key and secret for your OAuth2 application found at the Infusionsoft Developers website.
API Keys
API Keys are a "password" for your data in an application and should always be treated like a dangerous secret.
In our UI you will find an API Settings screen which divides API Keys into two distinct categories:
Personal Access Tokens
, which are scoped to your own user account and can only see and manipulate the data you have access to.Service Account Keys
, which can only be authorized by an Administrator and have full access to the data stored in the application.
For additional information on how to authorize and use PATs and SAKs please see our developer documentation.
Making XML-RPC Requests
Making REST Requests
The PHP SDK is setup to allow easy access to REST endpoints. In general, a single result is returned as a Class representing that object, and multiple objects are returned as an Infusionsoft Collection, which is simply a wrapper around an array of results making them easier to manage.
The standard REST operations are mapped to a series of simple functions. We'll use the Tasks service for our examples, but the operations below work on all documented Infusionsoft REST services.
To retrieve all tasks:
To retrieve a single task:
To query only completed tasks:
You can chain where()
as many times as you'd like, or you can pass an array:
To create a task:
Then update that task:
And finally, to delete the task:
Several REST services have a /sync
endpoint, which we provide a helper method for:
This returns a list of tasks created or updated since the sync ID was last generated.
Dates
DateTime objects are used instead of a DateTime string where the date(time) is a parameter in the method.
Debugging
To enable debugging of requests and responses, you need to set the debug flag to try by using:
Once enabled, logs will by default be written to an array that can be accessed by:
You can utilize the powerful logging plugin built into Guzzle by using one of the available adapters. For example, to use the Monolog writer to write to a file:
Testing
Laravel Framework Support
Laravel < 5.5
In config/app.php, register the service provider
Register the Facade (optional)
Laravel >= 5.5
In Laravel 5.5, package auto-discovery was added. The service provider and facade will be detected for you. Continue by publishing the vendor assets and adding your env variables.
Publish the config
Set your env variables
Access Infusionsoft from the Facade or Binding
Lumen Service Provider
In bootstrap/app.php, register the service provider
Set your env variables (make sure you're loading your env file in app.php)
Access Infusionsoft from the Binding
SDK Development
You can install the Composer dependencies without installing Composer:
You can access the samples by spinning up the Docker container for the Composer dependencies:
Tests can be executed without installing PHP in the host environment (while the main container is running):
If using Docker for Windows, please see .env
for additional details.
Contributing
Please see CONTRIBUTING for details.
License
The MIT License (MIT). Please see License File for more information.
All versions of php-sdk with dependencies
guzzlehttp/guzzle Version ^7.4.2
lstrojny/fxmlrpc Version ^0.22.0
psr/log Version ^1.0|^2.0|^3.0
laminas/laminas-diactoros Version ^2.26.0
php-http/guzzle7-adapter Version ^1.0
php-http/message Version ^1.16
psr/http-factory Version ^1.0
php-http/message-factory Version ^1.1