From db22b1d862156f9d9d63f93283cb016f13c0a347 Mon Sep 17 00:00:00 2001 From: Faria Masood Date: Mon, 20 Nov 2023 21:00:54 +0000 Subject: [PATCH] GITBOOK-1167: Omnichannel: Visitor endpoints set 2 --- SUMMARY.md | 17 ++--- reference/api/rest-api/endpoints/README.md | 16 ++-- .../livechat-visitors-1/README.md | 2 - .../get-pages-visited-by-livechat-visitor.md | 43 ----------- .../search-a-visitors-chat.md | 54 ------------- .../visitor-autocomplete.md | 76 ------------------- .../livechat-visitors-1/visitor-info-by-id.md | 60 --------------- .../get-livechat-visitors-chat-history.md | 33 +++----- .../get-pages-visited-by-livechat-visitor.md | 57 ++++++++++++++ .../visitor/get-the-visitor-info.md | 6 +- .../visitor/retrieve-a-visitor-data.md | 4 +- .../visitor/search-a-visitors-chat.md | 45 +++++++++++ .../visitor/search-for-visitors.md | 49 ------------ .../search-visitors-by-term.md | 31 +++----- .../visitor/visitor-autocomplete.md | 35 +++++++++ 15 files changed, 178 insertions(+), 350 deletions(-) delete mode 100644 reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-visitors-1/README.md delete mode 100644 reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-visitors-1/get-pages-visited-by-livechat-visitor.md delete mode 100644 reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-visitors-1/search-a-visitors-chat.md delete mode 100644 reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-visitors-1/visitor-autocomplete.md delete mode 100644 reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-visitors-1/visitor-info-by-id.md rename reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/{livechat-visitors-1 => visitor}/get-livechat-visitors-chat-history.md (72%) create mode 100644 reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/get-pages-visited-by-livechat-visitor.md create mode 100644 reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/search-a-visitors-chat.md delete mode 100644 reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/search-for-visitors.md rename reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/{livechat-visitors-1 => visitor}/search-visitors-by-term.md (52%) create mode 100644 reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/visitor-autocomplete.md diff --git a/SUMMARY.md b/SUMMARY.md index f4afda79b..a1c55af3c 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -408,10 +408,14 @@ * [Send Livechat Offline Message](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-offline-message.md) * [Livechat Visitors](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/README.md) * [Register Livechat Visitor](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/register-a-new-livechat-visitor.md) - * [Get Visitor Data](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/retrieve-a-visitor-data.md) - * [Get Visitor Information](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/get-the-visitor-info.md) + * [Get Visitor Information](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/retrieve-a-visitor-data.md) + * [Get Visitor Information by ID](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/get-the-visitor-info.md) * [Get Open Conversation of a Visitor](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/get-open-conversation-of-a-visitor.md) - * [Search for Visitors](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/search-for-visitors.md) + * [Search Visitors by Term](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/search-visitors-by-term.md) + * [Get Pages Visited by Livechat Visitor](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/get-pages-visited-by-livechat-visitor.md) + * [Get Livechat Visitor Chat History](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/get-livechat-visitors-chat-history.md) + * [Search Visitor Chat](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/search-a-visitors-chat.md) + * [Visitor Autocomplete](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/visitor-autocomplete.md) * [Set Visitor Status](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/set-visitor-status.md) * [Delete Visitor](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/delete-a-visitor.md) * [Livechat Statistics](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-statistics/README.md) @@ -503,13 +507,6 @@ * [List Livechat Triggers](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-triggers/list-livechat-triggers.md) * [Get a Livechat Trigger](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-triggers/get-a-livechat-trigger.md) * [Livechat Upload](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-upload.md) - * [Livechat Visitors](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-visitors-1/README.md) - * [Visitor info by ID](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-visitors-1/visitor-info-by-id.md) - * [Get pages visited by livechat visitor](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-visitors-1/get-pages-visited-by-livechat-visitor.md) - * [Get livechat visitor's chat history](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-visitors-1/get-livechat-visitors-chat-history.md) - * [Search a visitors chat](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-visitors-1/search-a-visitors-chat.md) - * [Visitor Autocomplete](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-visitors-1/visitor-autocomplete.md) - * [Search Visitors by term](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-visitors-1/search-visitors-by-term.md) * [Livechat Monitors](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-monitors/README.md) * [Get Monitors](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-monitors/get-monitors.md) * [Get a Monitor](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-monitors/get-a-monitor.md) diff --git a/reference/api/rest-api/endpoints/README.md b/reference/api/rest-api/endpoints/README.md index 383eb5827..a3ee8e1ee 100644 --- a/reference/api/rest-api/endpoints/README.md +++ b/reference/api/rest-api/endpoints/README.md @@ -512,14 +512,14 @@ From version 0.50.0 and on, you can call the methods using `dm` instead of `im`. #### Livechat Visitors -| Url | Short Description | Details Page | -| ---------------------------------------------------------------------- | ------------------------------------------- | --------------------------------------------------------------------------------------------------- | -| `api/v1/livechat/visitors.info` | Retrieves visitor info by ID | [Link](omnichannel/livechat-endpoints/livechat-visitors-1/visitor-info-by-id.md) | -| `api/v1/livechat/visitors.pagesVisited/:roomId` | Retrieves pages visited by livechat visitor | [Link](omnichannel/livechat-endpoints/livechat-visitors-1/get-pages-visited-by-livechat-visitor.md) | -| `api/v1/livechat/visitors.chatHistory/room/:roomId/visitor/:visitorId` | Retrieves livechat visitor's chat history | [Link](omnichannel/livechat-endpoints/livechat-visitors-1/get-livechat-visitors-chat-history.md) | -| `api/v1/livechat/visitors.searchChats/room/:roomId/visitor/:visitorId` | Searches a visitor's chat | [Link](omnichannel/livechat-endpoints/livechat-visitors-1/search-a-visitors-chat.md) | -| `api/v1/livechat/visitors.autocomplete` | Autocompletes visitor's name | [Link](omnichannel/livechat-endpoints/livechat-visitors-1/visitor-autocomplete.md) | -| `api/v1/livechat/visitors.search` | Searches the visitor by the term | [Link](omnichannel/livechat-endpoints/livechat-visitors-1/search-visitors-by-term.md) | +| Url | Short Description | Details Page | +| ---------------------------------------------------------------------- | ------------------------------------------- | --------------------------------------------------------------------------------------- | +| `api/v1/livechat/visitors.info` | Retrieves visitor info by ID | [Link](omnichannel/livechat-endpoints/visitor/get-the-visitor-info.md) | +| `api/v1/livechat/visitors.pagesVisited/:roomId` | Retrieves pages visited by livechat visitor | [Link](omnichannel/livechat-endpoints/visitor/get-pages-visited-by-livechat-visitor.md) | +| `api/v1/livechat/visitors.chatHistory/room/:roomId/visitor/:visitorId` | Retrieves livechat visitor's chat history | [Link](omnichannel/livechat-endpoints/visitor/get-livechat-visitors-chat-history.md) | +| `api/v1/livechat/visitors.searchChats/room/:roomId/visitor/:visitorId` | Searches a visitor's chat | [Link](omnichannel/livechat-endpoints/visitor/search-a-visitors-chat.md) | +| `api/v1/livechat/visitors.autocomplete` | Autocompletes visitor's name | [Link](omnichannel/livechat-endpoints/visitor/visitor-autocomplete.md) | +| `api/v1/livechat/visitors.search` | Searches the visitor by the term | [Link](omnichannel/livechat-endpoints/visitor/search-visitors-by-term.md) | #### Livechat Monitors diff --git a/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-visitors-1/README.md b/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-visitors-1/README.md deleted file mode 100644 index 31b786e09..000000000 --- a/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-visitors-1/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# Omnichannel Visitors - diff --git a/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-visitors-1/get-pages-visited-by-livechat-visitor.md b/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-visitors-1/get-pages-visited-by-livechat-visitor.md deleted file mode 100644 index a8eaff6ba..000000000 --- a/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-visitors-1/get-pages-visited-by-livechat-visitor.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -description: Get pages visited by livechat visitor ---- - -# Get pages visited by livechat visitor - -| URL | Requires Auth | HTTP Method | -| :--- | :--- | :--- | -| `api/v1/livechat/visitors.pagesVisited/:roomId` | `YES` | `GET` | - -## Headers - -| Argument | Example | Required | Description | -| :--- | :--- | :--- | :--- | -| `X-User-Id` | `myuser-name` | Required | Your username hash \(returned after you log in through the API\) | -| `X-Auth-Token` | `myauth-token` | Required | Your token \(returned after you log in through the API\) | - -## URL Parameters - -| Argument | Example | Required | Description | -| :--- | :--- | :--- | :--- | -| `roomId` | `hhMKhHnnbY79mGs9K` | Required | Livechat room id | - -## Example Call - -```bash -curl --location --request GET 'http://localhost:3000/api/v1/livechat/visitors.pagesVisited/:roomId \ ---header 'X-Auth-Token: myauth-token' \ ---header 'X-User-Id: myuser-name' -``` - -## Result - -```javascript -{ - "pages": [], - "count": 0, - "offset": 0, - "total": 0, - "success": true -} -``` - diff --git a/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-visitors-1/search-a-visitors-chat.md b/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-visitors-1/search-a-visitors-chat.md deleted file mode 100644 index a81ebb4d1..000000000 --- a/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-visitors-1/search-a-visitors-chat.md +++ /dev/null @@ -1,54 +0,0 @@ -# Search a visitors chat - -| URL | Requires Auth | HTTP Method | -| :--- | :--- | :--- | -| `api/v1/livechat/visitors.searchChats/room/:roomId/visitor/:visitorId` | `YES` | `GET` | - -## Headers - -| Argument | Example | Required | Description | -| :--- | :--- | :--- | :--- | -| `X-User-Id` | `myuser-name` | Required | Your username hash \(returned after you log in through the API\) | -| `X-Auth-Token` | `myauth-token` | Required | Your token \(returned after you log in through the API\) | - -## URL Parameters - -| Argument | Example | Required | Description | -| :--- | :--- | :--- | :--- | -| `roomId` | `hhMKhHnnbY79mGs9K` | Required | Livechat room id | -| `visitorId` | `QyBAKC5Wc8tcv6cco` | Required | Livechat visitor id | - -## Example Call - -```bash -curl --location --request GET 'http://localhost:3000/api/v1/livechat/visitors.searchChats/room/:roomId/visitor/:visitorId\ ---header 'X-Auth-Token: myauth-token' \ ---header 'X-User-Id: myuser-name' -``` - -## Result - -```javascript -{ - "history": [ - { - "_id": "hhMKhHnnbY79mGs9K", - "msgs": 2, - "fname": "Maria", - "ts": "2021-07-22T17:17:04.216Z", - "v": { - "_id": "QyBAKC5Wc8tcv6cco", - "username": "guest-537", - "token": "8s7e9ony6ctl27e1qf8kue", - "status": "online", - "lastMessageTs": "2021-07-22T17:17:04.937Z" - } - } - ], - "count": 1, - "offset": 0, - "total": 1, - "success": true -} -``` - diff --git a/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-visitors-1/visitor-autocomplete.md b/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-visitors-1/visitor-autocomplete.md deleted file mode 100644 index cb3e66d0f..000000000 --- a/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-visitors-1/visitor-autocomplete.md +++ /dev/null @@ -1,76 +0,0 @@ ---- -description: Autocompletes visitor's name ---- - -# Visitor Autocomplete - -| URL | Requires Auth | HTTP Method | -| :--- | :--- | :--- | -| `api/v1/livechat/visitors.autocomplete` | `YES` | `GET` | - -## Headers - -| Argument | Example | Required | Description | -| :--- | :--- | :--- | :--- | -| `X-User-Id` | `myuser-name` | Required | Your username hash \(returned after you log in through the API\) | -| `X-Auth-Token` | `myauth-token` | Required | Your token \(returned after you log in through the API\) | - -## Parameters - -| Argument | Example | Required | -| :--- | :--- | :--- | -| `selector` | `{ "exceptions" : [], "conditions" : {}}` | Required | - -## Example Call - -```bash -curl --location --request GET 'http://localhost:3000/api/v1/livechat/department?text=&onlyMyDepartments=true \ ---header 'X-Auth-Token: myauth-token' \ ---header 'X-User-Id: myuser-name' -``` - -## Result - -```javascript -{ - "items": [ - { - "_id": "kZqHZAzCgGCnHhzny", - "username": "guest-446", - "name": "ASM.Purchasing.Software Sourcing", - "custom_name": "guest-446 - ASM.Purchasing.Software Sourcing" - }, - { - "_id": "aN2CtBZdbPytsvpqj", - "username": "guest-143", - "name": "testing", - "custom_name": "guest-143 - testing" - }, - { - "_id": "AW4NYEKLgpezDwx5b", - "username": "guest-189", - "name": "testtt", - "custom_name": "guest-189 - testtt" - }, - { - "_id": "KhFxJyLawdeM47sSy", - "username": "guest-529", - "name": "user-one", - "custom_name": "guest-529 - user-one" - }, - { - "_id": "YeX9qdMqXLqQi3irt", - "username": "guest-526", - "name": "user-two", - "custom_name": "guest-526 - user-two" - }, - { - "_id": "5EHZy4m3KtSKPHFdD", - "username": "guest-8", - "name": "vinicius", - "custom_name": "guest-8 - vinicius" - } - ], - "success": true -``` - diff --git a/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-visitors-1/visitor-info-by-id.md b/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-visitors-1/visitor-info-by-id.md deleted file mode 100644 index 310cbaf6e..000000000 --- a/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-visitors-1/visitor-info-by-id.md +++ /dev/null @@ -1,60 +0,0 @@ ---- -description: Retrieves visitor info by ID ---- - -# Visitor info by ID - -| URL | Requires Auth | HTTP Method | -| :--- | :--- | :--- | -| `api/v1/livechat/visitors.info` | `YES` | `GET` | - -## Headers - -| Argument | Example | Required | Description | -| :--- | :--- | :--- | :--- | -| `X-User-Id` | `myuser-name` | Required | Your username hash \(returned after you log in through the API\) | -| `X-Auth-Token` | `myauth-token` | Required | Your token \(returned after you log in through the API\) | - -## Parameters - -| Argument | Example | Required | Description | -| :--- | :--- | :--- | :--- | -| visitorId | `yAivGTq4FcsjpvsdB` | Required | Livechat visitor id | - -## Example Call - -```bash -curl --location --request GET 'http://localhost:3000/api/v1/livechat/visitors.info?visitorId=yAivGTq4FcsjpvsdB \ ---header 'X-Auth-Token: myauth-token' \ ---header 'X-User-Id: myuser-name' -``` - -## Result - -```javascript -{ - "visitor": { - "_id": "yAivGTq4FcsjpvsdB", - "username": "guest-536", - "ts": "2021-07-22T14:42:34.076Z", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36", - "ip": "72.255.57.255", - "host": "multiverse.rocket.chat", - "_updatedAt": "2021-07-22T14:42:40.271Z", - "department": "CAJioQNAvLnYWTy8i", - "name": "low", - "token": "io5srgou19520h67ex4i2", - "visitorEmails": [ - { - "address": "low@gmail.com" - } - ], - "lastChat": { - "_id": "myPNwjZr4z27Mi7qW", - "ts": "2021-07-22T14:42:40.271Z" - } - }, - "success": true -} -``` - diff --git a/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-visitors-1/get-livechat-visitors-chat-history.md b/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/get-livechat-visitors-chat-history.md similarity index 72% rename from reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-visitors-1/get-livechat-visitors-chat-history.md rename to reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/get-livechat-visitors-chat-history.md index 9363c8bf9..5bea46b07 100644 --- a/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-visitors-1/get-livechat-visitors-chat-history.md +++ b/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/get-livechat-visitors-chat-history.md @@ -1,38 +1,30 @@ ---- -description: Get livechat visitor's chat history ---- +# Get Livechat Visitor Chat History -# Get livechat visitor's chat history +Get the Livechat history of a visitor. -| URL | Requires Auth | HTTP Method | -| :--- | :--- | :--- | -| `api/v1/livechat/visitors.chatHistory/room/:roomId/visitor/:visitorId` | `YES` | `GET` | +
HTTP MethodURLRequires Auth
GET/api/v1/livechat/visitors.chatHistory/room/:roomId/visitor/:visitorIdyes
-## Headers +## Query Parameters -| Argument | Example | Required | Description | -| :--- | :--- | :--- | :--- | -| `X-User-Id` | `myuser-name` | Required | Your username hash \(returned after you log in through the API\) | -| `X-Auth-Token` | `myauth-token` | Required | Your token \(returned after you log in through the API\) | +This endpoint supports the [#pagination](../../../../#pagination "mention")query parameters. -## URL Parameters +## Path Variables -| Argument | Example | Required | Description | -| :--- | :--- | :--- | :--- | -| `roomId` | `hhMKhHnnbY79mGs9K` | Required | Livechat room id | -| `visitorId` | `QyBAKC5Wc8tcv6cco` | Required | Livechat visitor id | +
KeyExample ValueDescription
roomId*hhMKhHnnbY79mGs9KLivechat room ID.
visitorId*QyBAKC5Wc8tcv6ccoLivechat visitor ID.
## Example Call -```bash +{% code overflow="wrap" %} +```powershell curl --location --request GET 'http://localhost:3000/api/v1/livechat/visitors.chatHistory/room/:roomId/visitor/:visitorId \ --header 'X-Auth-Token: myauth-token' \ --header 'X-User-Id: myuser-name' ``` +{% endcode %} -## Result +## Example Response -```javascript +```json { "history": [ { @@ -114,4 +106,3 @@ curl --location --request GET 'http://localhost:3000/api/v1/livechat/visitors.ch "success": true } ``` - diff --git a/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/get-pages-visited-by-livechat-visitor.md b/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/get-pages-visited-by-livechat-visitor.md new file mode 100644 index 000000000..6f19e0f51 --- /dev/null +++ b/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/get-pages-visited-by-livechat-visitor.md @@ -0,0 +1,57 @@ +# Get Pages Visited by Livechat Visitor + +
HTTP MethodURLRequires Auth
GET/api/v1/livechat/visitors.pagesVisited/:roomIdyes
+ +## Path Variables + +
KeyExample ValueDescription
roomId*hhMKhHnnbY79mGs9KLivechat room ID.
+ +## Example Call + +{% code overflow="wrap" %} +```powershell +curl --location 'http://localhost:3000/api/v1/livechat/visitors.pagesVisited/MmGnqizEa8pvc9LRg' \ +--header 'X-Auth-Token: Y97tM4GkYjgaH_fIO5dwBitQQvm3yp-AptYzGQZMX6e' \ +--header 'X-User-Id: CkCPNcvsvCDfmWLqC' +``` +{% endcode %} + +## Example Response + +{% code overflow="wrap" %} +```json +{ + "pages": [ + { + "_id": "6523fbf5a2f73c7460e18d60", + "t": "livechat_navigation_history", + "ts": "2023-10-09T13:11:17.968Z", + "msg": "Document - https://s3.amazonaws.com/uploads.use1.cloud.rocket.cht.html%22", + "u": { + "_id": "rocket.cat", + "username": "rocket.cat", + "name": "Rocket.Cat" + }, + "groupable": false, + "navigation": { + "page": { + "change": "url", + "title": "Document", + "location": { + "href": "https://s3.amazonaws.com/uploads.use1.cloud.rocket.cht.html%22" + } + }, + "token": "54fc5544030bcecda053311cb6b98920bdf953f242c12" + }, + "expireAt": 1699449077968, + "_updatedAt": "2023-10-09T13:12:00.608Z", + "rid": "MmGnqizEa8pvc9LRg" + } + ], + "count": 1, + "offset": 0, + "total": 1, + "success": true +} +``` +{% endcode %} diff --git a/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/get-the-visitor-info.md b/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/get-the-visitor-info.md index 295afff7b..84da6d594 100644 --- a/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/get-the-visitor-info.md +++ b/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/get-the-visitor-info.md @@ -1,4 +1,4 @@ -# Get Visitor Information +# Get Visitor Information by ID Get the information of a specific visitor. @@ -6,14 +6,14 @@ Get the information of a specific visitor. ## Query Parameters -
KeyExample ValueDescription
visitorId*642fc15452492a08c3a756deThe visitor's id.
+
KeyExample ValueDescription
visitorId*642fc15452492a08c3a756deThe visitor's ID.
## Example Call {% code overflow="wrap" %} ```powershell curl --location 'http://localhost:3000/api/v1/livechat/visitors.info?visitorId=642fc15452492a08c3a756de' \ ---header 'X-Auth-Token: Y97tM4GkYjgaH_fIO5dwBitQQvm3yp-AptYzGQZMX6e' \ +--header 'X-Auth-Token: Y97tM4GkYjgaH_fIO5dwB' \ --header 'X-User-Id: CkCPNcvsvCDfmWLqC' ``` {% endcode %} diff --git a/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/retrieve-a-visitor-data.md b/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/retrieve-a-visitor-data.md index 6a2e482eb..d501094d0 100644 --- a/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/retrieve-a-visitor-data.md +++ b/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/retrieve-a-visitor-data.md @@ -1,4 +1,4 @@ -# Get Visitor Data +# Get Visitor Information Get the details of a specific visitor. @@ -6,7 +6,7 @@ Get the details of a specific visitor. ## Path Variables -
KeyExample ValueDescription
token *iNKE8a6k6cjbqWhWdThe visitor token.
+
KeyExample ValueDescription
token*iNKE8a6k6cjbqWhWdThe visitor token.
## Example Call diff --git a/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/search-a-visitors-chat.md b/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/search-a-visitors-chat.md new file mode 100644 index 000000000..25e69a03f --- /dev/null +++ b/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/search-a-visitors-chat.md @@ -0,0 +1,45 @@ +# Search Visitor Chat + +Get the Livechat information of a visitor. This endpoint returns only those chats that are served and closed. + +
HTTP MethodURLRequires Auth
GET/api/v1/livechat/visitors.searchChats/room/:roomId/visitor/:visitorIdyes
+ +## Path Variables + +
KeyExample ValueDescription
roomId*hhMKhHnnbY79mGs9KLivechat room ID.
visitorId*QyBAKC5Wc8tcv6ccoLivechat visitor ID.
+ +## Example Call + +{% code overflow="wrap" %} +```powershell +curl --location --request GET 'http://localhost:3000/api/v1/livechat/visitors.searchChats/room/:roomId/visitor/:visitorId\ +--header 'X-Auth-Token: myauth-token' \ +--header 'X-User-Id: myuser-name' +``` +{% endcode %} + +## Example Response + +```json +{ + "history": [ + { + "_id": "hhMKhHnnbY79mGs9K", + "msgs": 2, + "fname": "Maria", + "ts": "2021-07-22T17:17:04.216Z", + "v": { + "_id": "QyBAKC5Wc8tcv6cco", + "username": "guest-537", + "token": "8s7e9ony6ctl27e1qf8kue", + "status": "online", + "lastMessageTs": "2021-07-22T17:17:04.937Z" + } + } + ], + "count": 1, + "offset": 0, + "total": 1, + "success": true +} +``` diff --git a/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/search-for-visitors.md b/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/search-for-visitors.md deleted file mode 100644 index 35b8e9810..000000000 --- a/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/search-for-visitors.md +++ /dev/null @@ -1,49 +0,0 @@ -# Search for Visitors - -Search for visitors using the name, user name, email, or phone. - -
HTTP MethodURLRequires Auth
GET/api/v1/livechat/visitors.searchyes
- -## Query Parameters - -It supports the [#pagination](../../../../#pagination "mention") parameters. - -
KeyExample ValueDescription
termguest-1@company.comThe visitor's name, username, email, or phone.
- -## Example Call - -{% code overflow="wrap" %} -```powershell -curl http://localhost:3000/api/v1/livechat/visitors.search?term=guest-1@company.com ---header 'X-Auth-Token: Y97tM4GkYjgaH_fIO5dwBitQQvm3yp-AptYzGQZMX6e' \ ---header 'X-User-Id: CkCPNcvsvCDfmWLqC' -``` -{% endcode %} - -## Example Response - -```json -{ - "visitors": [ - { - "_id": "KQv3cHgvW7CDQtGap", - "username": "guest-1", - "visitorEmails": [ - { - "address": "guest-1@company.com" - } - ], - "phone": [ - { - "phoneNumber": "912235665456" - } - ], - "name": "joey" - } - ], - "count": 1, - "offset": 0, - "total": 1, - "success": true -} -``` diff --git a/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-visitors-1/search-visitors-by-term.md b/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/search-visitors-by-term.md similarity index 52% rename from reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-visitors-1/search-visitors-by-term.md rename to reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/search-visitors-by-term.md index d31b05c63..b2f130c34 100644 --- a/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-visitors-1/search-visitors-by-term.md +++ b/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/search-visitors-by-term.md @@ -1,39 +1,26 @@ -# Search Visitors by term +# Search Visitors by Term -Search Omnichannel visitors using a term. +Search Livechat visitors using a specific term. -{% hint style="info" %} -You are required to have the `view-l-room` permission. -{% endhint %} +
HTTP MethodURLRequires Auth
GET/api/v1/livechat/visitors.searchyes
-| URL | Requires Auth | HTTP Method | -| --------------------------------- | ------------- | ----------- | -| `api/v1/livechat/visitors.search` | `YES` | `GET` | +## Query Parameters -## Headers +This endpoint supports the optional [#pagination](../../../../#pagination "mention")query parameters and the additional required parameter as follows: -| Argument | Example | Required | Description | -| -------------- | -------------- | -------- | -------------------------------------------------------------- | -| `X-User-Id` | `myuser-name` | Required | Your username hash (returned after you log in through the API) | -| `X-Auth-Token` | `myauth-token` | Required | Your token (returned after you log in through the API) | - -## Parameters - -| Argument | Example | Required | Description | -| -------- | ------- | -------- | ----------- | -| `term` | `James` | Required | Search Term | +
KeyExample ValueDescription
term*JamesThe visitor's name, username, email, or phone.
## Example Call -```bash +```powershell curl --location 'http://localhost:3000/api/v1/livechat/visitors.search?term=James' \ --header 'X-Auth-Token: EZmA1YMbEfghEPOmc03k0R9QiuVvKWjQClKVoF8x7LY' \ --header 'X-User-Id: rYhzFRd2QZjNwAAXX' ``` -## Result +## Example Response -```javascript +```json { "visitors": [ { diff --git a/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/visitor-autocomplete.md b/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/visitor-autocomplete.md new file mode 100644 index 000000000..8fd901520 --- /dev/null +++ b/reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/visitor/visitor-autocomplete.md @@ -0,0 +1,35 @@ +# Visitor Autocomplete + +Autocomplete a visitor's name. + +
HTTP MethodURLRequires Auth
GET/api/v1/livechat/visitors.autocompleteyes
+ +## Query Parameters + +
KeyExample ValueDescription
selector*{ "exceptions" : [], "conditions" : {"username": "guest-5"}}Enter the exceptions or the conditions that you want to search for.
+ +## Example Call + +{% code overflow="wrap" %} +```powershell +curl --location --request GET 'http://localhost:3000/api/v1/livechat/visitors.autocomplete?selector={%20%22exceptions%22%3A%20[{}]%2C%20%22conditions%22%3A%20{%22username%22%3A%20%22guest-5%22}%20}' \ +--header 'X-Auth-Token: Y97tM4GkYjgaH_fIO5d' \ +--header 'X-User-Id: CkCPNcvsvCDfmWLqC' +``` +{% endcode %} + +## Example Response + +```json +{ + "items": [ + { + "_id": "6400be90fa0ed7dd90509300", + "username": "guest-5", + "name": "Jane", + "custom_name": "guest-5 - An agent" + } + ], + "success": true +} +```