2017 © Pedro Peláez
 

library icontact-api-php

iContact API for PHP

image

mizanur/icontact-api-php

iContact API for PHP

  • Wednesday, April 19, 2017
  • by mizan3008
  • Repository
  • 1 Watchers
  • 1 Stars
  • 29,966 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 12 % Grown

The README.md

iContact API

Super-simple, minimum abstraction iContact API v2 wrapper, in PHP., (*1)

Requires PHP 5.3 and a pulse., (*2)

Installation

You can install the iContact-api using Composer:, (*3)

composer require mizanur/icontact-api-php

Examples

use this on top of your class:, (*4)

use iContact\iContactApi;

// Give the API your information, (*5)

iContactApi::getInstance()->setConfig(array(
    'appId'       => '', 
    'apiPassword' => '', 
    'apiUsername' => ''
));

// Store the singleton, (*6)

$oiContact = iContactApi::getInstance();

// Try to make the call(s), (*7)

try {
    //  are examples on how to call the  iContact PHP API class
    // Grab all contacts
    var_dump($oiContact->getContacts());
    // Grab a contact
    var_dump($oiContact->getContact(42094396));
    // Create a contact
    var_dump($oiContact->addContact('joe@shmoe.com', null, null, 'Joe', 'Shmoe', null, '123 Somewhere Ln', 'Apt 12', 'Somewhere', 'NW', '12345', '123-456-7890', '123-456-7890', null));
    // Get messages
    var_dump($oiContact->getMessages());
    // Create a list
    var_dump($oiContact->addList('somelist', 1698, true, false, false, 'Just an example list', 'Some List'));
    // Subscribe contact to list
    var_dump($oiContact->subscribeContactToList(42094396, 179962, 'normal'));
    // Grab all campaigns
    var_dump($oiContact->getCampaigns());
    // Create message
    var_dump($oiContact->addMessage('An Example Message', 585, '<h1>An Example Message</h1>', 'An Example Message', 'ExampleMessage', 33765, 'normal'));
    // Schedule send
    var_dump($oiContact->sendMessage(array(33765), 179962, null, null, null, mktime(12, 0, 0, 1, 1, 2012)));
    // Upload data by sending a filename (execute a PUT based on file contents)
    var_dump($oiContact->uploadData('/path/to/file.csv', 179962));
    // Upload data by sending a string of file contents
    $sFileData = file_get_contents('/path/to/file.csv');  // Read the file
    var_dump($oiContact->uploadData($sFileData, 179962)); // Send the data to the API
} catch (Exception $oException) { // Catch any exceptions
    // Dump errors
    var_dump($oiContact->getErrors());
    // Grab the last raw request data
    var_dump($oiContact->getLastRequest());
    // Grab the last raw response data
    var_dump($oiContact->getLastResponse());
}

Note for contributors: This is not Code Golf., (*8)

The Versions

19/04 2017

dev-master

9999999-dev https://github.com/mizanur-rahman/icontact-api-php

iContact API for PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-curl *

 

by Mizanur Rahman

icontact-api-php

19/04 2017

v2.2

2.2.0.0 https://github.com/mizanur-rahman/icontact-api-php

iContact API for PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-curl *

 

by Mizanur Rahman

icontact-api-php

18/11 2015

2.0

2.0.0.0 https://github.com/mizanur-rahman/icontact-api-php

iContact API for PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-curl *

 

by Mizanur Rahman

icontact-api-php