Cognos Analytics

Cognos Analytics

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

 View Only
  • 1.  Cognos Analytics REST API: some APIs are removed from v11.1 to v12.x

    Posted Fri August 29, 2025 12:11 PM

    Hi,

    I was looking at an old documentation about REST API, and I was ready to play with the following APIs:

    POST /datasources/import_metadata

    GET /datasources/{datasourceid}/connections/{connectionid}/signons/{signonid}/schemas

    It was listed in here:
    https://www.ibm.com/docs/en/cognos-analytics/11.1.x?topic=api-rest-reference

    It is not listed anymore on:
    https://www.ibm.com/docs/en/cognos-analytics/12.0.x?topic=api-rest-reference

    or 
    https://www.ibm.com/docs/en/cognos-analytics/12.1.0?topic=api-rest-reference


    I don't see them anymore in :
    Cognos Analytics API Test Page (http://localhost:9300/api/api-docs/#/)

    I've seen that some APIs calls are listed as deprecated in https://www.ibm.com/docs/en/cognos-analytics/11.2.x?topic=SSEP7J_11.2.0/com.ibm.swg.ba.cognos.ca_api.doc/swagger_ca.json  for POST /extensions/file for example).


    However, it is listed in:

    Cognos Analytics 12.1.x - IBM API Hub - IBM Developer

    Question: where is the official Cognos Analytics REST API that you can trust?

    Best regards,



    ------------------------------
    Patrick Neveu
    BSL Consulting
    IBM Champion
    ------------------------------


  • 2.  RE: Cognos Analytics REST API: some APIs are removed from v11.1 to v12.x

    Posted Tue September 02, 2025 07:57 AM

    Hi,

    I'm trying to use without any success:

    {endpoint}/api/v1/datasources/{datasourceid}/connections/{connectionid}/signons/{signonid}/schemas/{schemaid}

    or

    {{cognos_base_url}}/api/v1/datasources/i43D839DA416440E4B815D964B21C3F19/connections/i5C76351502444F64ADEC4DED67DBC903/signons/i10334311F33447D3BE0B5D0753B69A43/schemas/iC53E23F43E034852A00ADE57FB573CEF

    I receive the following error: 415 Unsupported Media Type


    I'm able to login and use different REST APIs with success. This error 415 is not even listed in Cognos Analytics 12.0.x - IBM API Hub - IBM Developer

    I'm using the following request body:

    {
    "catalog": "DW",
    "defaultName": "DW/dbo",
    "schema": "dbo",
    "schemaType": "user",
    "specification": {
    "dataSamplingSize": 1000,
    "dataStatistics": "all",
    "excludedTables": ["NoWay"],
    "importPrimaryForeignKeys": false,
    "includedTables": ["YesNewTb"],
    "prettifyLabels": true
    }
    }

    Any idea would be appreciated!

    Best regards,



    ------------------------------
    Patrick Neveu
    BSL Consulting
    IBM Champion
    ------------------------------



  • 3.  RE: Cognos Analytics REST API: some APIs are removed from v11.1 to v12.x

    Posted Tue September 02, 2025 04:52 PM

    @Patrick Neveu

    I think in the documentation I see the api endpoints below in the "metadata" section at the bottom of the api docs. I think the api route should work since I don't think it has changed at all and your request body looks ok. 

    Things I would check to troubleshoot:

    • Check to see if the "/" character in the "defaultName" = "DW/dbo" is causing an issue with the json parsing. Maybe the server parses that character or encodes it and it causes a mismatch. I had an issue like that for a different undocumented internal cognos api and renaming a package to remove a special character fixed it.  
    • Double check to make sure your headers specify the Content-Type as "application/json" and Accept as "application/json" 
      • headers = {
            'IBM-BA-Authorization': "...",
            'content-type': "application/json",
            'accept': "application/json"
            }

    POST /datasources/import_metadata

    GET /datasources/{datasourceid}/connections/{connectionid}/signons/{signonid}/schemas


    API Docs for 12.0.4



    ------------------------------
    Michael Webb
    ------------------------------



  • 4.  RE: Cognos Analytics REST API: some APIs are removed from v11.1 to v12.x

    Posted Wed September 03, 2025 11:03 AM

    Hi Michael,

    I did see that some datasource APIs were in the metadata sub-folder.
    I will have to do more testing at this point.

    Thank you for your answer.

    Best regards,



    ------------------------------
    Patrick Neveu
    BSL Consulting
    IBM Champion
    ------------------------------