Memberships - Get

Get a membership relationship between a container and subject.

GET https://vssps.dev.azure.com/{organization}/_apis/graph/memberships/{subjectDescriptor}/{containerDescriptor}?api-version=7.1-preview.1

URI Parameters

Name In Required Type Description
containerDescriptor
path True

string

A descriptor to the container in the relationship.

organization
path True

string

The name of the Azure DevOps organization.

subjectDescriptor
path True

string

A descriptor to the child subject in the relationship.

api-version
query True

string

Version of the API to use. This should be set to '7.1-preview.1' to use this version of the api.

Responses

Name Type Description
200 OK

GraphMembership

successful operation

Security

oauth2

Type: oauth2
Flow: accessCode
Authorization URL: https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token URL: https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer

Scopes

Name Description
vso.graph Grants the ability to read user, group, scope and group membership information

Examples

For a Group
For a User

For a Group

Sample request

GET https://vssps.dev.azure.com/{organization}/_apis/graph/memberships/{subjectDescriptor}/{containerDescriptor}?api-version=7.1-preview.1

Sample response

{
  "containerDescriptor": "vssgp.Uy0xLTktMTU1MTM3NDI0NS0yMTc2MDU2ODQ4LTMyODAwNzczODUtMjM4NDQzMDA4Mi0yNTc3Njk3NTA4LTEtMjc2NDUyMzk5MS0zNTcwNTk2NDktMjg0Mjg0MDY1My0zODY1MTM4Nzcw",
  "memberDescriptor": "vssgp.Uy0xLTktMTU1MTM3NDI0NS0yMTc2MDU2ODQ4LTMyODAwNzczODUtMjM4NDQzMDA4Mi0yNTc3Njk3NTA4LTEtMTE2OTQxODg1MC0zMTAxNjQ5MjE2LTIyMTE3NzI3NzMtMTUyNTg1MzYzNA",
  "_links": {
    "self": {
      "href": "https://vssps.dev.azure.com/Fabrikam/_apis/Graph/Memberships/vssgp.Uy0xLTktMTU1MTM3NDI0NS0yMTc2MDU2ODQ4LTMyODAwNzczODUtMjM4NDQzMDA4Mi0yNTc3Njk3NTA4LTEtMTE2OTQxODg1MC0zMTAxNjQ5MjE2LTIyMTE3NzI3NzMtMTUyNTg1MzYzNA/vssgp.Uy0xLTktMTU1MTM3NDI0NS0yMTc2MDU2ODQ4LTMyODAwNzczODUtMjM4NDQzMDA4Mi0yNTc3Njk3NTA4LTEtMjc2NDUyMzk5MS0zNTcwNTk2NDktMjg0Mjg0MDY1My0zODY1MTM4Nzcw"
    },
    "member": {
      "href": "https://vssps.dev.azure.com/Fabrikam/_apis/Graph/Groups/vssgp.Uy0xLTktMTU1MTM3NDI0NS0yMTc2MDU2ODQ4LTMyODAwNzczODUtMjM4NDQzMDA4Mi0yNTc3Njk3NTA4LTEtMTE2OTQxODg1MC0zMTAxNjQ5MjE2LTIyMTE3NzI3NzMtMTUyNTg1MzYzNA"
    },
    "container": {
      "href": "https://vssps.dev.azure.com/Fabrikam/_apis/Graph/Groups/vssgp.Uy0xLTktMTU1MTM3NDI0NS0yMTc2MDU2ODQ4LTMyODAwNzczODUtMjM4NDQzMDA4Mi0yNTc3Njk3NTA4LTEtMjc2NDUyMzk5MS0zNTcwNTk2NDktMjg0Mjg0MDY1My0zODY1MTM4Nzcw"
    }
  }
}

For a User

Sample request

GET https://vssps.dev.azure.com/{organization}/_apis/graph/memberships/{subjectDescriptor}/{containerDescriptor}?api-version=7.1-preview.1

Sample response

{
  "containerDescriptor": "vssgp.Uy0xLTktMTU1MTM3NDI0NS0yMTc2MDU2ODQ4LTMyODAwNzczODUtMjM4NDQzMDA4Mi0yNTc3Njk3NTA4LTEtMzc5ODc3NjQ4NS02MDUxNTc3MDItMjYwNTUyMjgyMi0xMTc1OTEzNzYz",
  "memberDescriptor": "aad.MDA0NzBlMzQtZGE2MS03YTY5LWJkOTYtNDg3YTg0OWVjNTU4",
  "_links": {
    "self": {
      "href": "https://vssps.dev.azure.com/Fabrikam/_apis/Graph/Memberships/aad.MDA0NzBlMzQtZGE2MS03YTY5LWJkOTYtNDg3YTg0OWVjNTU4/vssgp.Uy0xLTktMTU1MTM3NDI0NS0yMTc2MDU2ODQ4LTMyODAwNzczODUtMjM4NDQzMDA4Mi0yNTc3Njk3NTA4LTEtMzc5ODc3NjQ4NS02MDUxNTc3MDItMjYwNTUyMjgyMi0xMTc1OTEzNzYz"
    },
    "member": {
      "href": "https://vssps.dev.azure.com/Fabrikam/_apis/Graph/Users/aad.MDA0NzBlMzQtZGE2MS03YTY5LWJkOTYtNDg3YTg0OWVjNTU4"
    },
    "container": {
      "href": "https://vssps.dev.azure.com/Fabrikam/_apis/Graph/Groups/vssgp.Uy0xLTktMTU1MTM3NDI0NS0yMTc2MDU2ODQ4LTMyODAwNzczODUtMjM4NDQzMDA4Mi0yNTc3Njk3NTA4LTEtMzc5ODc3NjQ4NS02MDUxNTc3MDItMjYwNTUyMjgyMi0xMTc1OTEzNzYz"
    }
  }
}

Definitions

Name Description
GraphMembership

Relationship between a container and a member

ReferenceLinks

The class to represent a collection of REST reference links.

GraphMembership

Relationship between a container and a member

Name Type Description
_links

ReferenceLinks

This field contains zero or more interesting links about the graph membership. These links may be invoked to obtain additional relationships or more detailed information about this graph membership.

containerDescriptor

string

memberDescriptor

string

The class to represent a collection of REST reference links.

Name Type Description
links

object

The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only.