Get member of team
Article
10/25/2023
15 contributors
Feedback
In this article
Namespace: microsoft.graph
Get a conversationMember from a team .
This API is available in the following national cloud deployments .
Global service
US Government L4
US Government L5 (DOD)
China operated by 21Vianet
✅
✅
✅
✅
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions .
Permission Type
Permissions (from least to most privileged)
Delegated (work or school account)
TeamMember.Read.All, TeamMember.ReadWrite.All
Delegated (personal Microsoft account)
Not supported.
Application
TeamMember.Read.Group*, TeamMember.Read.All, TeamMember.ReadWrite.All
Note : Permissions marked with * use resource-specific consent .
HTTP request
GET /teams/{team-id}/members/{membership-id}
Optional query parameters
This operation does not support the OData query parameters to customize the response.
Header
Value
Authorization
Bearer {token}. Required.
Request body
Don't supply a request body for this method.
Response
If successful, this method returns a 200 OK
response code and a conversationMember object in the response body.
Example
Request
Here is an example of the request.
GET https://graph.microsoft.com/v1.0/teams/ece6f0a1-7ca4-498b-be79-edf6c8fc4d82/members/ZWUwZjVhZTItOGJjNi00YWU1LTg0NjYtN2RhZWViYmZhMDYyIyM3Mzc2MWYwNi0yYWM5LTQ2OWMtOWYxMC0yNzlhOGNjMjY3Zjk=
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Teams["{team-id}"].Members["{conversationMember-id}"].GetAsync();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc teams members get --team-id {team-id} --conversation-member-id {conversationMember-id}
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
members, err := graphClient.Teams().ByTeamId("team-id").Members().ByConversationMemberId("conversationMember-id").Get(context.Background(), nil)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
ConversationMember conversationMember = graphClient.teams("ece6f0a1-7ca4-498b-be79-edf6c8fc4d82").members("ZWUwZjVhZTItOGJjNi00YWU1LTg0NjYtN2RhZWViYmZhMDYyIyM3Mzc2MWYwNi0yYWM5LTQ2OWMtOWYxMC0yNzlhOGNjMjY3Zjk=")
.buildRequest()
.get();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
const options = {
authProvider,
};
const client = Client.init(options);
let conversationMember = await client.api('/teams/ece6f0a1-7ca4-498b-be79-edf6c8fc4d82/members/ZWUwZjVhZTItOGJjNi00YWU1LTg0NjYtN2RhZWViYmZhMDYyIyM3Mzc2MWYwNi0yYWM5LTQ2OWMtOWYxMC0yNzlhOGNjMjY3Zjk=')
.get();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$result = $graphServiceClient->teams()->byTeamId('team-id')->members()->byConversationMemberId('conversationMember-id')->get()->wait();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(credentials, scopes)
result = await graph_client.teams.by_team_id('team-id').members.by_conversation_member_id('conversationMember-id').get()
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
Response
Here is an example of the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#teams('ece6f0a1-7ca4-498b-be79-edf6c8fc4d82')/members/microsoft.graph.aadUserConversationMember/$entity",
"@odata.type":"#microsoft.graph.aadUserConversationMember",
"id":"/ZWUwZjVhZTItOGJjNi00YWU1LTg0NjYtN2RhZWViYmZhMDYyIyM3Mzc2MWYwNi0yYWM5LTQ2OWMtOWYxMC0yNzlhOGNjMjY3Zjk=",
"roles":[
"owner"
],
"displayName":"John Doe",
"userId":"8b081ef6-4792-4def-b2c9-c363a1bf41d5",
"email":null
}
See also