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

[NEW] Added docs for livechat.inquiries.getOne and changed inquiries folder #1539

Merged
merged 4 commits into from
Dec 23, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Added docs for livechat.inquiries.getOne and changed inquiries folder
  • Loading branch information
MarcosSpessatto committed Dec 13, 2019
commit 63174095dd0d483ad5381cd2c21b8764792f1bf8
3 changes: 1 addition & 2 deletions _data/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,7 @@
- config
- custom-fields
- department
- inquiries.list
- inquiries.take
- inquiries
- message
- room
- rooms
Expand Down
3 changes: 1 addition & 2 deletions contributing/documentation/documentation-map/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,7 @@ Here you can also find what articles are incomplete and missing.
- config
- custom-fields
- department
- inquiries.list
- inquiries.take
- inquiries
- message
- room
- rooms
Expand Down
5 changes: 3 additions & 2 deletions developer-guides/rest-api/livechat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ Manage Livechat related data:
| `/api/v1/livechat/department/:_id` | `GET` | Retrieve a Livechat department data. | [info](department/index.html#get-info-about-a-department) |
| `/api/v1/livechat/department/:_id` | `PUT` | Updates a Livechat department data. | [info](department/index.html#update-a-department) |
| `/api/v1/livechat/department/:_id` | `DELETE` | Delete a Livechat department. | [info](department/index.html#removes-a-department) |
| `/api/v1/livechat/inquiries.list` | `GET` | Retrieves a list of open inquiries. | [info](inquiries-list/) |
| `/api/v1/livechat/inquiries.take` | `POST` | Take an open inquiry. | [info](inquiries-take/) |
| `/api/v1/livechat/inquiries.list` | `GET` | Retrieves a list of open inquiries. | [info](inquiries/) |
| `/api/v1/livechat/inquiries.take` | `POST` | Take an open inquiry. | [info](inquiries/#livechat-take-inquiry) |
| `/api/v1/livechat/inquiries.getOne` | `GET` | Get one inquiry by room id. | [info](inquiries/#livechat-get-one-inquiry-by-room-id) |
| `/api/v1/livechat/sms-incoming/:service` | `POST` | Send SMS messages to Rocket.Chat. | [info](sms-incoming/) |
| `/api/v1/livechat/agent.info/:rid/:token` | `GET` | Retrieve the current Livechat agent data. | [info](agent/index.html) |
| `/api/v1/livechat/agent.next/:token` | `GET` | Request the next Livechat agent available. | [info](agent/index.html#request-the-next-livechat-agent-available) |
Expand Down
56 changes: 0 additions & 56 deletions developer-guides/rest-api/livechat/inquiries-list/README.md

This file was deleted.

62 changes: 0 additions & 62 deletions developer-guides/rest-api/livechat/inquiries-take/README.md

This file was deleted.

178 changes: 178 additions & 0 deletions developer-guides/rest-api/livechat/inquiries/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
# Inquiries List

Lists all of the open livechat inquiries. It supports the [Offset, Count, and Sort Query Parameters](../../offset-and-count-and-sort-info/).

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

## Query Parameters

| Argument | Example | Required | Description |
| :--- | :--- | :--- | :--- |
| `department` | `ByehQjC44FwMeiLbX` | Optional | The department's id or name |

## Example Call

```bash
curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
-H "X-User-Id: aobEdbYhXfu5hkeqG" \
http://localhost:3000/api/v1/livechat/inquiries.list
```

## Example Result

```json
{
"inquiries": [
{
"_id": "GpxfRo8TaPHfsnnC5",
"rid": "EbQjtCosHJWLQmQYT",
"name": "Marcos Defendi",
"ts": "2019-06-11T19:01:57.424Z",
"department": "jHFgdJyJWstB9M2ik",
"status": "open"
},
{
"_id": "9dCi64GkwWE389xCm",
"rid": "ZpjCcbRwPPdnhKWW5",
"name": "Marcos Defendi",
"ts": "2019-06-11T19:00:43.124Z",
"department": "gDDAjeJb7BhHzzEQ8",
"status": "open"
}
],
"offset": 0,
"count": 1,
"total": 1,
"success": true
}
```

## Change Log

| Version | Description |
| :--- | :--- |
| 1.2.0 | Added |

## Livechat take inquiry

Takes an open inquiry.

| URL | Requires Auth | HTTP Method |
| :--- | :--- | :--- |
| `/api/v1/livechat/inquiries.take` | `yes` | `POST` |

## Payload

| Argument | Example | Required | Description |
| :--- | :--- | :--- | :--- |
| `inquiryId` | `ByehQjC44FwMeiLbX` | Required | The inquiry's id |
| `userId` | `ByehQjCfsd876sfd` | Optional | The user's (agent) id to take the inquiry. |

<br>

**Note: if the user id is provided, the user must have the `view-l-room` permission.**

## Example Call

```bash
curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
-H "X-User-Id: aobEdbYhXfu5hkeqG" \
-H "Content-type: application/json" \
http://localhost:3000/api/v1/livechat/inquiries.take \
-d '{ "inquiryId": "ByehQjC44FwMeiLbX" }'
```

## Example Result

```json
{
"inquiry": {
"_id": "wbKmn6pAZ8jyJuANG",
"rid": "S4wwL9WNY98uoHgJg",
"message": "test",
"name": "teste",
"ts": "2019-06-10T23:09:06.482Z",
"agents": [
"hjwGZafNqExtFNmN7",
"26KdXgrQXhddy2MfQ"
],
"status": "open",
"v": {
"_id": "2iZSexGXjW7EJnRwM",
"username": "guest-3",
"token": "RtQzkfQYKG4WpNMEW",
"status": "online"
},
"t": "l",
"_updatedAt": "2019-06-10T23:09:07.480Z"
},
"success": true
}
```

## Change Log

| Version | Description |
| :--- | :--- |
| 1.2.0 | Added |


## Livechat Get one inquiry by room id

Get one inquiry by room id.

| URL | Requires Auth | HTTP Method |
| :--- | :--- | :--- |
| `/api/v1/livechat/inquiries.getOne` | `yes` | `POST` |

## Query Parameters

| Argument | Example | Required | Description |
| :--- | :--- | :--- | :--- |
| `roomId` | `ByehQjC44FwMeiLbX` | Required | The room's id |

<br>

**Note: if the user id is provided, the user must have the `view-l-room` permission.**

## Example Call

```bash
curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
-H "X-User-Id: aobEdbYhXfu5hkeqG" \
-H "Content-type: application/json" \
http://localhost:3000/api/v1/livechat/inquiries.getOne?roomId=ByehQjC44FwMeiLbX
```

## Example Result

```json
{
"inquiry": {
"_id": "EMXtMA7mPPNkQtWWq",
"rid": "MA6HRhkEdRGATfEbh",
"name": "inquiry test",
"ts": "2019-12-13T18:54:25.352Z",
"message": "",
"status": "queued",
"v": {
"_id": "rLitbjv7e9WyLBCR4",
"username": "guest-14",
"token": "btzu0qdm0sjsn7aqm78kzr",
"status": "offline"
},
"t": "l",
"_updatedAt": "2019-12-13T19:33:13.255Z"
},
"success": true
}
```

## Change Log

| Version | Description |
| :--- | :--- |
| 3.0.0 | Added |