Skip to content

Commit

Permalink
Merge pull request #320 from infusionsoft/Switch_calls_to_use_headers…
Browse files Browse the repository at this point in the history
…_and_add_APIkey_auth

Switch calls to use headers and add apikey auth
  • Loading branch information
ROMzombie authored Mar 25, 2024
2 parents 975ea80 + 0c42817 commit e810682
Show file tree
Hide file tree
Showing 8 changed files with 468 additions and 222 deletions.
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ Or manually add it to your composer.json:

## Authentication

The client ID and secret are the key and secret for your OAuth2 application found at the [Infusionsoft Developers](https://keys.developer.infusionsoft.com/apps/mykeys) website.
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](https://keys.developer.keap.com) website.

```php

Expand Down Expand Up @@ -75,6 +80,26 @@ if ($infusionsoft->getToken()) {
}
```

### 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](https://developer.infusionsoft.com/pat-and-sak/).

```php
require_once 'vendor/autoload.php';

$infusionsoft = new \Infusionsoft\Infusionsoft(array(
'apikey' => $APIKeyRetrievedFromCredentialStorage,
));

// MAKE INFUSIONSOFT REQUEST
```

## Making XML-RPC Requests

```php
Expand Down
10 changes: 6 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
}
],
"require": {
"php": ">=7.3",
"php": ">=8.1",
"guzzlehttp/guzzle": "^7.4.2",
"lstrojny/fxmlrpc": "^0.20.0",
"lstrojny/fxmlrpc": "^0.22.0",
"psr/log": "^1.0|^2.0|^3.0",
"laminas/laminas-diactoros": "^2.18.1",
"laminas/laminas-diactoros": "^2.26.0",
"php-http/guzzle7-adapter": "^1.0",
"php-http/message": "^1.6"
"php-http/message": "^1.16",
"psr/http-factory": "^1.0",
"php-http/message-factory": "^1.1"
},
"require-dev": {
"mockery/mockery": "^1.2",
Expand Down
Loading

0 comments on commit e810682

Please sign in to comment.