| title | Get presence |
|---|---|
| description | Get a user's presence information. |
| author | awang119 |
| ms.localizationpriority | medium |
| doc_type | apiPageType |
| ms.subservice | cloud-communications |
| ms.date | 04/04/2024 |
Namespace: microsoft.graph
Get a user's presence information.
[!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]
Note
- You can't use application permissions to access APIs under the
/mepath. - The maximum request rate for this API is 1,500 requests within a 30-second period, per application per tenant.
GET /users/{id}/presence
GET /communications/presences/{id}
GET /me/presenceNote
- You must pass the user's ID to get their presence information.
- When you call
GET /users/{id}/presenceorGET /communications/presences/{id}, replace{id}with the user’s GUID. - For examples on how to get the unique identifier for a user, see Get user.
| Name | Description |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
Don't supply a request body for this method.
If successful, this method returns a 200 OK response code and a presence object in the response body.
The following example shows how to get your own presence information. This operation requires the Presence.Read permission.
GET https://graph.microsoft.com/v1.0/me/presence
[!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]
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1574
{
"id": "fa8bf3dc-eca7-46b7-bad1-db199b62afc3",
"availability": "Available",
"activity": "Available",
"outOfOfficeSettings": {
"message": null,
"isOutOfOffice": false
},
"sequenceNumber": "A0129311063",
"workLocation": {
"workLocationType": "office",
"source": "automatic",
"placeId": "eb706f15-137e-4722-b4d1-b601481d9251"
}
}The following example shows how to get the presence information for another user. This operation requires the Presence.Read.All permission.
GET https://graph.microsoft.com/v1.0/users/66825e03-7ef5-42da-9069-724602c31f6b/presence
[!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]
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1574
{
"id": "66825e03-7ef5-42da-9069-724602c31f6b",
"availability": "DoNotDisturb",
"activity": "Presenting",
"outOfOfficeSettings": {
"message": null,
"isOutOfOffice": false
},
"sequenceNumber": "A0129311063"
}The following example shows how to get the presence information for another user. This operation requires the Presence.Read.All permission.
GET https://graph.microsoft.com/v1.0/communications/presences/dc74d9bb-6afe-433d-8eaa-e39d80d3a647
[!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]
HTTP/1.1 200 OK
{
"value": [
{
"id": "dc74d9bb-6afe-433d-8eaa-e39d80d3a647",
"availability": "Away",
"activity": "BeRightBack",
"outOfOfficeSettings": {
"message": null,
"isOutOfOffice": false
},
"sequenceNumber": "A0129311063"
}
]
}