CPM Call API example
CPM example: Call a SMS API Gateway to send a message to the contact mobile number when an incident goes to an specific queue. When saving the incident a business rule call this CPM:
-------------------------------------------------------------------------------------
<?
/*
* CPMObjectEventHandler: incidentDelayedSMSHandler
* Package: JAJ
* Objects: Incident
* Actions: Create
* Version: 1.3
*/
use \RightNow\Connect\v1_3 as RNCPHP;
use \RightNow\CPM\v1 as RNCPM;
class incidentDelayedSMSHandler implements RNCPM\ObjectEventHandler
{
public static function apply($run_mode, $action, $object, $n_cycles)
{
//Avoid API CALL if this is not the first time the rule is fired for this "save" event
if ($n_cycles !== 0) return;
//Load Curl to perform API CALLS (PHP)