Les API sous la version /beta dans Microsoft Graph sont susceptibles d’être modifiées. L’utilisation de ces API dans des applications de production n’est pas prise en charge. Pour déterminer si une API est disponible dans v1.0, utilisez le sélecteur Version .
Obtenez les informations de présence pour plusieurs utilisateurs.
Note: Cette API permet aux utilisateurs de s’abonner uniquement à la présence d’un autre utilisateur. Si une application souhaite s’abonner aux informations de présence de tous les utilisateurs, elle utilise des utilisateurs fictifs pour créer l’abonnement afin de collecter les données requises.
POST https://graph.microsoft.com/beta/communications/getPresencesByUserId
Content-Type: application/json
{
"ids": ["fa8bf3dc-eca7-46b7-bad1-db199b62afc3", "66825e03-7ef5-42da-9069-724602c31f6b"]
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Communications.GetPresencesByUserId;
var requestBody = new GetPresencesByUserIdPostRequestBody
{
Ids = new List<string>
{
"fa8bf3dc-eca7-46b7-bad1-db199b62afc3",
"66825e03-7ef5-42da-9069-724602c31f6b",
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Communications.GetPresencesByUserId.PostAsGetPresencesByUserIdPostResponseAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphcommunications "github.com/microsoftgraph/msgraph-beta-sdk-go/communications"
//other-imports
)
requestBody := graphcommunications.NewGetPresencesByUserIdPostRequestBody()
ids := []string {
"fa8bf3dc-eca7-46b7-bad1-db199b62afc3",
"66825e03-7ef5-42da-9069-724602c31f6b",
}
requestBody.SetIds(ids)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
getPresencesByUserId, err := graphClient.Communications().GetPresencesByUserId().PostAsGetPresencesByUserIdPostResponse(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.communications.getpresencesbyuserid.GetPresencesByUserIdPostRequestBody getPresencesByUserIdPostRequestBody = new com.microsoft.graph.beta.communications.getpresencesbyuserid.GetPresencesByUserIdPostRequestBody();
LinkedList<String> ids = new LinkedList<String>();
ids.add("fa8bf3dc-eca7-46b7-bad1-db199b62afc3");
ids.add("66825e03-7ef5-42da-9069-724602c31f6b");
getPresencesByUserIdPostRequestBody.setIds(ids);
var result = graphClient.communications().getPresencesByUserId().post(getPresencesByUserIdPostRequestBody);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Communications\GetPresencesByUserId\GetPresencesByUserIdPostRequestBody;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new GetPresencesByUserIdPostRequestBody();
$requestBody->setIds(['fa8bf3dc-eca7-46b7-bad1-db199b62afc3', '66825e03-7ef5-42da-9069-724602c31f6b', ]);
$result = $graphServiceClient->communications()->getPresencesByUserId()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.communications.get_presences_by_user_id.get_presences_by_user_id_post_request_body import GetPresencesByUserIdPostRequestBody
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = GetPresencesByUserIdPostRequestBody(
ids = [
"fa8bf3dc-eca7-46b7-bad1-db199b62afc3",
"66825e03-7ef5-42da-9069-724602c31f6b",
],
)
result = await graph_client.communications.get_presences_by_user_id.post(request_body)