Download the PHP package convertkit/convertkitapi without Composer

On this page you can find all versions of the php package convertkit/convertkitapi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package convertkitapi

ConvertKit SDK PHP

The ConvertKit PHP SDK provides convinient access to the ConvertKit API from applications written in the PHP language.

It includes a pre-defined set of methods for interacting with the API.

Version Guidance

SDK Version API Version API Authentication PHP Version
1.x v3 API Key and Secret 7.4+
2.x v4 OAuth 8.0+

Refer to this guide for changes when upgrading to the v2 SDK.

Composer

You can install this PHP SDK via Composer. Run the following command:

To use the PHP SDK, use Composer's autoload:

Dependencies

The PHP SDK require the following extensions in order to work properly:

If you use Composer, these dependencies should be handled automatically.

Getting Started

2.x (v4 API, OAuth, PHP 8.0+)

First, register your OAuth application in the OAuth Applications section at https://app.convertkit.com/account_settings/advanced_settings.

Using the supplied Client ID and secret, redirect the user to ConvertKit to grant your application access to their ConvertKit account.

Once the user grants your application access to their ConvertKit account, they'll be redirected to your Redirect URI with an authorization code. For example:

your-redirect-uri?code=<auth_code>

At this point, your application needs to exchange the authorization code for an access token and refresh token.

$result is an array comprising of:

Once you have an access token, re-initialize the API class with it:

To refresh an access token:

$result is an array comprising of:

Once you have refreshed the access token i.e. obtained a new access token, re-initialize the API class with it:

API requests may then be performed:

To determine whether a new entity / relationship was created, or an existing entity / relationship updated, inspect the HTTP code of the last request:

The PSR-7 response can be fetched and further inspected, if required - for example, to check if a header exists:

1.x (v3 API, API Key and Secret, PHP 7.4+)

Get your ConvertKit API Key and API Secret here and set it somewhere in your application.

Handling Errors

The ConvertKit PHP SDK uses Guzzle for all HTTP API requests. Errors will be thrown as Guzzle's ClientException (for 4xx errors), or ServerException (for 5xx errors).

For a more detailed error message, it's possible to fetch the API's response when a ClientException is thrown:

Documentation

See the PHP SDK docs

Contributing

See our contributor guide for setting up your development environment, testing and submitting a PR.

For ConvertKit, refer to the deployment guide on how to publish a new release.


All versions of convertkitapi with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
guzzlehttp/guzzle Version ^7.0
monolog/monolog Version ^2.5|^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package convertkit/convertkitapi contains the following files

Loading the files please wait ....