| title | cloudCommunications: getPresencesByUserId |
|---|---|
| description | Get the presence information for multiple users. |
| author | ananmishr |
| ms.localizationpriority | medium |
| doc_type | apiPageType |
| ms.subservice | cloud-communications |
| ms.date | 04/05/2024 |
Namespace: microsoft.graph
[!INCLUDE beta-disclaimer]
Get the presence information for multiple users.
Note: This API allows users to subscribe only to another user's presence. If an application wants to subscribe to presence information for all users, it uses fictitious users to create the subscription to collect the required data.
[!INCLUDE national-cloud-support]
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
[!INCLUDE permissions-table]
POST /communications/getPresencesByUserId| Name | Description |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
| Content-type | application/json. Required. |
In the request body, provide a JSON object with the following parameter.
| Parameter | Type | Description |
|---|---|---|
| ids | String collection | The user object IDs. |
If successful, this method returns a 200 OK response code and a collection of presence objects in the response body.
The following example shows a request.
POST https://graph.microsoft.com/beta/communications/getPresencesByUserId
Content-Type: application/json
{
"ids": ["fa8bf3dc-eca7-46b7-bad1-db199b62afc3", "66825e03-7ef5-42da-9069-724602c31f6b"]
}[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
The following example shows the response.
Note: The response objects might be shortened for readability. All the properties will be returned from an actual call.
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1574
{
"value":[
{
"id":"fa8bf3dc-eca7-46b7-bad1-db199b62afc3",
"availability":"Busy",
"activity":"InAMeeting",
"outOfOfficeSettings":{
"message":null,
"isOutOfOffice":false
},
"sequenceNumber": "A0129311063"
},
{
"id":"66825e03-7ef5-42da-9069-724602c31f6b",
"availability":"Away",
"activity":"Away",
"outOfOfficeSettings":{
"message":null,
"isOutOfOffice":true
},
"sequenceNumber": "C0129312363"
}
]
}