if ($watchlist_id > 0) { $action = DOBA_API_ACTION_GETPRODUCTDETAIL; $data = array('watchlist_id' => $watchlist_id); if ($api->compileRequestXml($action, $data) && $api->sendRequest()) { $objDobaProducts = DobaProductAPI::parseProductDetails($api->getResponseXml()); if (is_a($objDobaProducts, 'DobaProducts') && DobaInteraction::loadDobaProductsIntoDB($objDobaProducts)) { require_once 'doba/DobaLog.php'; DobaLog::logProductApiLoad($objDobaProducts, 'success'); header('Location: ' . FILENAME_DOBA_PRODUCTS . '?api=success'); exit; } else { $msg = 'Your request could not be completed at this time. Please try again later.'; } } else { if ($api->hasErrors()) { $msg = 'Your request could not be completed due to the following errors:<br>- ' . implode('<br>- ', $api->getErrors()); } else { $msg = 'Your request could not be completed at this time. Please try again later.'; } } } else { $msg = 'Please select a watchlist to use.'; } } $watchlists = array(); if (DOBA_API_ENABLED !== true) { $msg = 'You must set up your Doba API authentication before you can use this tool. Find out more by sending an email to support@doba.com.'; } else { // load up the watchlists set up under the current api auth $action = DOBA_API_ACTION_GETWATCHLISTS; $data = array();
<?php ini_set('include_path', ini_get('include_path') . ':' . $_SERVER['DOCUMENT_ROOT'] . '/admin/includes/'); include_once 'doba/DobaApi.php'; include_once 'doba/DobaProductAPI.php'; $api = new DobaApi(); // change the following variables to have the data you wish to submit $action = DOBA_API_ACTION_GETPRODUCTDETAIL; $data = array('watchlist_id' => '94227'); // end fields to be changed echo "<strong>Testing:</strong> " . $action . "<br><strong>With data:</strong><pre>"; print_r($data); echo "</pre><strong>Result:</strong>"; if ($api->compileRequestXml($action, $data) && $api->sendRequest()) { echo " Successfully submitted<br><strong>Response XML:</strong><pre>"; echo htmlentities($api->getResponseXml()); $productList = DobaProductAPI::parseProductDetails($api->getResponseXml()); var_dump($productList); } else { if ($api->hasErrors()) { echo " Submission Failure, with errors<br><strong>Errors:</strong><pre>"; print_r($api->getErrors()); } else { echo " Submission Failure, no errors<br><strong>Object dump:</strong><pre>"; var_dump($api); } } echo "</pre>";