Skip to content

Latest commit

 

History

History
121 lines (87 loc) · 4.54 KB

presence-clearpresence.md

File metadata and controls

121 lines (87 loc) · 4.54 KB
title description author ms.localizationpriority doc_type ms.subservice
presence: clearPresence
Clear the presence information for a user's application presence session.
awang119
medium
apiPageType
cloud-communications

presence: clearPresence

Namespace: microsoft.graph

[!INCLUDE beta-disclaimer]

Clear a presence session of an application for a user. If it is the user's only presence session, a successful clearPresence changes the user's presence to Offline/Offline.

Read more about presence sessions and their time-out and expiration.

[!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]

HTTP Request

POST /users/{userId}/presence/clearPresence

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 parameters.

Parameter Type Description
sessionId string The ID of the application's presence session.

Important

Provide the ID of the application as sessionId in the request.

Response

If successful, this method returns a 200 OK response code.

If the presence session doesn't exist, this method returns a 404 NotFound response code.

Examples

The following request shows the application with ID 22553876-f5ab-4529-bffb-cfe50aa89f87 that clears its presence session for user fa8bf3dc-eca7-46b7-bad1-db199b62afc3.

Request

POST https://graph.microsoft.com/beta/users/fa8bf3dc-eca7-46b7-bad1-db199b62afc3/presence/clearPresence
Content-Type: application/json

{
  "sessionId": "22553876-f5ab-4529-bffb-cfe50aa89f87"
}

[!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]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


Response

HTTP/1.1 200 OK