diff --git a/developer-guides/rest-api/livechat/README.md b/developer-guides/rest-api/livechat/README.md index 5361ad8308..2643e26ecc 100644 --- a/developer-guides/rest-api/livechat/README.md +++ b/developer-guides/rest-api/livechat/README.md @@ -41,4 +41,5 @@ Manage Livechat related data: | `/api/v1/livechat/visitor/:token` | `GET` | Retrieve a visitor data. | [info](visitor/index.html) | | `/api/v1/livechat/visitors.info` | `GET` | Retrieve a visitor info. | [info](visitor/index.html) | | `/api/v1/livechat/page.visited` | `POST` | Send visitor navigation history to Rocket.Chat. | [info](visitor/index.html#send-visitor-navigation-history) | +| `/api/v1/livechat/visitors.pagesVisited` | `GET` | Gets the visitor navigation history. | [info](visitor/index.html#get-the-visitor-navigation-history) | | `/api/v1/livechat/visitors.chatHistory/room/room-id/visitor/visitor-id` | `GET` | Gets the visitor chat history. | [info](visitor/index.html#get-the-visitor-chat-history) | diff --git a/developer-guides/rest-api/livechat/visitor/README.md b/developer-guides/rest-api/livechat/visitor/README.md index d07e441d8c..04cf44bb14 100644 --- a/developer-guides/rest-api/livechat/visitor/README.md +++ b/developer-guides/rest-api/livechat/visitor/README.md @@ -217,6 +217,66 @@ curl http://localhost:3000/api/v1/livechat/visitors.info?visitorId=iNKE8a6k6cjbq | :------ | :---------- | | 2.3.0 | Added | +## Get the visitor navigation history + +Retrieve the visitor navigation history + +| URL | Requires Auth | HTTP Method | +| :--------------------------------------- | :------------ | :---------- | +| `/api/v1/livechat/visitors.pagesVisited` | `yes` | `GET` | + +## Query Parameter + +| Argument | Example | Required | Description | +| :------- | :------------------ | :------- | :-------------------- | +| `roomId` | `iNKE8a6k6cjbqWhWd` | Required | The room's id. | + +## Example Call + +```bash +curl http://localhost:3000/api/v1/livechat/visitors.pagesVisited?roomId=iNKE8a6k6cjbqWhWd +``` + +## Example Result + +```json +{ + "pages": [ + { + "_id": "7sixPtdqiCcfSRrWJ", + "t": "livechat_navigation_history", + "rid": "wBCg9ZgXT7Mvqz5Xu", + "ts": "2019-10-21T19:51:22.298Z", + "msg": "App test - http://localhost:8601/", + "u": { + "_id": "rocket.cat", + "username": "rocket.cat" + }, + "groupable": false, + "navigation": { + "page": { + "change": "url", + "title": "Test", + "location": { + "href": "http://localhost:8601/" + } + }, + "token": "9vcfr6wb3sllv5t14d9x3" + }, + "_hidden": true, + "_updatedAt": "2019-10-21T19:51:22.298Z" + } + ], + "success": true +} +``` + +## Change Log + +| Version | Description | +| :------ | :---------- | +| 2.3.0 | Added | + ## Get the visitor chat history Retrieve the visitor chat history. It supports the [Offset, Count, and Sort Query Parameters](../../offset-and-count-and-sort-info/). @@ -279,4 +339,4 @@ curl http://localhost:3000/api/v1/livechat/visitors.chatHistory/room/room-id/vis | Version | Description | | :------ | :---------- | -| 2.4.0 | Added | +| 2.4.0 | Added | \ No newline at end of file