cloudCommunications: getPresencesByUserId
Namespace: microsoft.graph
Important
APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Get the presence information for multiple users.
Permissions
One of the following permissions is required to call these APIs. To learn more, including how to choose permissions, see Permissions.
| Permission type | Permissions (from least to most privileged) |
|---|---|
| Delegated (work or school account) | Presence.Read.All |
| Delegated (personal Microsoft account) | Not Supported. |
| Application | Not Supported. |
HTTP Request
POST /communications/getPresencesByUserId
Request Headers
| Name | Description |
|---|---|
| Authorization | Bearer {token}. Required. |
| Content-type | application/json. Required. |
Request body
In the request body, provide a JSON object with the following parameter.
| Parameter | Type | Description |
|---|---|---|
| ids | String collection | The user object IDs. |
Response
If successful, this method returns a 200 OK response code and a collection of presence objects in the response body.
Examples
Request
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"]
}
Response
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
}
},
{
"id":"66825e03-7ef5-42da-9069-724602c31f6b",
"availability":"Away",
"activity":"Away",
"outOfOfficeSettings":{
"message":null,
"isOutOfOffice":true
}
}
]
}
Feedback
Submit and view feedback for