Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  How to get all groups with post_groups_search API (Python), not just public ones?

    Posted 29 days ago

    Hi,
    I'm trying to get a list of the names and IDs of all configured groups in Python.

    Using the following code, I only get some groups in the response, not all of them.

    api_instance_SearchApi = PureCloudPlatformClientV2.SearchApi(api_client)
    body = PureCloudPlatformClientV2.GroupSearchRequest()
    api_response_SearchApi = api_instance_SearchApi.post_groups_search(body)

    In particular, it seems to me that the response only contains groups with visibility='public'.

    Even using PureCloudPlatformClientV2.SCIMApi(api_client) + get_scim_groups (without filters) gives me the same result.

    I'm not getting all the configured groups, only those with Visibility=Public.

    Is there a way to get all the groups, not just those with visibility='public'?

    Thanks so much for your support.


    #PlatformAPI

    ------------------------------
    Giampy
    ------------------------------


  • 2.  RE: How to get all groups with post_groups_search API (Python), not just public ones?

    Posted 28 days ago

    Hi,

    I haven't tested it with APIs but if you have the permission Directory > privateGroup > View I would expect it to show the private groups as well.



    ------------------------------
    Jan Heinonen
    Contact Center Specialist
    GlobalConnect AB
    ------------------------------



  • 3.  RE: How to get all groups with post_groups_search API (Python), not just public ones?

    Posted 28 days ago
    GC web_interface detail directory-->groups

    Hi Jan, thank you so much.
    In the web interface (directory-->groups, see attached print-screen), I can see all the groups.
    Even if I use the API directly via explorer (https://developer.genesys.cloud/devapps/api-explorer), it returns all the groups.

    However, if I create an OAuth-client and use it with the Python API call api_instance_SearchApi.post_groups_search, the response only contains groups with public visibility.

    Thanks again to you and everyone who wants to help me.



    ------------------------------
    Giampiero Casu
    ------------------------------



  • 4.  RE: How to get all groups with post_groups_search API (Python), not just public ones?

    Posted 28 days ago

    Hi Giampiero Casu 

    Might be the token type. This one seems app-based, so it shows only public groups. Maybe try a user token to see if it changes the result.



    ------------------------------
    Luiz Rosa
    Full stack developer
    ------------------------------



  • 5.  RE: How to get all groups with post_groups_search API (Python), not just public ones?

    Posted 28 days ago

    Hi,

    It seems to be an issue with that endpoint while using Client Credentials, might wanna check with support if it's intentional.

    I get the same issue when trying post_groups_search, but if I use GroupsApi.get_groups() instead I get all groups.



    ------------------------------
    Jan Heinonen
    Contact Center Specialist
    GlobalConnect AB
    ------------------------------