Rest Api Extract Users In Group Roles

Rest Api Extract Users In Group Roles

This question is answered

Hi, what endpoints do I need to extract all users in a group that belong to a certain role?

I have tried the following endpoints with no luck:

/api.ashx/v2/groups/{GroupId}/members/roles.xml?MemberType=users

This is returning 0 results.

/api.ashx/v2/users.xml -> /api.ashx/v2/roles/user/{username}.xml

Here I am getting all users then looping through each user and checking their roles permissions however this is not returning expected results. 

Any help would be appreciated!

Thanks

Verified Answer
  • That’s the link I sent previously:
     
    Patrick Mason
    Development Lead- Extensibility
    o: 214.420.1329
    telligent.com
     
    From: Gerard Flood [mailto:bounce-GerardTF@communities.telligent.com]
    Sent: Thursday, September 13, 2012 10:40 AM
    To: discussion_evolution@communities.telligent.com
    Subject: RE: [Telligent Evolution Platform Discussion] Rest Api Extract Users In Group Roles
     

    And how would I get all users that belong to a Role?

All Replies
  •  
    What specifically are you trying to do?  Are you meaning Site Role, membership level or a role that is a member of the group?
     
     
    Patrick Mason
    Development Lead- Extensibility
    o: 214.420.1329
    telligent.com
     
    From: Gerard Flood [mailto:bounce-GerardTF@communities.telligent.com]
    Sent: Wednesday, September 12, 2012 7:51 PM
    To: discussion_evolution@communities.telligent.com
    Subject: [Telligent Evolution Platform Discussion] Rest Api Extract Users In Group Roles
     

    Hi, what endpoints do I need to extract all users in a group that belong to a certain role?

    I have tried the following endpoints with no luck:

    /api.ashx/v2/groups/{GroupId}/members/roles.xml?MemberType=users

    This is returning 0 results.

    /api.ashx/v2/users.xml -> /api.ashx/v2/roles/user/{username}.xml

    Here I am getting all users then looping through each user and checking their roles permissions however this is not returning expected results. 

    Any help would be appreciated!

    Thanks

  • For example, I need to get an extract of all users within a group. The extract must contain "Username, Display Name, Email, and the roles they have for that group".

  • At present, I use "/api.ashx/v2/groups/{groupid}/members/users.xml" to get a list of users for a specific group. How do I then get each user's role in that group?

  • I would use the user version of that endpoint:
     
    If you want everyone then pass no parameters, if you want to include potential role members set that parameter.  The response includes the user’s membership type in the group
    Patrick Mason
    Development Lead- Extensibility
    o: 214.420.1329
    telligent.com
     
    From: Gerard Flood [mailto:bounce-GerardTF@communities.telligent.com]
    Sent: Thursday, September 13, 2012 8:19 AM
    To: discussion_evolution@communities.telligent.com
    Subject: RE: [Telligent Evolution Platform Discussion] Rest Api Extract Users In Group Roles
     

    For example, I need to get an extract of all users within a group. The extract must contain "Username, Display Name, Email, and the roles they have for that group".

  • I think you need to clarify what you mean by role.. an actual custom security role or their membership status?(Member, Owner, etc)
     
    Patrick Mason
    Development Lead- Extensibility
    o: 214.420.1329
    telligent.com
     
    From: Gerard Flood [mailto:bounce-GerardTF@communities.telligent.com]
    Sent: Thursday, September 13, 2012 8:28 AM
    To: discussion_evolution@communities.telligent.com
    Subject: RE: [Telligent Evolution Platform Discussion] Rest Api Extract Users In Group Roles
     

    At present, I use "/api.ashx/v2/groups/{groupid}/members/users.xml" to get a list of users for a specific group. How do I then get each user's role in that group?

  • Membership status firstly and if possible security role

  • MembershipType holds the current status within the group and is returned in the response…
     
    In terms of roles for a user you would need to call the roles endpoint
     
    Patrick Mason
    Development Lead- Extensibility
    o: 214.420.1329
    telligent.com
     
    From: Gerard Flood [mailto:bounce-GerardTF@communities.telligent.com]
    Sent: Thursday, September 13, 2012 9:08 AM
    To: discussion_evolution@communities.telligent.com
    Subject: RE: [Telligent Evolution Platform Discussion] Rest Api Extract Users In Group Roles
     

    Membership status firstly and if possible security role

  • So the roles for a user are not group specific, they are site wide?

  • Roles are created at the site level and people are added to them site level.
     
    Roles can be added as members of groups(and all members in that role are granted membership), this is why you can include RoleMembers
     
    Patrick Mason
    Development Lead- Extensibility
    o: 214.420.1329
    telligent.com
     
    From: Gerard Flood [mailto:bounce-GerardTF@communities.telligent.com]
    Sent: Thursday, September 13, 2012 9:21 AM
    To: discussion_evolution@communities.telligent.com
    Subject: RE: [Telligent Evolution Platform Discussion] Rest Api Extract Users In Group Roles
     

    So the roles for a user are not group specific, they are site wide?

  • And how would I get all users that belong to a Role?

  • That’s the link I sent previously:
     
    Patrick Mason
    Development Lead- Extensibility
    o: 214.420.1329
    telligent.com
     
    From: Gerard Flood [mailto:bounce-GerardTF@communities.telligent.com]
    Sent: Thursday, September 13, 2012 10:40 AM
    To: discussion_evolution@communities.telligent.com
    Subject: RE: [Telligent Evolution Platform Discussion] Rest Api Extract Users In Group Roles
     

    And how would I get all users that belong to a Role?