0

I need to know the way to get the users of a specific group through the REST API of Azure DevOps Server 2022, that is, on-premise. We are going to use as an example url 192.168.0.1 and the DefaultCollection as practice purposes. I have searched the documentation but when I try to apply them in my case they don't work for me, I get a 404 Not Found.

For now I am doing:

http://192.168.0.1:8080/tfs/_apis/groupentitlements?api-version=6.0-preview.1 http://192.168.0.1:8080/tfs/DefaultCollection/_apis/groupentitlements?api-version=6.0-preview.1

Neither seems to work. They throw 404.

I don't know if it has something to do with it, but I was reading on this website that a "vsaex" prefix is used for groupentitlements, "vssps" for graph and "status" for status, so I tried the following: http://vsaex.192.168.0.1:8080/tfs/_apis/groupentitlements?api-version=6.0-preview.1 http://vsaex.192.168.0.1:8080/tfs/DefaultCollection/_apis/groupentitlements?api-version=6.0-preview.1

Again, neither seems to work.

Also I tried differents api-versions, or without using any of them. I don't have any trouble using other parts of the REST API, e.g.: I can get Projects of a collection, Teams by Project, etc. and they work fine.

Matt
  • 3,658
  • 3
  • 14
  • 27
  • Hi @Gaspar, does the answer below helps? If it helps, just a remind of [ accept an answer](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work/5235#5235). – Antonia Wu-MSFT Nov 18 '22 at 08:03
  • No, it doesn't because as I said I need to get users of a specific group. That API is "used to determine whether an user has permissions to perform a specific action on a specific resource." Thank you for trying to help but I found your answer kind of generic. – Gaspar Zanini Nov 24 '22 at 16:25

2 Answers2

2

You are looking at the wrong APIs. Group Entitlements are for managing licenses for Azure DevOps Services and do not exist in on-prem versions of Azure DevOps Server.

You are looking for the Security APIs.

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
  • I'm not looking for Security APIs. Let me explain the problem better. For example. If I need to get the members of a TEAM of a specific project I can do: http://192.168.0.1:8080/{organization}/_apis/projects/{projectId}/teams/{TeamId}/members?api-version=6.0-preview.1 If I need to get the projectId for previus GET I could list all the projects with: http://192.168.0.1:8080/{organization}/_apis/projects?api-version=6.0-preview.1 – Gaspar Zanini Nov 24 '22 at 16:39
  • If I need to get teamId I could list all the teams of a specific project with: http://192.168.0.1:8080/{organization}/_apis/projects/{projectId}/teams?api-version=6.0-preview.1 So after that long example, you can see there is an API for get team members and from what I believe there is not group members API. – Gaspar Zanini Nov 24 '22 at 16:40
2

After some research I found that with this call you can GET what I was searching.

 - http://{server:port}/tfs/{collection}/_api/_identity/ReadGroupMembers?scope={groupId}&readMembers=true&api-version=6.0
   you can do that.

If you need the groupId you can get it from:

 - http://{server:port}/tfs/{collection}/_apis/identities?searchFilter=General&filterValue={group
   Name}&api-version=6.0

If you have more than 1 group called the same, search in the response the group that you want in providerDisplayName property -> [{ProjectName}]\\{Group Name} There you will get the groupId and from that you can get the Members of a Group

The weird thing is that you have tu use _api/_identity instead of _apis/identities.