Skip to content
This repository has been archived by the owner on Mar 17, 2023. It is now read-only.

[NEW] [PR- RocketChat/Rocket.Chat#18514] update Livechat Rest API docs #1774

Merged
merged 5 commits into from
Aug 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api/rest-api/methods/livechat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Manage Livechat related data:
| `/api/v1/livechat/visitor` | `POST` | Register a new Livechat visitor. | [info](visitor.md) |
| `/api/v1/livechat/visitor/:token` | `GET` | Retrieve a visitor data. | [info](visitor.md) |
| `/api/v1/livechat/visitors.info` | `GET` | Retrieve a visitor info. | [info](visitor.md) |
| `/api/v1/livechat/visitors.search` | `GET` | Search for Visitors. | [info](visitor.md#search-for-visitors) |
| `/api/v1/livechat/page.visited` | `POST` | Send visitor navigation history to Rocket.Chat. | [info](visitor.md#send-visitor-navigation-history) |
| `/api/v1/livechat/appearance` | `GET` | Get the settings about Livechat Widget Appearance. | [info](appearance.md) |
| `/api/v1/livechat/visitors.pagesVisited` | `GET` | Gets the visitor navigation history. | [info](visitor.md#get-the-visitor-navigation-history) |
Expand Down
54 changes: 54 additions & 0 deletions api/rest-api/methods/livechat/visitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,3 +341,57 @@ curl http://localhost:3000/api/v1/livechat/visitors.chatHistory/room/room-id/vis
| :--- | :--- |
| 2.4.0 | Added |

## Search for Visitors

Search for a Visitor using their name, username, email or phone. It supports the [Offset, Count, and Sort Query Parameters](../../offset-and-count-and-sort-info.md).

| URL | Requires Auth | HTTP Method |
| :--- | :--- | :--- |
| `/api/v1/livechat/visitors.search` | `yes` | `GET` |

## Query Parameter

| Argument | Example | Required | Description |
| :--- | :--- | :--- | :--- |
| `term` | `guest-1@company.com` | Optional | The visitor's name, username, email or phone |

## Example Call

```bash
curl http://localhost:3000/api/v1/livechat/visitors.search?term=guest-1@company.com
```

## Example Result

```javascript
{
"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
}
```

## Change Log

| Version | Description |
| :--- | :--- |
| 3.6.0 | Added |