Connect for PHP

Get the Interface ID in Customer Portal and ROQL

Sometimes you may need the current interface from within Customer Portal. For instance, you'll need to filter on the Interface ID to retrieve a list of all end-user visible Products. There are two ways to do this:

Within a ROQL query

You can use the curInterface() ROQL method right in your query: SELECT ID, LookupName FROM ServiceProduct WHERE EndUserVisibleInterfaces.ID = curInterface() ORDER BY DisplayOrder

Via the CP API


Documentation for getAdminUrl()



I am quite new to CX development and came across mention if the getAdminUrl() method for use with file attachments. I decided to do some research on it as it sounds useful for a project I am working on, however I could not find any info in the Connect API documentation? In fact very few methods appear to be document for objects in general. I am wondering if I am missing something? If there might be other useful methods of which I am not aware?

Can some kindly soul point me in the direction of where this method is documented?

Kind Regards


How to restrict a Agent from selecting a past date for Passport expiry in Agent desktop (Contact Workspace)

Hi All,

Is there anyway to restrict a agent from selecting a past date in contact workspace.

My Scenario :
We have to store only the future date for a passport / visa expiry dates. If it's already expired then we shouldn't allow an agent to create record.

In which way I can achieve this process.


How to run a Batch process via CPM ?

Hi All,

I have a requirement to send all Contact and Contact_CO object's records which is created in OSvC to Eloqua.
Is it possible to run a Batch process via CPM for this requirement?

Thanks in advance.


Unable to POST with Oracle Sales Cloud using Event Handler.



I have to integrate Opportunities in Oracle Service Cloud with Leads in Oracle SALES Cloud. There is no ICS in this implementation so I need to configure this using an event handler in Service Cloud. Check the code I am using:


* CPMObjectEventHandler: on_opportunity_create
* Package: RN
* Objects: Opportunity
* Actions: Create, Update
* Version: 1.2

use \RightNow\Connect\v1_2 as RNCPHP;
use \RightNow\CPM\v1 as RNCPM;
use RightNow\Connect\v1_2\Audit as RNCPHP_Audit;

encrypt() not working


I am using CPHP (Connect PHP) for this encryption.

$iv = "0000000000000000";
$cipher = new Crypto\AES();
$cipher->Mode->LookupName = 'CBC';
$cipher->IV->Value = $iv;
$cipher->KeySize->LookupName = '128_bits';
$cipher->Padding->ID = 1;
$cipher->Key = $key;
$cipher->Text = $string;

For the last line ($cipher->encrypt()) I am getting the output as :

API - REST or SOAP - Bulk Create Contacts


My requirement is to fetch data from CSV file and create contacts.


OSvC: February 2016

CPHP: V1_3

Rows in CSV file: 99500

I have build a custom script which process all rows from CSV file and create contacts using Connect PHP, but here I am getting memory error:

"DB API Error SQL Fcn: execute() [SQLStatement.cpp: 641] 
       Error: Unable to allocate sufficient storage for queryPointer!"

After 4000 rows, script stops automatically.

How to call an External survey and give Customer contact details as parameter to external survey page

i would like to redirect external survey (Survey which hosted on external webpage) when chat disconnected and provide Chat ID, Customer Name, Email Address to that external page?
we have close_redirect_url attribute to redirect page when click disconnect button but not sure how to send contact detail to this page, can anyone help me on this.

Thanks in Advance.

Add more than one Secondary contact to Incident through CPM

Hi All,
I am trying to add more than one secondary contact to an Incident through Custom Process.
But, I am facing some error which is not causing the contact to get linked,
Below is the code
$res = RNCPHP\ROQL::queryObject( "SELECT Contact FROM Contact WHERE Emails.Address = '".$mail_addr."' AND Emails.AddressType = 0")->next();

Abusable Functions in CP, CPMs, and Custom Scripts

When calling create and update functions from within Customer Portal code, the system requires the use of checks via the RightNow\Libraries\AbuseDetection library method isAbuse(), to ensure the CP endpoint is not under a DOS or similar attack. This is helpful, in theory at least, because it ensures that your CP site is mostly protected from these sorts of attack, but this can cause major headaches when building out more complex solutions. 3 out of 4 scenarios below require some level of workaround, depending on your use-case:


Zircon - This is a contributing Drupal Theme
Design by WeebPal.