Download the PHP package campaignmonitor/createsend-php without Composer

On this page you can find all versions of the php package campaignmonitor/createsend-php. 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 createsend-php

createsend Build Status

A PHP library which implements the complete functionality of the Campaign Monitor API.

Installation

Composer

If you use Composer, you can run the following command from the root of your project:

Or add campaignmonitor/createsend-php to your composer.json file:

Followed by running:

Manual Installation

Otherwise you can simply download the library and include it in your project.

After you have installed the library, simply include the relevant API class, as follows:

Authenticating

The Campaign Monitor API supports authentication using either OAuth or an API key.

Using OAuth

Depending on the environment you are developing in, you may wish to use a PHP OAuth library to get access tokens for your users. If you don't use an OAuth library, you will need to get access tokens for your users by following the instructions included in the Campaign Monitor API documentation. This package provides functionality to help you do this, as described below. You may also wish to reference this example application, which is implemented using Slim but could easily be adapted for use with any PHP framework.

The first thing your application should do is redirect your user to the Campaign Monitor authorization URL where they will have the opportunity to approve your application to access their Campaign Monitor account. You can get this authorization URL by using the CS_REST_General::authorize_url() method, like so:

If your user approves your application, they will then be redirected to the redirect_uri you specified, which will include a code parameter, and optionally a state parameter in the query string. Your application should implement a handler which can exchange the code passed to it for an access token, using CS_REST_General::exchange_token() like so:

At this point you have an access token and refresh token for your user which you should store somewhere convenient so that your application can look up these values when your user wants to make future Campaign Monitor API calls.

Once you have an access token and refresh token for your user, you can authenticate and make further API calls like so:

All OAuth tokens have an expiry time, and can be renewed with a corresponding refresh token. If your access token expires when attempting to make an API call, you will receive an error response, so your code should handle this. Here's an example of how you could do this:

Using an API key

API Call Timeout

You can set your local API call timeout time in createsend-php\class\transport.php line 11, in the CS_REST_CALL_TIMEOUT variable. Currently the default is 120 secs.

Examples

Samples for creating or accessing all resources can be found in the samples directory. These samples can be used as the basis for your own application and provide an outline of the expected inputs for each API call.

Further documentation of the inputs and outputs of each call can be found in the documentation in each of the csrest_*.php files or simply by examining the var_dump results in each of the provided samples.

Contributing

Please check the guidelines for contributing to this repository.

Releasing

Please check the instructions for releasing this library.


All versions of createsend-php with dependencies

PHP Build Version
Package Version
Requires php Version >=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 campaignmonitor/createsend-php contains the following files

Loading the files please wait ....