Post

2 followers Follow
0
Avatar

Rest API to get user group assigned to each user

We are looking to fetch User group associated for each user using an API.

Please help with Rest API from which i can get these details.

Ritika Arora (MiddleEast) Answered

Please sign in to leave a comment.

1 comment

0
Avatar

Hi Ritika,

Since any user can belong to more than one group, your best bet is to query group membership links and to see what they're linking. Example:

GET https://api.clarizen.com/V2.0/services/data/Query?q=SELECT Container.Name,Member.Name FROM GroupMembershipLink

Example response:

{
    "entities": [
        {
            "id": "/GroupMembershipLink/2148njxz20xfsdfsddx43szxjhz011079",
            "Container": {
                "id": "/DiscussionGroup/5iudsdfsflre7cfpilbalaailivkt6",
                "Name": "Some Group"
            },
            "Member": {
                "id": "/User/2148njxz20xf1fdx43szxjhz0110sdf",
                "Name": "Some Member"
            }
        }
    ],
    "paging": {
        "from": 1,
        "limit": 1,
        "hasMore": true
    }
}

I hope this helps.

Roland

Roland Pumputis 0 votes
Comment actions Permalink