Integrations and APIs for Service

Get Involved. Join the Conversation.


    Hosting Connect-PHP code inside custom scripts dir
    Topic posted July 4, 2012 by rsurujbhLinksys Red Ribbon: 250+ Points 
    1879 Views, 7 Comments
    Hosting Connect-PHP code inside custom scripts dir

    Instead of Customer Portal, is it possible to host and execute Connect for PHP code in the "custom scripts" directory (accessible inside CX for those with File Manager licensing) for usage within the agent desktop Incident workspaces / browser controls?


    Feb 2011 SP2



    • Pathaksa Tongpitak


      That is absolutely possible.

      All you have to do is include the header from

      The last line of the header is something like this:

      list ($common_mbid, $rnw_mbid) = msg_init($p_cfgdir, 'msgbase', array('common', 'rnw'));

      And after that you write the following:
      use RightNow\Connect\v1_1 as RNCPHP;
      require_once( get_cfg_var("doc_root")."/ConnectPHP/Connect_init.php" );


      Good luck!

    • Allan Schrum

      A minor correction for sites that are 11.5 or later: please

      require_once( get_cfg_var("doc_root")."/include/ConnectPHP/Connect_init.phph" );

      instead. The other location is in the "wrong" spot and so we deprecated it and put the include file into the correct spot. The "wrong" file will be removed when we release 13.5 (May 2013) so please use the official location so that you will not be surprised in the future.

      For 10.11 and 11.2 the "wrong" location is the official location. Please be aware that you may need to change your scripts the next time you upgrade.



    • rsurujbhLinksys

      Thanks guys. It got it working! The path to Connect_init.phph was the problem.


      1. require_once( get_cfg_var("doc_root")."/include/ConnectPHP/Connect_init.phph" );

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

      On our site, when I use the path in #1, our code is throwing fatal errors ("failed to open stream: No such file or directory").

      When I use #2, it works!

      Is that normal on an Feb 2011 (11.2) site?

    • Allan Schrum

      I think so for 11.2. I believe we fixed this in 11.5 (which is why we are removing it in 13.5 - two years later). I missed that you are on 11.2, so your "official" file is the one you found to work. I guess you can keep this in mind for the next time you upgrade that this might need changing.

      Glad you got it working! I'm editing my remarks above to indicate this is for 11.5 and later.



    • Magiva

      Im led to believe that this will incur a session charge because of using the customer portal url

      is there another way to reference the custom folder and custom script ?

    • Barrilito van Dijk

      Hi Magiva,

      The comment you gave is on a discussion of four years ago. Could you please post your question in a seperate new thread. Thanks!


    • Dietrik

      An alternative is to create an addin.