Cognos Analytics

Cognos Analytics

Connect, learn, and share with thousands of IBM Cognos Analytics users! 

 View Only
  • 1.  IBM Cognos Analytics 11.1 R7 - REST API - Login

    Posted Tue September 01, 2020 03:24 PM
    Hi All,

    We are trying to login through the published REST API for Cognos 11.1.7 
    https://<WEBSERVER>/bi/api/session, along with Namespace, User Name, and password as parameters
    Also, tried with the below pattern
    https://<WEBSERVER>/bi/api/v1/session

    Result - Forbidden response.

    Can you please help?
    Has anyone able to login using REST API.
    Thanks!


    ------------------------------
    Dhanush
    ------------------------------

    #CognosAnalyticswithWatson


  • 2.  RE: IBM Cognos Analytics 11.1 R7 - REST API - Login

    Posted Wed September 02, 2020 09:34 AM

    Hi Dhanush,

    Please try using https://<WEBSERVER>/api/v1/session as per this topic:

    https://www.ibm.com/support/knowledgecenter/SSEP7J_11.1.0/com.ibm.swg.ba.cognos.ca_api.doc/c_ca_api_rest.html



    ------------------------------
    Richard Kung
    ------------------------------



  • 3.  RE: IBM Cognos Analytics 11.1 R7 - REST API - Login

    Posted Thu September 03, 2020 11:51 AM
    Hi Richard,

    Thanks for the reply.

    Have tried using the pattern you have mentioned, 
    https://cognosdevserver.xxx.com/bi/api/v1/session
    {"parameters":[{"name":"CAMNamespace","value":"NAMESPACEID"},{"name":"CAMUsername","value":"USERNAME"},{"name":"CAMPassword","value":"PASSWORD"}]}

    Response: Forbidden.

    Can you please let me know if there is any other configuration to be made?
    Please note, we are using Custom Authentication.

    Thanks!

    ------------------------------
    Dhanush
    ------------------------------



  • 4.  RE: IBM Cognos Analytics 11.1 R7 - REST API - Login

    Posted Mon September 28, 2020 09:05 AM
    In most cases a web server wouldn't expose /bi but would proxy it as something like /ibmcognos/bi. I'm not certain but shouldn't it be more like:  https://cognosdevserver.xxx.com/ibmcognos/bi/api/v1/session? I'm not clear from the above if you are actually trying to use a web server though based on the two conflicting posts.

    ------------------------------
    Robert Hofstetter
    ------------------------------



  • 5.  RE: IBM Cognos Analytics 11.1 R7 - REST API - Login

    Posted Fri October 02, 2020 12:33 PM
    Assuming you can hit any of the Dispatchers @ :9300/api/v1/session, and your login is passing, you might be missing a rewrite rule in your webserver's httpd.conf. Try direct first and let us know.​

    ------------------------------
    Dariusz Danielewski
    ------------------------------



  • 6.  RE: IBM Cognos Analytics 11.1 R7 - REST API - Login

    Posted Sat October 03, 2020 08:15 AM
      |   view attached
    Hi Dariusz,
    Thanks for your message.
    I have tried with dispatcher login and we have got mixed results. PUT request to create a session in cognos has been successful while we have not been able to proceed with any other request. Do we need to send the XSRF-TOKEN or any other request header in the subsequent request?

    We do suspect that there is some issue with redirect rule of httpd.conf file, but we have been exactly using the template provided by IBM for IHS9. We have not added any other rewrite rule. Have attached the conf file.

    Thanks!


    ------------------------------
    Dhanush
    ------------------------------

    Attachment(s)

    conf
    rfx_cognos.conf   2 KB 1 version


  • 7.  RE: IBM Cognos Analytics 11.1 R7 - REST API - Login

    Posted Sat October 03, 2020 12:49 PM
    The XSRF-Token header must be passed with every request. As for the RewriteRule, it all depends how you want to call it from the gateway. I don't see your load balancers in the conf file, so I don't what to recommend at this point. Although, it should be easy for your Apache admin to figure out.

    ------------------------------
    Dariusz Danielewski
    ------------------------------