iconneqt/rest-api-client

A PHP class library for the iConneqt REST API.

1.0.6 2017-12-08 09:12 UTC

This package is not auto-updated.

Last update: 2024-04-20 15:48:44 UTC


README

Version 1.0.6

A PHP class library for the iConneqt REST API.

license Build Status

Copyright © 2016-2017 Advanced CRMMail Technology B.V.

Documentation

The API documentation can be found here: http://demo.iconneqt.nl/api/docs/.

Installation

Either use the included autoloader in src/autoloader.php or install using Composer:

composer require iconneqt/rest-api-client

Classes

Class hierarchy in the src directory.

If you use Composer, you can add the src to the autoloader as such:

/* @var $loader Composer\Autoload\ClassLoader */
$loader = require 'path-to-vendor/autoload.php';
$loader->add('Iconneqt', 'path-to-src');

The two most important classes are the following:

\Iconneqt\Api\Rest\Iconneqt

High-level access to the iConneqt REST API, returning rich objects from which you can explore/dive into the API further.

Method calls to the Iconneqt class return objects where properties can be accessed using getters and further objects can be queried from the REST API.

Alternatively, you can just use the Iconneqt class directly.

\Iconneqt\Api\Rest\Client\Client

Low-level API access component used internally by the Iconneqt class.

Essentially, this class is a somewhat generic wrapper for cURL lightly tuned for the iConneqt REST API.

You may want to use this class if you want to use all available functionality the REST API has to offer or want to bypass the use of objects.

Method calls to the Client class return stdClass objects by default, but can be set to return associative arrays instead.

Examples

Examples in the example directory.

Authentication for examples

  • Copy the file auth.example.ini to auth.ini.
  • Put your iConneqt username and password in the new file.
  • If you are on a different server from demo.iconneqt.nl, change the URL in the auth.ini file accordingly.

Examples

  • check_email demonstrates a simple form to check if an email address exists on a given list. Start with this example as an introduction to the Iconneqt class.
  • form shows a dynamic form to add new subscribers to a list.
  • low-level demonstrates using the Client class directly.