<?php include_once '../includes/Five9.php'; /** * * Created By: Ryan Kiel * * ------ONLY UPDATES SINGLE RECORDS------ * SERVICE CALLS: * crmUpdateSettings (extends basicImportSettings) * record->recordData * * RETURNS: * return->crmImportResult */ $five9 = new f9(); $basicImportSettings = array('allowDataCleanup' => 'false', 'fieldsMapping' => array(array("columnNumber" => '1', "fieldName" => "number1", "key" => true), array("columnNumber" => '2', "fieldName" => "first_name", "key" => false), array("columnNumber" => '3', "fieldName" => "last_name", "key" => false)), 'seperator' => '', 'skipHeaderLine' => false); $crmUpdateSettings = array("crmAddMode" => "DONT_ADD", "crmUpdateMode" => "UPDATE_FIRST"); //IMPORTANT: crmUpdateSettings EXTENDS basicImportSettings.. MERGE THEM //ALL SERVICE PARAMETERS BELOW $crmUpdateSettings = array_merge($basicImportSettings, $crmUpdateSettings); $record = array("8885559999", "hi", "hiiii"); $xml_data = array('crmUpdateSettings' => $crmUpdateSettings, 'record' => $record); //request parameters $result = $five9->updateCrmRecord($crmUpdateSettings, $record); print_r($result); /* stdClass Object ( [return] => stdClass Object ( [failureMessage] =>
<?php include_once '../includes/Five9.php'; /** * * Created By: Ryan Kiel * * SERVICE CALLS: * lookupCriteria type: crmLookupCriteria * * RETURNS: * return->contactLookupResult */ $five9 = new f9(); $result = $five9->getContactRecords_all(); echo "returned start\n"; print_r($five9->getLastRequest($five9)); echo "returned end\n"; echo '<pre>'; var_dump($result); echo '</pre>'; echo "END"; /* * RETURNS array (size=1) 'return' => object(stdClass)[3] public 'fields' => array (size=18) 0 => string 'number1' (length=7) 1 => string 'number2' (length=7) 2 => string 'number3' (length=7)
<?php include_once '../includes/Five9.php'; /** * * Created By: Ryan Kiel * * ------GETS GENERAL INFO ABOUT A LIST------ * SERVICE CALLS: * listNamePattern string * * RETURNS: * return->listInfo */ $five9 = new f9(); $listNamePattern = null; //Returns all lists if null //$listNamePattern = "test list"; //Returns specified list $result = $five9->getListsInfo($listNamePattern); print_r($result); /* RETURNS stdClass Object ( [return] => Array ( [0] => stdClass Object ( [name] => test list [size] => 2 )
<?php include_once '../includes/Five9.php'; /** * * Created By: Ryan Kiel * * ------ADDS MULTIPLE RECORDS------ * SERVICE CALLS: * listName string * listUpdateSettings->listUpdateSettings (extends basicImportSettings) * importData * * RETURNS: * return->importIdentifier */ $five9 = new f9(); $listName = "test web2campaign list"; $basicImportSettings = array('allowDataCleanup' => 'false', 'fieldsMapping' => array(array("columnNumber" => '1', "fieldName" => "number1", "key" => true), array("columnNumber" => '2', "fieldName" => "first_name", "key" => false), array("columnNumber" => '3', "fieldName" => "last_name", "key" => false)), 'seperator' => '', 'skipHeaderLine' => false); $listUpdateSettings = array('cleanListBeforeUpdate' => false, "crmAddMode" => "ADD_NEW", "crmUpdateMode" => "UPDATE_FIRST", "listAddMode" => "ADD_FIRST"); //IMPORTANT: crmUpdateSettings EXTENDS basicImportSettings.. MERGE THEM //ALL SERVICE PARAMETERS BELOW $listUpdateSettings = array_merge($basicImportSettings, $listUpdateSettings); $importData = array(array("5555776741", "test_first", "test_last"), array("5551112239", "test_first2", "test_last2"), array(rand(1111111111, 9999999999), "test", "name")); $result = $five9->addToList($listName, $listUpdateSettings, $importData); print_r($result); /* stdClass Object ( [return] => stdClass Object ( [keyFields] => number1
<?php include_once '../includes/Five9.php'; /** * * Created By: Ryan Kiel * * SERVICE CALLS: * crmDeleteSettings (extends basicImportSettings) * importData type: importData * * RETURNS: * return->importIdentifier */ $five9 = new f9(); $basicImportSettings = array('allowDataCleanup' => 'false', 'fieldsMapping' => array(array("columnNumber" => '1', "fieldName" => "number1", "key" => false), array("columnNumber" => '2', "fieldName" => "first_name", "key" => true), array("columnNumber" => '3', "fieldName" => "last_name", "key" => false)), 'seperator' => '', 'skipHeaderLine' => false); $crmDeleteSettings = array('crmDeleteMode' => 'DELETE_ALL'); //IMPORTANT: crmDeleteSettings EXTENDS basicImportSettings.. MERGE THEM //ALL SERVICE PARAMETERS BELOW $crmDeleteSettings = array_merge($basicImportSettings, $crmDeleteSettings); $importData = array(array("3716867197", "test", "name")); $result = $five9->deleteFromContacts($crmDeleteSettings, $importData); print_r($result); /* RETURNS Begin<br/><br/>601fa926-f058-45d5-86e8-43b720beaf76stdClass Object ( [return] => stdClass Object ( [failureMessage] => There were errors during the upload [keyFields] => number1 [uploadDuplicatesCount] => 0
<?php include_once '../includes/Five9.php'; /** * * Created By: Ryan Kiel * * ------ONLY UPDATES SINGLE RECORDS------ * SERVICE CALLS: * listName string * listUpdateSimpleSettings->listUpdateSimpleSettings (extends basicImportSettings) * record->recordData->fields * * RETURNS: * nothing */ $five9 = new f9(); $listName = "test web2campaign list"; $listUpdateSimpleSettings = array('callAsap' => false, 'fieldsMapping' => array(array("columnNumber" => '1', "fieldName" => "number1", "key" => true), array("columnNumber" => '2', "fieldName" => "first_name", "key" => false), array("columnNumber" => '3', "fieldName" => "last_name", "key" => false))); //IMPORTANT: crmUpdateSettings EXTENDS basicImportSettings.. MERGE THEM //ALL SERVICE PARAMETERS BELOW $listUpdateSimpleSettings = array_merge($listUpdateSimpleSettings); $record = array("5555776354", "ggg", "Draper"); $result = $five9->addRecordToListSimple($listName, $listUpdateSimpleSettings, $record); $variables = get_object_vars($result); echo '<pre>'; var_dump($variables); echo '</pre>'; echo "END"; /* * RETURNS * <pre>array(0) {
<?php include_once '../includes/Five9.php'; /** * * Created By: Ryan Kiel * SERVICE CALLS: * field->(displayAs,mapTo,Name,restrictions->(isEnabled,type,value),system,type) * * RETURNS: * modifyContactFieldResponse */ $five9 = new f9(); $contactFieldRestriction = array('isEnabled' => false, 'type' => '', 'value' => ''); $field = array('field' => array('displayAs' => 'Short', 'mapTo' => 'None', 'name' => 'other', 'system' => false, 'type' => 'STRING')); $result = $five9->modifyContactField($field); print_r($result); /* RETURNS stdClass Object ( ) Process finished with exit code 0 */
<?php include_once '../includes/Five9.php'; /** * * Created By: Ryan Kiel * * ------DELETES 1 RECORD FROM A LIST----- * SERVICE CALLS: * listName * listDeleteSettings (extends basicImportSettings) * record->recordData * * RETURNS: * return->listImportResult */ $five9 = new f9(); $listName = "test list"; $basicImportSettings = array('allowDataCleanup' => 'false', 'fieldsMapping' => array(array("columnNumber" => '1', "fieldName" => "number1", "key" => true), array("columnNumber" => '2', "fieldName" => "first_name", "key" => false), array("columnNumber" => '3', "fieldName" => "last_name", "key" => false)), 'seperator' => '', 'skipHeaderLine' => false); $listDeleteMode = array('listDeleteMode' => 'DELETE_IF_SOLE_CRM_MATCH'); //$data = array ( "5555776754" , "Don1" , "Draper" ); //IMPORTANT: crmUpdateSettings EXTENDS basicImportSettings.. MERGE THEM //ALL SERVICE PARAMETERS BELOW $listDeleteSettings = array_merge($basicImportSettings, $listDeleteMode); $record = array("5555776754", "Don1", "Draper"); $result = $five9->deleteRecordFromList($listName, $listDeleteSettings, $record); print_r($result); /* RETURNS stdClass Object ( [return] => stdClass Object
<?php include_once '../includes/Five9.php'; /** * * Created By: Ryan Kiel * * SERVICE CALLS: * crmDeleteSettings (extends basicImportSettings) * csvData (string) * * RETURNS: * return->importIdentifier */ $five9 = new f9(); $basicImportSettings = array('allowDataCleanup' => 'false', 'fieldsMapping' => array(array("columnNumber" => '1', "fieldName" => "number1", "key" => true), array("columnNumber" => '2', "fieldName" => "first_name", "key" => false), array("columnNumber" => '3', "fieldName" => "last_name", "key" => false)), 'seperator' => '', 'skipHeaderLine' => false); $crmDeleteSettings = array('crmDeleteMode' => 'DELETE_ALL'); //IMPORTANT: crmDeleteSettings EXTENDS basicImportSettings.. MERGE THEM //ALL SERVICE PARAMETERS BELOW $crmDeleteSettings = array_merge($basicImportSettings, $crmDeleteSettings); $csvData = file_get_contents('../includes/testList.csv'); $result = $five9->deleteFromContactsCsv($crmDeleteSettings, $csvData); print_r($result); /* RESULT Begin<br/><br/>stdClass Object ( [return] => stdClass Object ( [keyFields] => number1 [uploadDuplicatesCount] => 0 [uploadErrorsCount] => 0
<?php include_once '../includes/Five9.php'; /** * * Created By: Ryan Kiel * * SERVICE CALLS: * field->(displayAs,mapTo,Name,restrictions->(isEnabled,type,value),system,type) * * RETURNS: * createContactFieldResponse */ $five9 = new f9(); $contactFieldRestriction = array('isEnabled' => false, 'type' => '', 'value' => ''); $field = array('field' => array('displayAs' => 'Short', 'mapTo' => 'None', 'name' => 'other', 'system' => false, 'type' => 'STRING')); $result = $five9->createContactField($field); print_r($result); /* RETURNS Begin<br/><br/>601fhjhhhh58-45d5-86e8-43b720beaf76stdClass Object ( [return] => stdClass Object ( [failureMessage] => There were errors during the upload [keyFields] => number1 [uploadDuplicatesCount] => 0 [uploadErrorsCount] => 0 [warningsCount] => stdClass Object ( [entry] => stdClass Object (
<?php include_once '../includes/Five9.php'; /** * * Created By: Ryan Kiel * * * ------DELETES MULTIPLE RECORDS DOES NOT DELETE CRM CONTACTS------ * SERVICE CALLS: * listName * listDeleteSettings (extends basicImportSettings) * csvData * * RETURNS: * return->importIdentifier */ $five9 = new f9(); $listName = "test list"; //readCSV////////// $csvData = file_get_contents('../includes/testList.csv'); $basicImportSettings = array('allowDataCleanup' => 'false', 'fieldsMapping' => array(array("columnNumber" => '1', "fieldName" => "number1", "key" => true), array("columnNumber" => '2', "fieldName" => "first_name", "key" => false), array("columnNumber" => '3', "fieldName" => "last_name", "key" => false)), 'seperator' => '', 'skipHeaderLine' => false); $listDeleteMode = array('listDeleteMode' => 'DELETE_ALL'); //IMPORTANT: crmUpdateSettings EXTENDS basicImportSettings.. MERGE THEM //ALL SERVICE PARAMETERS BELOW $listDeleteSettings = array_merge($basicImportSettings, $listDeleteMode); $result = $five9->deleteFromListCsv($listName, $listDeleteSettings, $csvData); print_r($result); /* RESULT stdClass Object ( [return] => stdClass Object
<?php include_once '../includes/Five9.php'; /** * * Created By: Ryan Kiel * * SERVICE CALLS: * fieldName * * RETURNS: * deleteContactFieldResponse */ $five9 = new f9(); $fieldName = array('fieldName' => 'test'); $result = $five9->deleteContactField($fieldName); print_r($result); /* RETURNS array( ) */
<?php include_once '../includes/Five9.php'; /** * * Created By: Ryan Kiel * * ------ADDS MULTIPLE RECORDS------ * SERVICE CALLS: * listName string * listUpdateSettings->listUpdateSettings (extends basicImportSettings) * importData * * RETURNS: * return->importIdentifier */ $five9 = new f9(); $listName = "test list"; $basicImportSettings = array('allowDataCleanup' => 'false', 'fieldsMapping' => array(array("columnNumber" => '1', "fieldName" => "number1", "key" => true), array("columnNumber" => '2', "fieldName" => "first_name", "key" => false), array("columnNumber" => '3', "fieldName" => "last_name", "key" => false)), 'skipHeaderLine' => true); $listUpdateSettings = array('cleanListBeforeUpdate' => false, "crmAddMode" => "ADD_NEW", "crmUpdateMode" => "UPDATE_FIRST", "listAddMode" => "ADD_FIRST"); //IMPORTANT: crmUpdateSettings EXTENDS basicImportSettings.. MERGE THEM //ALL SERVICE PARAMETERS BELOW $listUpdateSettings = array_merge($basicImportSettings, $listUpdateSettings); $importData = array(array("5555776741", "Don0454545", "Draper")); $result = $five9->asyncAddRecordsToList($listName, $listUpdateSettings, $importData); print_r($result);
<?php include_once '../includes/Five9.php'; /** * * Created By: Ryan Kiel * * * ------DELETES MULTIPLE RECORDS DOES NOT DELETE CRM CONTACTS------ * SERVICE CALLS: * listName * listDeleteSettings (extends basicImportSettings) * importData type: importData * * RETURNS: * return->importIdentifier */ $five9 = new f9(); $listName = "test web2campaign list"; $basicImportSettings = array('allowDataCleanup' => 'false', 'fieldsMapping' => array(array("columnNumber" => '1', "fieldName" => "number1", "key" => true), array("columnNumber" => '2', "fieldName" => "first_name", "key" => false), array("columnNumber" => '3', "fieldName" => "last_name", "key" => false)), 'seperator' => '', 'skipHeaderLine' => false); $listDeleteMode = array('listDeleteMode' => 'DELETE_ALL'); //IMPORTANT: crmUpdateSettings EXTENDS basicImportSettings.. MERGE THEM //ALL SERVICE PARAMETERS BELOW $listDeleteSettings = array_merge($basicImportSettings, $listDeleteMode); $importData = array(array("5555776741", "Don0454545", "Draper"), array("5551112239", "betty", "Smith"), array(rand(1111111111, 9999999999), "test", "name")); $result = $five9->deleteFromList($listName, $listDeleteSettings, $importData); print_r($result); /* RETURNS stdClass Object ( [return] => stdClass Object (
<?php include_once '../includes/Five9.php'; /** * * Created By: Ryan Kiel * * ------USE ONLY OFF PEAK------ * SERVICE CALLS: * crmUpdateSettings (extends basicImportSettings) * csvData (string) * * RETURNS: * return->importIdentifier */ $five9 = new f9(); $basicImportSettings = array('allowDataCleanup' => 'false', 'fieldsMapping' => array(array("columnNumber" => '1', "fieldName" => "number1", "key" => true), array("columnNumber" => '2', "fieldName" => "first_name", "key" => false), array("columnNumber" => '3', "fieldName" => "last_name", "key" => false)), 'seperator' => '', 'skipHeaderLine' => false); $crmUpdateSettings = array("crmAddMode" => "DONT_ADD", "crmUpdateMode" => "UPDATE_ALL"); //IMPORTANT: crmUpdateSettings EXTENDS basicImportSettings.. MERGE THEM //ALL SERVICE PARAMETERS BELOW $crmUpdateSettings = array_merge($basicImportSettings, $crmUpdateSettings); //readCSV////////// $csvData = file_get_contents('../includes/testList.csv'); $xml_data = array('crmUpdateSettings' => $crmUpdateSettings, 'csvData' => $csvData); //request parameters $result = $five9->updateContactsCsv($crmUpdateSettings, $csvData); print_r($result); /* RESULT Begin<br/><br/>stdClass Object ( [return] => stdClass Object
<?php include_once '../includes/Five9.php'; /** * * Created By: Ryan Kiel * * ------USE ONLY OFF PEAK------ * SERVICE CALLS: * crmUpdateSettings (extends basicImportSettings) * importData values * * RETURNS: * return->importIdentifier */ $five9 = new f9(); $basicImportSettings = array('allowDataCleanup' => 'false', 'fieldsMapping' => array(array("columnNumber" => '1', "fieldName" => "number1", "key" => true), array("columnNumber" => '2', "fieldName" => "first_name", "key" => false), array("columnNumber" => '3', "fieldName" => "last_name", "key" => false)), 'seperator' => '', 'skipHeaderLine' => false); $crmUpdateSettings = array("crmAddMode" => "DONT_ADD", "crmUpdateMode" => "UPDATE_ALL"); //IMPORTANT: crmUpdateSettings EXTENDS basicImportSettings.. MERGE THEM //ALL SERVICE PARAMETERS BELOW $crmUpdateSettings = array_merge($basicImportSettings, $crmUpdateSettings); $importData = array(array("5555776741", "test_first", "test_last"), array("5551112239", "test_first2", "test_last2"), array(rand(1111111111, 9999999999), "test", "name")); $xml_data = array('crmUpdateSettings' => $crmUpdateSettings, 'importData' => $importData); //request parameters $result = $five9->updateContacts($crmUpdateSettings, $importData); print_r($result); /* ssh://ryan@192.168.1.145:22/usr/bin/php /home/ryan/www/reporting/Five9/API/contacts/updateContacts.php stdClass Object ( [return] => stdClass Object (
<?php include_once '../includes/Five9.php'; /** * * Created By: Ryan Kiel * * SERVICE CALLS: * namePattern (regular expression, returns all if null) * * RETURNS: * return->contactField */ $five9 = new f9(); $namePattern = array('namePattern' => null); //request parameters $result = $five9->getContactFields($namePattern); echo '<pre>'; var_dump($result); echo '</pre>'; echo "END"; foreach ($result['return'] as $result_ea) { echo $result_ea->name . "\n"; } /* Begin<br/><br/>REQUEST: <?xml version="1.0" encoding="UTF-8" <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://service.admin.ws.five9.com/"><SOAP-ENV:Body><ns1:getContactFields/></SOAP-ENV:Body></SOAP-ENV:Envelope> <pre>array(1) { 'return' => array(18) {
<?php include_once '../includes/Five9.php'; /** * * Created By: Ryan Kiel * * ------ADDS MULTIPLE RECORDS------ * SERVICE CALLS: * listName string * listUpdateSettings->listUpdateSettings (extends basicImportSettings) * csvData * * RETURNS: * return->importIdentifier */ $five9 = new f9(); $listName = "test list"; $basicImportSettings = array('allowDataCleanup' => 'false', 'fieldsMapping' => array(array("columnNumber" => '2', "fieldName" => "first_name", "key" => false), array("columnNumber" => '1', "fieldName" => "number1", "key" => true), array("columnNumber" => '3', "fieldName" => "last_name", "key" => false)), 'seperator' => '', 'skipHeaderLine' => true); $listUpdateSettings = array('cleanListBeforeUpdate' => false, "crmAddMode" => "ADD_NEW", "crmUpdateMode" => "UPDATE_FIRST", "listAddMode" => "ADD_FIRST"); //IMPORTANT: crmUpdateSettings EXTENDS basicImportSettings.. MERGE THEM //ALL SERVICE PARAMETERS BELOW $listUpdateSettings = array_merge($basicImportSettings, $listUpdateSettings); //readCSV////////// $csvData = file_get_contents('../includes/testList.csv'); $result = $five9->addToListCsv($listName, $listUpdateSettings, $csvData); print_r($result); /* RETURNS stdClass Object ( [return] => stdClass Object
<?php include_once '../includes/Five9.php'; /** * * Created By: Ryan Kiel * * ------DELETES ALL RECORDS IN A LIST, DOES NOT DELETE CONTACTS----- * SERVICE CALLS: * listName string * reportEmail * * RETURNS: * return->importIdentifier */ $five9 = new f9(); $listName = 'test list'; $reportEmail = "*****@*****.**"; $result = $five9->deleteAllFromList($listName, $reportEmail); print_r($result); /* RETURNS stdClass Object ( [return] => stdClass Object ( [keyFields] => number1 [uploadDuplicatesCount] => 0 [uploadErrorsCount] => 0 [warningsCount] => stdClass Object ( )
<?php include_once '../includes/Five9.php'; /** * * Created By: Ryan Kiel * * SERVICE CALLS: * lookupCriteria type: crmLookupCriteria * * RETURNS: * return->contactLookupResult */ $five9 = new f9(); $lookupCriteria = array('contactIdField' => '123', 'criteria' => array(array('field' => 'first_name', 'value' => 'bb44oy'), array('field' => 'last_name', 'value' => 'Draper'))); $result = $five9->getContactRecords($lookupCriteria); echo "returned start\n"; print_r($five9->getLastRequest($five9)); echo "returned end\n"; echo '<pre>'; var_dump($result); echo '</pre>'; echo "END"; /* Begin<br/><br/>asdfasdfstring(583) "<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://service.admin.ws.five9.com/"> <SOAP-ENV:Body> <ns1:getContactRecords> <lookupCriteria> <contactIdField>123</contactIdField> <criteria> <field>first_name</field>