Original Message:
Sent: 10-16-2025 10:47
From: Debora Lopes
Subject: How can I get the Group ID by Group Name using Python?
You can use the /api/v2/scim/groups API and pass as a filter 'displayName eq TEST_GROUP_1'
This code is from ApiExplorer:
import PureCloudPlatformClientV2
from PureCloudPlatformClientV2.rest import ApiException
from pprint import pprint
PureCloudPlatformClientV2.configuration.access_token = 'your_access_token'
api_instance = PureCloudPlatformClientV2.SCIMApi();
start_index = 1
count = 25
attributes = ['attributes_example']
excluded_attributes = ['excluded_attributes_example']
filter = 'displayName eq TEST_GROUP_1'
try:
api_response = api_instance.get_scim_groups(start_index=start_index, count=count, attributes=attributes, excluded_attributes=excluded_attributes, filter=filter)
pprint(api_response)
except ApiException as e:
print("Exception when calling SCIMApi->get_scim_groups: %s\n" % e)
------------------------------
Debora Lopes
Original Message:
Sent: 10-16-2025 10:37
From: Giampiero Casu
Subject: How can I get the Group ID by Group Name using Python?
I'm trying to get the Group Id by the Group Name using Python.
For example, I have a Group called "TEST_GROUP_1" and I'm looking for the corresponding Group ID.
I tried using the following Python code, but I don't know how to set the body object and the search request options.
api_instance = PureCloudPlatformClientV2.SearchApi()
body = PureCloudPlatformClientV2.GroupSearchRequest() # GroupSearchRequest | Search request options
api_response = api_instance.post_groups_search(body)
Please, can you help me?
Thanks so much for the support.
#PlatformAPI
------------------------------
Giampy
------------------------------