Cognos Analytics

Cognos Analytics

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

 View Only
Expand all | Collapse all

Get User CAMID(searchPath) from REST API

  • 1.  Get User CAMID(searchPath) from REST API

    Posted Mon March 13, 2023 01:05 AM

    Hi, team. Just wondering if we can make a REST api call to get a user's CAMID by defaultName or email, which would be quite convenient to connect back to Planning Analytics. Thanks.

    By the way, in CA 11.1, looks like REST API returns nothing by call members of a folder like this /groups/{id}/members? The id here is the folder ID. 



    ------------------------------
    mvp morgan
    ------------------------------


  • 2.  RE: Get User CAMID(searchPath) from REST API

    Posted Sun March 19, 2023 03:14 AM

    I can query now but looks like there is one mintue timeout setting by default as there are too many members in the group. Does anyone know the timeout setting or possible paginated query via REST? Thanks.



    ------------------------------
    mvp morgan
    ------------------------------



  • 3.  RE: Get User CAMID(searchPath) from REST API

    Posted Mon March 20, 2023 08:59 AM

    Try something like this:

    URL: GATEWAY+'/v1/namespaces/'+ NamespaceID+'/search'
    params:

    1. types=account
    2. method=contains
    3. fields=id,userName,surname,givenName,email,searchPath
    4. filter=searchTerm

    this is against the pm2 environment:



    ------------------------------
    Paul Mendelson
    ------------------------------



  • 4.  RE: Get User CAMID(searchPath) from REST API

    Posted Tue March 21, 2023 01:31 AM

    Thanks for that. I have tried similar way to query the all members under a group but unfortunately it didn't return anything I expected. 

    From the https://www.ibm.com/docs/en/cognos-analytics/11.1.0?topic=apis-rest-api

    IBM® Cognos® Analytics includes REST APIs to perform create, read, update, and delete operations on Cognos Analytics data, in compliance with OData Version 4 (http://www.odata.org/documentation).

    It seems to support OData4 but I can't make any query option work. Do you have any example to show how to work on users in a group? Thanks.

    https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptiontop



    ------------------------------
    mvp morgan
    ------------------------------



  • 5.  RE: Get User CAMID(searchPath) from REST API

    Posted Tue February 17, 2026 09:48 AM

    When I query against the AD namespace I get 404 errors on CA 12.1. What can be the problem?



    ------------------------------
    Goker Celik
    ------------------------------



  • 6.  RE: Get User CAMID(searchPath) from REST API

    Posted Wed February 18, 2026 08:59 AM

    Hi Goker,

    Does it work with &fields=* instead of what you have?
    Is it working with another namespace?

    Best regards,



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



  • 7.  RE: Get User CAMID(searchPath) from REST API

    Posted Wed February 18, 2026 09:05 AM

    nope same result. We do not have any other namespace



    ------------------------------
    Goker Celik
    ------------------------------



  • 8.  RE: Get User CAMID(searchPath) from REST API

    Posted Thu February 19, 2026 03:46 AM

    Hi Goker,


    Would you be able to try with:

    {{cognos_base_url}}/api/v1/namespace_folder/xQ31nbmRyRXg_/items?limit=100&offset=0&types=role&fields=id,defaultName,searchPath

    I've got a result (200 OK) with this syntax. Note: I'm not using an AD namespace.

    Best regards,



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



  • 9.  RE: Get User CAMID(searchPath) from REST API

    Posted Thu February 19, 2026 04:29 AM

    Another thing to check - make sure the gateway url is correct. So for my sandbox environment it would be https://cognos.pmsquare.com/sandbox/bi/v1/etc

    The 404 would indicate that it's not getting to the Cognos application at all



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



  • 10.  RE: Get User CAMID(searchPath) from REST API

    Posted Fri February 20, 2026 03:21 AM

    I am using the dispatcher url not the gateway and other endpoints are working fine



    ------------------------------
    Goker Celik
    ------------------------------



  • 11.  RE: Get User CAMID(searchPath) from REST API

    Posted Fri February 20, 2026 03:38 AM

    Did you try this syntax below (replace xQ31nbmRyRXg_ with your id)?

    {{cognos_base_url}}/api/v1/namespace_folder/xQ31nbmRyRXg_/items?limit=100&offset=0&types=role&fields=id,defaultName,searchPath



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



  • 12.  RE: Get User CAMID(searchPath) from REST API

    Posted Fri February 20, 2026 04:13 AM

    Ok I did that right but I thought I should replace namespace_folder with my folder name. It worked as yo stated. Then I have another question. How do a traverse subfolders under the namespace? putting them between CAMID and items?
    e.g.

    {{cognos_base_url}}/api/v1/namespace_folder/xQ31nbmRyRXg_/{{namespace_subfolder}}/items?limit=100&offset=0&types=role&fields=id,defaultName,searchPath



    ------------------------------
    Goker Celik
    ------------------------------



  • 13.  RE: Get User CAMID(searchPath) from REST API

    Posted Fri February 20, 2026 04:25 AM

    Goker,

    I'm not sure about what you are looking for but a good starting point would be:

    {{cognos_base_url}}/api/api-docs/#/accounts

    Best regards,



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



  • 14.  RE: Get User CAMID(searchPath) from REST API

    Posted Fri February 20, 2026 04:48 AM

    Ok I got it but now have the same timeout problem as the groups endpoint. It seems disregarding the limit parameter



    ------------------------------
    Goker Celik
    ------------------------------



  • 15.  RE: Get User CAMID(searchPath) from REST API

    Posted Fri February 20, 2026 05:26 AM

    Goker,

    You may want to try some parameters from this page:

    https://developer.ibm.com/apis/catalog/cognosanalytics--cognos-analytics-12-1-x/api/API--cognosanalytics--cognos-analytics-12-1-x#get_namespace_folder_items

    I don't have any other ideas.

    I've tried to use limit=2 and it is working as expected in my case.

    Best regards,



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



  • 16.  RE: Get User CAMID(searchPath) from REST API

    Posted Fri February 20, 2026 03:49 AM

    Hi Patrick,

    What is that CAM ID you are using?

    Regards,



    ------------------------------
    Goker Celik
    ------------------------------



  • 17.  RE: Get User CAMID(searchPath) from REST API

    Posted Fri February 20, 2026 03:57 AM

    Go to Manager / People / Accounts.

    You should see Cognos and your namespace.

    Click on Action menu on your namespace's line.

    Choose Properties then you will see the ID for your namespace.



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