Cognos Analytics

Cognos Analytics

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

 View Only
  • 1.  Cogonos Mashup Service - Version Parameter

    Posted Wed October 08, 2025 11:22 AM

    Has anyone successfully using the version:LATEST parameter to extract a saved report output in DataSetJSON format?

    If I used this endpoint, I get a 404 error

    rds/reportData/report/{reportID{?v=3&async=OFF&fmt=DataSetJSON&version=LATEST

    If I add the saveOuput = true parameter it works but I don't want to execute the query on the database and save the output

    rds/reportData/report/{reportID{?v=3&async=OFF&fmt=DataSetJSON&version=LATEST&saveOutput=True

    If I use version=VERSION_NAME and put the specific VERSION_ID it will work but then finding the version name programmatically becomes a challenge

    rds/reportData/report/{reportID{?v=3&async=OFF&fmt=DataSetJSON&version=VERSION_NAME&versionID=2025-10-08T14:56:10.079Z



    ------------------------------
    John Bronzo
    ------------------------------


  • 2.  RE: Cogonos Mashup Service - Version Parameter

    Posted Thu November 13, 2025 09:46 AM

    Hi John,

    I tried to recreate what you described:

    report_url = '{my-url}/bi/v1/disp/rds/reportData/report/{my-id}?v=3&async=OFF&fmt=DataSetJSON&version=LATEST'

    No 404 error. I tried a few times and I could see the new run each time (> View versions) in Cognos Analytics.

    I switched to:

    report_url = '{my_url}/bi/v1/disp/rds/reportData/report/{my-id}?v=3&async=OFF&fmt=DataSetJSON&version=LATEST&saveOutput=True'

    Under versions, it showed the saved report, indicated by icon change.

    I switched back to:

    report_url = '{my-url}/bi/v1/disp/rds/reportData/report/{my-id}?v=3&async=OFF&fmt=DataSetJSON&version=LATEST'

    No 404 error, and no more reports appeared after the saved version - I took that to mean it was correctly pulling the latest saved version.

    Sorry I can't be more help.



    ------------------------------
    Gavin Beattie
    ------------------------------



  • 3.  RE: Cogonos Mashup Service - Version Parameter

    Posted Wed November 19, 2025 05:22 AM

    Like Gavin I was also not having any problems, I tried a few different formats and they all worked

    /bi/v1/disp/rds/reportData/report/iAAB73466604C4D91BA43C96D672A5808?v=3&async=off&fmt=datasetJSON&version=LATEST
    /bi/v1/disp/rds/reportData/path/Team%20Content/Demo/Mashup%20Examples/Report%20Versions?async=off&version=VERSION_NAME&versionID=2025-11-19T09:04:04.733Z
    /bi/v1/disp/rds/reportData/searchPath/content/folder[@name='Demo']/folder[@name='Mashup%20Examples']/report[@name='Report%20Versions']?async=off&version=LATEST

    In all cases it was working fine. 

    A 404 error is unusual here, since if it was a Cognos problem you should be getting an RDS error in XML format. 

    <rds:error xmlns:rds="http://developer.cognos.com/schemas/rds/types/2"><rds:message>whatever</rds:message></rds:error>

    The fact you're not getting that would indicate to me that the request isn't even reaching Cognos. Can you pull your webserver and cognos logs and see what's happening? I suspect there might be a rewrite rule or something that's intercepting the request. Maybe when LATEST is the last string? What happens if you do 
    rds/reportData/report/{reportID{?v=3&async=OFF&fmt=DataSetJSON&saveOutput=True&version=LATEST

    That's all just a guess unfortunately. 

    The problem with getting the version names is a pain, but here's how I do it:
    await fetch("<Gateway URL>/bi/v1/expressbus/content-manager?searchPath=/content/folder[@name=%27Demo%27]/folder[@name=%27Mashup%20Examples%27]/report[@name=%27Report%20Versions%27]//reportVersion&properties=defaultName", {
      "headers": {
        "accept": "application/json, text/javascript, */*; q=0.01",
        "x-xsrf-token": "HUSrqp0mF205pJA8qlvG13-9IRmTGSi7"
      },
      "method": "GET",
      "mode": "cors",
      "credentials": "include"
    }).then(x=>x.json())

    That returns a small array
    [
    {"type": "reportVersion","defaultName": "2025-11-19T09:04:04.733Z"},
    {"type": "reportVersion","defaultName": "2025-11-19T08:43:53.568Z"},
    {"type": "reportVersion","defaultName": "2025-11-19T08:44:15.540Z"}
    ]

    You can also get a list of burstkeys, if relevant, with:
    await fetch("<gateway>/bi/v1/expressbus/content-manager?searchPath=/content/folder[@name=%27Demo%27]/folder[@name=%27Mashup%20Examples%27]/report[@name=%27Burst Keys%27]//output&properties=burstKey,parent&options={refProps:[{refPropName:parent,properties:[defaultName,type]}]}", {
      "headers": {
        "accept": "application/json, text/javascript, */*; q=0.01",
        "x-xsrf-token": "HUSrqp0mF205pJA8qlvG13-9IRmTGSi7"
      },
      "method": "GET",
      "mode": "cors",
      "credentials": "include"
    }).then(x=>x.json())


    [
    {"burstKey": "Camping Equipment","parent": [{"type": "reportVersion","defaultName": "2025-11-19T10:03:04.771Z"}],"type": "output"},
    {"burstKey": "Golf Equipment","parent": [{"type": "reportVersion","defaultName": "2025-11-19T10:03:04.771Z"}],"type": "output"},
    {"burstKey": "Mountaineering Equipment","parent": [{"type": "reportVersion","defaultName": "2025-11-19T10:03:04.771Z"}],"type": "output"},
    {"burstKey": "Outdoor Protection","parent": [{"type": "reportVersion","defaultName": "2025-11-19T10:03:04.771Z"}],"type": "output"},
    {"burstKey": "Personal Accessories","parent": [{"type": "reportVersion","defaultName": "2025-11-19T10:03:04.771Z"}],"type": "output"}
    ]


    Notice the reportName for the version is in the parent array for each output. Since this is using a searchpath to find the objects, you can use valid searchpath syntax (it's basically xpath) to limit the reportVersion to only the latest: /content/folder[@name=%27Demo%27]/folder[@name=%27Mashup%20Examples%27]/report[@name=%27Burst Keys%27]/reportVersion[last()]//output


    ------------------------------
    Paul Mendelson Product Manager
    Product Manager
    PMsquare
    ------------------------------



  • 4.  RE: Cogonos Mashup Service - Version Parameter

    Posted 5 days ago

    Thank you for the input, Paul. After checking logs, I see this error when using LATEST parameter 

    The search path &quot;/content/package[@name='']/folder[@name='']/report[@name='']/reportVersion[0]/output[@format='layoutDataXML']&quot; is invalid. An object may contain invalid syntax, or an unsupported character, or the user account in the namespace may not have sufficient privileges

    It seems format is getting passed as layoutDataXML

    This gives the error: /bi/v1/disp/rds/reportData/report/i7637B4B71F0D4A379B4122F3287ACE9A?v=3&async=off&fmt=DataSetJSON&version=LATEST

    This works no problem: /bi/v1/disp/rds/reportData/report/i7637B4B71F0D4A379B4122F3287ACE9A?v=3&async=off&fmt=DataSetJSON&version=VERSION_NAME&versionID=2026-01-05T19:56:11.088Z

    I am able to get the version name programmatically so can continue with this but it's odd that the LATEST parameter isn't working. The goal is to extract the data without make a request to the database.

    As I was typing this I tested with lowercase "latest" and it worked. I am guessing the query parameter was somehow getting re-written before directing to cognos

    This works:  /bi/v1/disp/rds/reportData/report/i7637B4B71F0D4A379B4122F3287ACE9A?v=3&async=off&fmt=DataSetJSON&version=latest



    ------------------------------
    John Bronzo
    ------------------------------