Cognos Analytics with Watson

 View Only
  • 1.  RaaS - report as a service

    Posted Tue November 29, 2022 11:14 AM
    Is it possible to consume a cognos bi report as a web service(soap/rest)?




  • 2.  RE: RaaS - report as a service

    Posted Wed November 30, 2022 03:37 AM
    Hi Moises, 

    Unfortunately, no. We have the same requirement as some of our customers wanted to use Cognos report data in power BI using api data source. We are creating a REST API using SDK that a) authenticates the user using the credentials passed to the API call b) takes the saved report output in xml format using the object ID passed to the api call c) converts it to json using a third party library d) and returns the json to the caller. I know this is cumbersome but this seems to be the only option at this point. I even asked about providing a JSON export for reports, which they say is being looked into (knowing the way enhancements are prioritized by IBM God knows for how long it will be looked into :-) ) that might at least eliminate some steps in this process. But nevertheless, there is no direct way. 

    Note that I mentioned saved output because reports might take long time to execute and api calls may time out in this process, so we set the report properties to View Most Recent Output and schedule the report to save xml output which will be used as the input to rest API. 


    Kiran Passumarthi

  • 3.  RE: RaaS - report as a service

    Posted Wed November 30, 2022 06:54 AM
    Edited by System 16 days ago

    Hi Moises,

    the Cognos Mashup Sevice (CMS) sounds like what you are looking for (In fact, the early internal working name for CMS was "RaaS - reports as a service". 😎). CMS is built into CA, so it's ready to be used (there are samples available as well).  CMS provides both a REST interface and a SOAP (doc/lit) interface to consume a Cognos report as a web service. CMS also allows you to choose the output format used in the response, to match your needs (for your usecase, you probably want to look at the DataSet, DataSetJSON, or the JSON output formats).

    Here's a link to the documentation on Cognos Mashup Service: 

    The above documentation will show you the options on how to authenticate (including the CMS auth service option), how to send a request to the report web service, for the respective report (and specify the desired output format), and more advanced use cases (such as dealing with prompts and how to work with saved report output versions in the CMS API).


    Jim Boland

  • 4.  RE: RaaS - report as a service

    IBM Champion
    Posted Wed November 30, 2022 10:01 AM

    Cognos has a very rich REST API that exposes many of the elements in various formats.

    In addition to what Jim posted, here's a super quick cheat sheet:

    Construct the URL like this: https://SERVER/ibmcognos/bi/v1/disp/rds/reportData/searchPath/<SEARCHPATH>?fmt=datasetJSON&async=off&p_pYear=2022&p_pParameterWithSpecialCharacters=<![CDATA[aa%^&*a]]>

    In addition to JSON you can also have it return HTML or HTML fragments, it can even convert the report into images.

    I use CMS for a number of tools, including my Alerts system:

    In the background it's running a report, with data filters specific to the user, and then generating various types of alerts (showing Banner and Toast here)

    I've also used it to make a search prompt that doesn't require the report be submitted to see the results.

    Outside of Cognos I've used CMS to populate the screen of a CRM, and another time to embed data in an education website.

    In addition to the reports, you can also use the Cognos REST API to read and work with Cognos programmatically. This is security aware, so it won't show objects the user doesn't have access to. 

    Paul Mendelson

  • 5.  RE: RaaS - report as a service

    IBM Champion
    Posted Wed November 30, 2022 10:31 AM
    Hi Moises,

    REST API is fully supported and updated with new features in every release.
    Cognos Mashup Service (CMS) is a quite old technology, still supported (I believe). The CMS documentation is located within Cognos BI 10.2.2 documentation

    If you are starting to write something, it is a better idea to start with REST API.

    Best regards

    Patrick Neveu
    Positive Thinking Company

  • 6.  RE: RaaS - report as a service

    Posted Wed November 30, 2022 11:04 AM
    Thanks for the info!  I will take a look.