Skip to content

Latest commit

 

History

History
166 lines (128 loc) · 5.36 KB

File metadata and controls

166 lines (128 loc) · 5.36 KB
title cloudCommunications: getPresencesByUserId
description Get the presence information for multiple users.
author awang119
ms.localizationpriority medium
doc_type apiPageType
ms.subservice cloud-communications
ms.date 04/04/2024

cloudCommunications: getPresencesByUserId

Namespace: microsoft.graph

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]

Permissions

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]

Note:

  • Maximum of 650 user IDs are supported per API request.
  • The maximum request rate of this API is 1500 API requests in a 30 second period, per application per tenant.

HTTP Request

POST /communications/getPresencesByUserId

Request Headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
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/v1.0/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]


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": false
      }
    }
  ]
}

Related content

Get change notifications for presence updates in Microsoft Teams.