public function handleGetNotifDetails() { $vnames = array('getNotifyDetails', 'queues'); $this->copyToSession($vnames); if (!isset($_SESSION['getNotifyDetails'])) { return; } try { if (!isset($_SESSION['queues'])) { throw new Exception('Invalid value for queues'); } $queues = strtoupper($_SESSION['queues']); if ($queues != 'TEXT' && $queues != 'MMS') { throw new Exception('Invalid value for queues'); } $immnSrvc = new IMMNService($this->apiFQDN, $this->getSessionToken()); $this->clearSession(array('getNotifyDetails')); $cd = $immnSrvc->getNotificationConnectionDetails($queues); $this->results[C_NOTIFICATION_DETAILS] = $cd; } catch (Exception $e) { $this->errors[C_NOTIFICATION_DETAILS] = $e->getMessage(); $this->clearSession(array('getNotifyDetails')); } }
/** * Retrieves details about the credentials, endpoint, and resource information required to set up a notification connection * * @method getNotificationConnectionDetails * * @param {string} queues - Specifies the name of the resource - TEXT or MMS * * @return {Response} Returns Response object * @throws ServiceException if API request was not successful. */ public function getNotificationConnectionDetails($queues) { // Get OAuth token $token = $this->getSessionConsentToken('MIM'); $immnSrvc = new IMMNService($this->base_url, $token); return $immnSrvc->getNotificationConnectionDetails($queues, true); }
$immnSrvc->deleteMessages($msgIds); echo "Successfully deleted messages.\n"; } catch (ServiceException $se) { echo $se->getErrorResponse(); } /* This try/catch block tests the createMessageIndex method. */ try { // Send the request to create the message index. $immnSrvc->createMessageIndex(); echo "Successfully created message index.\n"; } catch (ServiceException $se) { echo $se->getErrorResponse(); } /* This try/catch block tests the getMessageIndexInfo method. */ try { // Send the request to get the message index info. $msgIndexInfo = $immnSrvc->getMessageIndexInfo(); echo 'state: ' . $msgIndexInfo->getState() . "\n"; } catch (ServiceException $se) { echo $se->getErrorResponse(); } /* This try/catch block tests the getNotificationConnectionDetails method. */ try { // Enter queues value. $queues = 'ENTER VALUE!'; // Send the request to get the notification connection details. $details = $immnSrvc->getNotificationConnectionDetails($queues); echo 'username: ' . $details->getUsername() . "\n"; } catch (ServiceException $se) { echo $se->getErrorResponse(); }