Integrations and APIs for Service

Get Involved. Join the Conversation.

Comments

  • Robert Surujbhan

    Hi Chethana, at this time, when querying the /content API via GET calls like you are doing, it is not possible to filter articles with the “q” parameter using Attribute values (aka Schema Nodes, for a Content Type).  For now, the only way to do that is using the Search API which is the other REST API service with Knowledge Advanced (https://sitename-qp.custhelp.com/srt/api/latest...).

    With the Content API, one possible workaround is to configure your preferred content type Attributes to be part of the Master Identifier.  The full master identifier then becomes the Title of the record, and as you know, the ‘title’ field is queryable using the “q” parameter when you call GET on /content.  In summary, using the Master Identifier/Title is one way to query on article attribute values using the Content API.  Just be aware that all attributes designated as part of the master identifier are concatenated to form the complete title of the document/article - if you are OK with that for display purposes, you will be fine.

     

  • Venkatesh Reddy

    Can you please me out.

  • Mike Kramer

    Thank you sir!  That is the answer I was looking for!  Appreciate the help.

  • Chandra Prasad

    Hi Suresh,

       if (isset($obj->prev)) --> isn't throwing error but, the content inside 'if' condition is no getting executed as (isset($obj->prev)) is empty.

     

    Thanks,
    Chandra

  • Suresh Thirukoti

    I had this prev issue earlier so I tried below and it worked...so you can also try and check

     

     if (isset($obj)) {

     .....................

       if (isset($obj->prev)) {

    //assignment and further action on prev object

    }

    }

    ~Suresh

  • Lakshay Bhalla

    Hi Chandra,

    Please attach the Complete CPM for RCA.

    And i would suggest to use the Best Practices and Gotchas for CPMs such as Exception handling. Link: https://cx.rightnow.com/app/answers/detail/a_id/9640/track/AvM9zwqoDv8S~fPaGpRy~6LwenU6~S75Mv8O~zj~PP~H

    Use "\" in the catch like: catch(\Exception $ex).

    Thanks

    Lakshay

  • Chandra Prasad

    Hi Sristy,

    CPM is being triggered for Contact update.

    <?php
    /**
     * CPMObjectEventHandler: ContactHandler
     * Package: RN
     * Objects: Contact
     * Actions: Update
     * Version: 1.3
     * Purpose: CPM handler for contact create and update.
     */
     
    use \RightNow\Connect\v1_3 as RNCPHP;
    use \RightNow\CPM\v1 as RNCPM;
     
     
    class ContactHandler implements RNCPM\ObjectEventHandler
    {
     
        /**
         * Apply CPM logic to object.
         * @param int $runMode
         * @param int $action
         * @param object $obj
         * @param int $cycle
         */
        public static function apply($runMode, $action, $obj, $cycle)
        {
     
    $var1=$obj->Name->First;
    $var2=$obj->Name->Last;
     
    if (isset($obj))
        {
     
    $var1=$obj->Name->First;
    $var2=$obj->Name->Last;
       
    $pvar1=$obj->prev->Name->First;
    $pvar2=$obj->prev->Name->Last;
    if(isset($pvar1)){
            if ($var1 != $pvar1) {
    try{
                $custom1 = new RNCPHP\CO\CustomContact();
    $custom1->ContactID= $obj->ID;  
                $custom1->FieldName= "First Name";
            $custom1->FieldValue= $pvar1;
                $custom1->save(RNCPHP\RNObject::SuppressAll);
    }
     
                    catch (Exception $err ){
                        echo $err->getMessage();
                        }
    }}
    if(isset($pvar2)){
    if ($var2 != $pvar2) {
    try{
                $custom1 = new RNCPHP\CO\CustomContact();
    $custom1->ContactID= $obj->ID;  
                $custom1->FieldName= "Last Name";
            $custom1->FieldValue= $pvar2;
                $custom1->save(RNCPHP\RNObject::SuppressAll);
    }
     
                    catch (Exception $err ){
                        echo $err->getMessage();
                        }
            }
    }
     
     
        }   
    }
    }
     
     
     
    *CustomContact is a Custom object
     
    Thanks,
    Chandra
  • Sristy Arya

    Hi Chandra,

     

    Can you give some clarity : CPM is being triggered for Incident or Opportunities ?  If possible share the code to debug along with the field detail you are trying to access.

     

    Thanks

    Sristy  

  • Sergio Andres Barreto Valderrama

    Hello Robert,

    Thanks for answering.

    We need it to be an automatic process by ICS, do you know if there is an API to import data?

    thanks for your help!

  • Robert Surujbhan

    Hi Sergio - are you not able to use the Data Import Wizard for some reason?  If not, and you need to use an API approach, the Connect Web Services API (SOAP) can import up to 1000 records at a time in one request using its Create operation. 

    You can also create contacts using the REST API.

    How many contacts do you need to import?  Also, what will be the data source (e.g., a flat CSV text file of data you have stored locally)?

  • Robert Surujbhan

    Hi Mike, what you are describing is possible using a standard feature in the Service Cloud extensibility frameworks that can (1) fetch data from external systems and (2) display the results using Reports which you can then add to Workspaces just like any other Report.  The data is fetched in real-time and never stored in the OSvC database.

    When you build these integrations, "virtual tables" are exposed to the OSvC Report Designer GUI which allows you to manage them easily (arrange columns, add charts, etc.).  In your code, you define where the data comes from - in other words, you'd be responsible for populating the "virtual tables" using your middleware system via web service API calls, DB queries, etc. which get executed when the report is run/displayed/refreshed.  It's the perfect solution for what you described as read-only "standalone data".  These virtual tables wouldn't connect to any other object in the system.

    This feature works in both the Agent Browser UI web console or the .NET Agent Desktop console.  Which one are you using?  You'd have to build specialized virtual report add-ins/extensions respectively.  See the below documentation links for details!  If you need additional sample code, please let us know.

    https://documentation.custhelp.com/euf/assets/devdocs/unversioned/BUI_Extensibility/topicrefs/Analytics_for_External_Data.html

    https://documentation.custhelp.com/euf/assets/devdocs/unversioned/Connect_AddIn_Framework/Content/Desktop%20Add-In%20Framework%20API/Add-In%20Types/Read%20Write%20Report%20Add-Ins.htm

  • *** Chauhan

    Great. Do you have any link/page which I can refer to for creating vba code for role assignment? May be that would help me create similar code for password reset.

     

    Many thanks in advance!

    Regards,

    ***

  • Travis Crane

    I have not tested that but I know that you can add roles via excel vba so I would assume that if there is a REST API for password resets then it would work.

  • Sebastiaan Draaisma

    Hi Mike

    The v comes from Service. It's just to avoid confusion as OSC is already the official abbreviation for Oracle Sales Cloud :-)
    That said...

    One way of getting external data into OSVC may be through a custom script. I have not done this myself with external data but this would be the most logical approach. The report would need to have a table, this can be any table (a small table is interfaces or incident queues), it's just so you are able to save the report. Then the CS (PHP) would need to retrieve the external data and insert this into your report.

    I attach a report example (ROQL) that uses the inc_statuses table but repopulates the entire report with data through a ROQL query. You would need to do something similar except with an external database.

    Initialisation

    require_once(get_cfg_var('doc_root')."/ConnectPHP/Connect_init.php");
    initConnectAPI();

    Finish

    $roql_result = RightNow\Connect\v1_3\ROQL::query( "SELECT H.Name, H.HolidayDate FROM Holiday H" )->next();

    $i=0;
    while($holiday =  $roql_result->next())
    {
    $exit_obj[$i][0]->val = $holiday['Name'];
    $exit_obj[$i][1]->val = $holiday['HolidayDate'];
    $i++;
    }

  • Mike Kramer

    I meant Oracle Service Cloud (the RightNow product).  The "v" makes no sense to me/us so we call it by its initials, OSC.