lokesh - Hello Team, Is there any API available...

Hello Team, Is there any API available to fetch users associated to a user group ( "principal_type":"USER_GROUP", "principal_sub_type":"LOCAL_GROUP",)
1 Reply
shikharTS
shikharTS2mo ago
Yes you can use this api to give two user groups
curl -X POST \
--url '{url}/api/rest/2.0/users/search' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer xxx' \
--data-raw '{
"record_offset": 0,
"record_size": 10,
"include_favorite_metadata": false,
"group_identifiers": [
"USER_GROUP",
"LOCAL_GROUP"
]
}'
curl -X POST \
--url '{url}/api/rest/2.0/users/search' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer xxx' \
--data-raw '{
"record_offset": 0,
"record_size": 10,
"include_favorite_metadata": false,
"group_identifiers": [
"USER_GROUP",
"LOCAL_GROUP"
]
}'
or use the group search api to search for groups
curl -X POST \
--url '{url}/api/rest/2.0/groups/search' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer xxx' \
--data-raw '{
"record_offset": 0,
"record_size": 10,
"include_users": true,
"include_sub_groups": true,
"sub_group_identifiers": [
"abc",
"def"
]
}'
curl -X POST \
--url '{url}/api/rest/2.0/groups/search' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer xxx' \
--data-raw '{
"record_offset": 0,
"record_size": 10,
"include_users": true,
"include_sub_groups": true,
"sub_group_identifiers": [
"abc",
"def"
]
}'

Did you find this page helpful?