/** * Initialize API connection */ public function init() { $_config = new kyConfig($this->getApiURL(), $this->getApiKey(), $this->getSecretKey()); $_config->setIsStandardURLType(true); $_config->setDebugEnabled(true); kyConfig::set($_config); }
/** * Initialize client configuration object. */ public function init() { $configObj = JModuleHelper::getModule('mod_kayako')->params; $configValue = json_decode($configObj, 1); $config = $config = new kyConfig($configValue['apiurl'], $configValue['apikey'], $configValue['secretkey']); $config->setIsStandardURLType(true); kyConfig::set($config); }
/** * Initialize API connection */ public function init() { $apiUrl = Mage::helper('kayako')->getKayakoApiUrl(); $apiKey = Mage::helper('kayako')->getKayakoApiKey(); $secretKey = Mage::helper('kayako')->getKayakoSecretKey(); $_config = new kyConfig($apiUrl, $apiKey, $secretKey); $_config->setIsStandardURLType(true); $_config->setDebugEnabled(true); kyConfig::set($_config); }
/** * @copyright 2001-2015 Kayako * @license https://www.freebsd.org/copyright/freebsd-license.html * @link https://github.com/kayako/whmcs-integration */ require_once __DIR__ . '/config.php'; require_once 'API/kyConfig.php'; require_once 'API/kyRESTClientInterface.php'; require_once 'API/kyRESTClient.php'; require_once 'API/kyHelpers.php'; //Include common functions require_once 'functions.php'; //Include constants file require_once 'constants.php'; kyConfig::set(new kyConfig(API_URL, API_KEY, SECRET_KEY)); $_restClient = kyConfig::get()->getRESTClient(); $_newsController = '/News/NewsItem'; $_commentController = '/News/Comment'; if (isset($_GET['itemid'])) { if ($_GET['action'] == 'savecomment') { $_itemIDKey = 'newsitemid'; $_itemID = $_GET['itemid']; $_rootCommentElement = 'newsitemcomment'; include 'savecomment.php'; } include 'announcementitem.php'; } else { include 'announcementlist.php'; } $smarty->assign('_baseURL', WHMCS_URL);
<?php ini_set('html_errors', 0); ini_set('display_errors', 1); ini_set('error_reporting', E_ALL); require_once dirname(__FILE__) . "/ressources/kayaco/kyIncludes.php"; define('DEBUG', true); kyConfig::set(new kyConfig("http://www.articatech.net/support/api/index.php", "bea5b97c-a838-8ca4-9dda-aec5043cccae", "MmUxYzRmMDMtM2RjNC1iY2Y0LTRkOGEtNjYzN2Q3N2U3MWE2N2FiZjk2NzEtMzQxZS0yMTA0LTUxN2YtOWZiY2VkOTQyNTMy")); $registered_user_group = kyUserGroup::getAll()->filterByTitle("30 days free")->first(); echo "registered_user_group: {$registered_user_group}\n"; //load some user organization $org = new kyUserOrganization(); $org->setName("MyCompany"); $data = $org->buildData(true); $org->create(); print_r($data); $user_organizations = kyUserOrganization::getAll(); foreach ($user_organizations as $user_organization) { $id = $user_organization->getId(); $company = $user_organization->getName(); echo "Company: {$company} -> {$id}\n"; } return; /** * Create new user in Registered group: * fullname: Anno Ying * email: anno.ying@example.com * password: qwerty123 */ $user = $registered_user_group->newUser("Daniel touzeau", "*****@*****.**", "qwerty123")->setUserOrganization($user_organization)->setSalutation(kyUser::SALUTATION_MR)->setSendWelcomeEmail(true)->create();
/** * Initializes the client. */ function initKayako() { $config = new kyConfig(BASE_URL, API_KEY, SECRET_KEY); $config->setDebugEnabled(DEBUG); kyConfig::set($config); }
<?php require_once "vendor/kayako-sdk/kyIncludes.php"; require_once "vendor/autoload.php"; $config = json_decode(file_get_contents("config/config.json"), true); $api_settings = $config["kayako"]; kyConfig::set(new kyConfig($api_settings["url"], $api_settings["key"], $api_settings["secret"])); $klein = new \Klein\Klein();
<?php require_once "../kyIncludes.php"; print "<pre>"; /** * Initialization. */ kyConfig::set(new kyConfig("<API URL>", "<API key>", "<Secret key>")); kyConfig::get()->setDebugEnabled(true); /** * Optional. Setting defaults for new tickets. * WARNING: * Names may be different in your instalation. */ $default_status_id = kyTicketStatus::getAll()->filterByTitle("Open")->first()->getId(); $default_priority_id = kyTicketPriority::getAll()->filterByTitle("Normal")->first()->getId(); $default_type_id = kyTicketType::getAll()->filterByTitle("Issue")->first()->getId(); kyTicket::setDefaults($default_status_id, $default_priority_id, $default_type_id); $general_department = kyDepartment::getAll()->filterByTitle("General")->filterByModule(kyDepartment::MODULE_TICKETS)->first(); /** * Cleanup - delete what's left from previous run of this example. */ $example_department = kyDepartment::getAll()->filterByTitle("Printers (example)"); if (count($example_department) > 0) { $tickets_to_delete = kyTicket::getAll($example_department)->filterBySubject("Printer not working (example)"); $tickets_to_delete->deleteAll(); if (count($tickets_to_delete) > 0) { printf("Tickets DELETED:\n%s", $tickets_to_delete); } } $users_to_delete = kyUser::getAll()->filterByEmail("*****@*****.**");