From 1b7df07abc5d6d94bf469cdded1d1619785d6bd9 Mon Sep 17 00:00:00 2001 From: Maciek Wojcik Date: Wed, 29 Nov 2023 13:36:28 +0100 Subject: [PATCH] LC-132 add remote logout --- .../agent-chat-api/changelog/index.mdx | 5 +++ .../messaging/agent-chat-api/v3.6/index.mdx | 44 +++++++++++++++++++ .../v3.6/rtm-reference/index.mdx | 22 +++++++--- 3 files changed, 64 insertions(+), 7 deletions(-) diff --git a/src/pages/messaging/agent-chat-api/changelog/index.mdx b/src/pages/messaging/agent-chat-api/changelog/index.mdx index dcac06db7..62ec890f5 100644 --- a/src/pages/messaging/agent-chat-api/changelog/index.mdx +++ b/src/pages/messaging/agent-chat-api/changelog/index.mdx @@ -31,6 +31,11 @@ The developer preview version provides a preview of the upcoming changes to the - The **List Customers** method was removed. +### Status + +- The **Logout** ([RTM](/messaging/agent-chat-api/v3.6/rtm-reference/#logout)) method has a new optional `agent_id` field which enables remote logout. +- There is a new **Logout** ([Web](/messaging/agent-chat-api/v3.6/#logout)) method. + ## [v3.5] - 2022-11-23 ### Chats diff --git a/src/pages/messaging/agent-chat-api/v3.6/index.mdx b/src/pages/messaging/agent-chat-api/v3.6/index.mdx index f1b3afce1..2a09e49e0 100644 --- a/src/pages/messaging/agent-chat-api/v3.6/index.mdx +++ b/src/pages/messaging/agent-chat-api/v3.6/index.mdx @@ -2317,6 +2317,50 @@ https://api.livechatinc.com/v3.6/agent/action/list_routing_statuses \ +
+ + +### Logout + +It logs out the specified agent. + +#### Specifics + +| | | +| ---------------------- | ---------------------------------------------------------------- | +| **Method URL** | `https://api.livechatinc.com/v3.6/agent/action/logout` | +| **Required scopes** | `agents--all:rw` | +| **RTM API equivalent** | [`logout`](/messaging/agent-chat-api/v3.6/rtm-reference/#logout) | +| **Push message** | - | + +#### Request + +| Parameter | Required | Data type | Notes | +| ---------- | -------- | --------- | ----- | +| `agent_id` | Yes | `string` | - | + +#### Response + +No response payload (`200 OK`). + + + + + +```shell +curl -X POST \ +https://api.livechatinc.com/v3.6/agent/action/logout \ +-H 'Authorization: Bearer ' \ +-H 'Content-Type: application/json' \ +-d '{ + "agent_id": "agent@example.com" + }' +``` + + + +
+ ## Other
diff --git a/src/pages/messaging/agent-chat-api/v3.6/rtm-reference/index.mdx b/src/pages/messaging/agent-chat-api/v3.6/rtm-reference/index.mdx index 3e870de9d..f9077820d 100644 --- a/src/pages/messaging/agent-chat-api/v3.6/rtm-reference/index.mdx +++ b/src/pages/messaging/agent-chat-api/v3.6/rtm-reference/index.mdx @@ -2715,12 +2715,18 @@ Logs the Agent out. #### Specifics -| | | -| ---------------------- | -------- | -| **Action** | `logout` | -| **Required scopes** | - | -| **Web API equivalent** | - | -| **Push message** | - | +| | | +| ---------------------- | ------------------------------------------------- | +| **Action** | `logout` | +| **Required scopes** | Only if agent_id is specified: `agents--all:rw` | +| **Web API equivalent** | [`logout`](/messaging/agent-chat-api/v3.6/#logout)| +| **Push message** | - | + +#### Request + +| Parameter | Required | Data type | Notes | +| ---------- | -------- | --------- | --------------------------------------------------- | +| `agent_id` | No | `string` | If not specified, the requester will be logged out. | @@ -2729,7 +2735,9 @@ Logs the Agent out. ```json { "action": "logout", - "payload": {} + "payload": { + "agent_id": "smith@example.com" + } } ```