error_reporting(E_ALL);
ini_set('display_errors', 'On');
require_once 'config.php';
/** initialize and configure Services_WorkXpress objects **/
// get the configuration settings
$app_role = Services_WorkXpress::APPLICATION_ROLE_OCD;
$api_version = $services_workxpress_config['api_version'];
$auth_key = $services_workxpress_config[$app_role]['auth_key'];
$remote_host = $services_workxpress_config[$app_role]['remote_host'];
// load the Services_WorkXpress object
$workxpress = new Services_WorkXpress();
$workxpress->setAPIVersion($services_workxpress_config['api_version']);
$workxpress->setAuthKey($services_workxpress_config[$app_role]['auth_key']);
$workxpress->setRemoteHost($services_workxpress_config[$app_role]['remote_host']);
// load the request object
$request = $workxpress->loadRequest('LookupData', Services_WorkXpress::REQUEST_TYPE_MASS);
/** build the request **/
// add items to the request
$request->addItem(1);
$request->addItem(2);
// add fields to the request
$request->addField(3100);
$request->addField(3101);
$request->addField(102);
// add relations to the request
$request->addRelation(134, 'base');
/** make the API call **/
try {
    // make the call and get the data array
    $response = $request->call();
    $items = $response->getDataArray();
error_reporting(E_ALL);
ini_set('display_errors', 'On');
require_once 'config.php';
/** initialize and configure Services_WorkXpress objects **/
// get the configuration settings
$app_role = Services_WorkXpress::APPLICATION_ROLE_OCD;
$api_version = $services_workxpress_config['api_version'];
$auth_key = $services_workxpress_config[$app_role]['auth_key'];
$remote_host = $services_workxpress_config[$app_role]['remote_host'];
// load the Services_WorkXpress object
$workxpress = new Services_WorkXpress();
$workxpress->setAPIVersion($services_workxpress_config['api_version']);
$workxpress->setAuthKey($services_workxpress_config[$app_role]['auth_key']);
$workxpress->setRemoteHost($services_workxpress_config[$app_role]['remote_host']);
// load the request object
$request = $workxpress->loadRequest('AddNewItem', Services_WorkXpress::REQUEST_TYPE_MASS);
/** build the request **/
// add items to the request
$request->addItem(11, 'my_first_contact');
// add fields to the request
$request->addField(3100, 'John');
$request->addField(3101, 'Doe');
/** make the API call **/
try {
    // make the call and get the data array
    $response = $request->call();
    $items = $response->getDataArray();
    // show the results
    echo '<pre>' . print_r($items, true) . '</pre>';
} catch (Services_WorkXpress_Exception $e) {
    echo '<h1>Error</h1><pre>' . $e->getMessage() . '</pre>';
error_reporting(E_ALL);
ini_set('display_errors', 'On');
require_once 'config.php';
/** initialize and configure Services_WorkXpress objects **/
// get the configuration settings
$app_role = Services_WorkXpress::APPLICATION_ROLE_OCD;
$api_version = $services_workxpress_config['api_version'];
$auth_key = $services_workxpress_config[$app_role]['auth_key'];
$remote_host = $services_workxpress_config[$app_role]['remote_host'];
// load the Services_WorkXpress object
$workxpress = new Services_WorkXpress();
$workxpress->setAPIVersion($services_workxpress_config['api_version']);
$workxpress->setAuthKey($services_workxpress_config[$app_role]['auth_key']);
$workxpress->setRemoteHost($services_workxpress_config[$app_role]['remote_host']);
// load the request object
$request = $workxpress->loadRequest('LookupData');
/** build the request **/
// add items to the request
$item_array = array('id' => 1, 'fields' => array(array('id' => 3100), array('id' => 3101)));
$request->addItem($item_array);
$item_array = array('id' => 2, 'fields' => array(array('id' => 102)), 'relations' => array(array('relation_type_id' => 134, 'item_side' => 'base')));
$request->addItem($item_array);
/** make the API call **/
try {
    // make the call and get the data array
    $response = $request->call();
    $items = $response->getDataArray();
    // show the results
    echo '<pre>' . print_r($items, true) . '</pre>';
} catch (Services_WorkXpress_Exception $e) {
    echo '<h1>Error</h1><pre>' . $e->getMessage() . '</pre>';
error_reporting(E_ALL);
ini_set('display_errors', 'On');
require_once 'config.php';
/** initialize and configure Services_WorkXpress objects **/
// get the configuration settings
$app_role = Services_WorkXpress::APPLICATION_ROLE_OCD;
$api_version = $services_workxpress_config['api_version'];
$auth_key = $services_workxpress_config[$app_role]['auth_key'];
$remote_host = $services_workxpress_config[$app_role]['remote_host'];
// load the Services_WorkXpress object
$workxpress = new Services_WorkXpress();
$workxpress->setAPIVersion($services_workxpress_config['api_version']);
$workxpress->setAuthKey($services_workxpress_config[$app_role]['auth_key']);
$workxpress->setRemoteHost($services_workxpress_config[$app_role]['remote_host']);
// load the request object
$request = $workxpress->loadRequest('AddNewItem');
/** build the request **/
// add items to the request
$item_array = array('item_type_id' => 11, 'reference' => 'my_first_contact', 'fields' => array(array('id' => 3100, 'value' => 'John'), array('id' => 3101, 'value' => 'Doe')));
$request->addItem($item_array);
/** make the API call **/
try {
    // make the call and get the data array
    $response = $request->call();
    $items = $response->getDataArray();
    // show the results
    echo '<pre>' . print_r($items, true) . '</pre>';
} catch (Services_WorkXpress_Exception $e) {
    echo '<h1>Error</h1><pre>' . $e->getMessage() . '</pre>';
}
// end catch Services_WorkXpress_Exception
error_reporting(E_ALL);
ini_set('display_errors', 'On');
require_once 'config.php';
/** initialize and configure Services_WorkXpress objects **/
// get the configuration settings
$app_role = Services_WorkXpress::APPLICATION_ROLE_OCD;
$api_version = $services_workxpress_config['api_version'];
$auth_key = $services_workxpress_config[$app_role]['auth_key'];
$remote_host = $services_workxpress_config[$app_role]['remote_host'];
// load the Services_WorkXpress object
$workxpress = new Services_WorkXpress();
$workxpress->setAPIVersion($services_workxpress_config['api_version']);
$workxpress->setAuthKey($services_workxpress_config[$app_role]['auth_key']);
$workxpress->setRemoteHost($services_workxpress_config[$app_role]['remote_host']);
// load the request object
$request = $workxpress->loadRequest('StoreItemData', Services_WorkXpress::REQUEST_TYPE_MASS);
/** build the request **/
// add items to the request
$request->addItem(1);
$request->addItem(2);
// add fields to the request
$request->addField(3100, Services_WorkXpress::FIELD_ACTION_SAVE, 'John');
$request->addField(3101, Services_WorkXpress::FIELD_ACTION_SAVE, 'Doe');
$request->addField(102, Services_WorkXpress::FIELD_ACTION_CLEAR);
$request->addRelation(134, 3, 'target', 37, 4);
/** make the API call **/
try {
    // make the call and get the data array
    $response = $request->call();
    $items = $response->getDataArray();
    // show the results
error_reporting(E_ALL);
ini_set('display_errors', 'On');
require_once 'config.php';
/** initialize and configure Services_WorkXpress objects **/
// get the configuration settings
$app_role = Services_WorkXpress::APPLICATION_ROLE_OCD;
$api_version = $services_workxpress_config['api_version'];
$auth_key = $services_workxpress_config[$app_role]['auth_key'];
$remote_host = $services_workxpress_config[$app_role]['remote_host'];
// load the Services_WorkXpress object
$workxpress = new Services_WorkXpress();
$workxpress->setAPIVersion($services_workxpress_config['api_version']);
$workxpress->setAuthKey($services_workxpress_config[$app_role]['auth_key']);
$workxpress->setRemoteHost($services_workxpress_config[$app_role]['remote_host']);
// load the request object
$request = $workxpress->loadRequest('StoreItemData');
/** build the request **/
// add items to the request
$item_array = array('id' => 1, 'fields' => array(array('id' => 3100, 'action' => Services_WorkXpress::FIELD_ACTION_SAVE, 'value' => 'John'), array('id' => 3101, 'action' => Services_WorkXpress::FIELD_ACTION_SAVE, 'value' => 'Doe')), 'relations' => array(array('action' => Services_WorkXpress::RELATION_ACTION_RECYCLE, 'relation_type_id' => 134, 'id' => 4)));
$request->addItem($item_array);
$item_array = array('id' => 2, 'fields' => array(array('id' => 102, 'action' => Services_WorkXpress::FIELD_ACTION_CLEAR)), 'relations' => array(array('relation_type_id' => 134, 'item_type_id' => 3, 'related_item_side' => 'target', 'related_item_type_id' => 37, 'related_item_id' => 4)));
$request->addItem($item_array);
/** make the API call **/
try {
    // make the call and get the data array
    $response = $request->call();
    $items = $response->getDataArray();
    // show the results
    echo '<pre>' . print_r($items, true) . '</pre>';
} catch (Services_WorkXpress_Exception $e) {
    echo '<h1>Error</h1><pre>' . $e->getMessage() . '</pre>';
error_reporting(E_ALL);
ini_set('display_errors', 'On');
require_once 'config.php';
/** initialize and configure Services_WorkXpress objects **/
// get the configuration settings
$app_role = Services_WorkXpress::APPLICATION_ROLE_OCD;
$api_version = $services_workxpress_config['api_version'];
$auth_key = $services_workxpress_config[$app_role]['auth_key'];
$remote_host = $services_workxpress_config[$app_role]['remote_host'];
// load the Services_WorkXpress object
$workxpress = new Services_WorkXpress();
$workxpress->setAPIVersion($services_workxpress_config['api_version']);
$workxpress->setAuthKey($services_workxpress_config[$app_role]['auth_key']);
$workxpress->setRemoteHost($services_workxpress_config[$app_role]['remote_host']);
// load the request object
$request = $workxpress->loadRequest('ExecuteBusinessRules');
/** build the request **/
// add items to the request
$item_array = array('id' => 1, 'item_type_id' => 3, 'rules' => array(array('type' => Services_WorkXpress::RULE_TYPE_RULE, 'id' => 668), array('type' => Services_WorkXpress::RULE_TYPE_EXECUTION_POINT, 'point' => Services_WorkXpress::RULE_EXECUTION_POINT_POST_ITEM_UPDATE_NONRELATION)));
$request->addItem($item_array);
/** make the API call **/
try {
    // make the call and get the data array
    $response = $request->call();
    $items = $response->getDataArray();
    // show the results
    echo '<pre>' . print_r($items, true) . '</pre>';
} catch (Services_WorkXpress_Exception $e) {
    echo '<h1>Error</h1><pre>' . $e->getMessage() . '</pre>';
}
// end catch Services_WorkXpress_Exception
error_reporting(E_ALL);
ini_set('display_errors', 'On');
require_once 'config.php';
/** initialize and configure Services_WorkXpress objects **/
// get the configuration settings
$app_role = Services_WorkXpress::APPLICATION_ROLE_OCD;
$api_version = $services_workxpress_config['api_version'];
$auth_key = $services_workxpress_config[$app_role]['auth_key'];
$remote_host = $services_workxpress_config[$app_role]['remote_host'];
// load the Services_WorkXpress object
$workxpress = new Services_WorkXpress();
$workxpress->setAPIVersion($services_workxpress_config['api_version']);
$workxpress->setAuthKey($services_workxpress_config[$app_role]['auth_key']);
$workxpress->setRemoteHost($services_workxpress_config[$app_role]['remote_host']);
// load the request object
$request = $workxpress->loadRequest('ExecuteBusinessRules', Services_WorkXpress::REQUEST_TYPE_MASS);
/** build the request **/
// add items to the request
$request->addItem(1, 3);
// add rules to the request
$request->addRule(668);
// add executionp oints to the request
$request->addExecutionPoint(Services_WorkXpress::RULE_EXECUTION_POINT_POST_ITEM_UPDATE_NONRELATION);
/** make the API call **/
try {
    // make the call and get the data array
    $response = $request->call();
    $items = $response->getDataArray();
    // show the results
    echo '<pre>' . print_r($items, true) . '</pre>';
} catch (Services_WorkXpress_Exception $e) {