I am trying to restrict the permissions for a specific AD group on a branch level. Previously I have asked the Microsoft Azure DevOps team if they had any endpoint URI REST API for this request, but the response that I have got was that it was not currently available. However, I have managed to get the API using the chrome developer tool, which was
https://dev.azure.com/{organization}/_apis/accesscontrolentries/{namespacetoken}?api-version=5.1
Then, I am making the POST request using this body below,
branchPermissionbody = {
"token": "{}".format(permissionToken),
"merge": True,
"accessControlEntries": [
{
"descriptor": "Microsoft.TeamFoundation.Identity;{}".format(descriptorIdentifier),
"deny": 4,
"extendedinfo": {}
}
]
}
The Permission Token, is in the format of ,
repoV2/{projectID}/{repositoryID}/refs/heads/{branchID}/
and the descriptoridentier is something we can get.
Here, I am stuck on getting the branchID. For example, if the branch we are trying to restrict are master, support%5E, how do we grab these branch ID using the developer tool?



