Skip to content

Instantly share code, notes, and snippets.

@henzard
Created September 27, 2015 18:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save henzard/5b155aca70bfcd836f33 to your computer and use it in GitHub Desktop.
Save henzard/5b155aca70bfcd836f33 to your computer and use it in GitHub Desktop.
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());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment