You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

CPM Call API example

Question
3
Views
0
Comments
edited Oct 26, 2021 10:02AM in Customer Portal

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)

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!