henzard
9/27/2015 - 6:28 PM

Eci Outmarket.php


ini_set('display_errors', true);
ini_set('error_reporting', E_ALL);
define('OUTMARKET_APIURL', 'https://api.omkt.co/icp');
// Load the OutMarket library
require_once('OutMarketApi.php');

// Give the API your information
OutMarketApi::getInstance()->setConfig(array(
    'appId' => 'b6b7757e-fcdc-4891-88fd-9175c9174bd6',
    'apiPassword' => 'Test@011', //'janderson@ecina.com',
    'apiUsername' => 'janderson@ecina.com', //'Diamond1!',
    'companyId' => 1708365,
    'profileId' => 52663
));

// Store the singleton
$oOutMarket = OutMarketApi::getInstance();
// Try to make the call(s)
try {
  echo '<pre>';
  // Grab all contacts
  //var_dump($oOutMarket->getContacts());
  // Grab a contact
  print_r($oOutMarket->getContact(1));
  // Create a contact
  //var_dump($oOutMarket->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
  echo '</pre>';
  echo '<pre>';
  print_r($oOutMarket->getLists());
  echo '</pre>';
} catch (Exception $oException) { // Catch any exceptions
  // Dump errors
  var_dump($oOutMarket->getErrors());
  // Grab the last raw request data
  var_dump($oOutMarket->getLastRequest());
  // Grab the last raw response data
  var_dump($oOutMarket->getLastResponse());
}