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

Commit

Permalink
[NEW] Docs to Rest livechat inquiries endpoints (#1335)
Browse files Browse the repository at this point in the history
* Docs to Rest livechat inquiries endpoints

* Fix inquiries docs

* Update inquiries docs

* Remove extra blank line
  • Loading branch information
MarcosSpessatto authored and MartinSchoeler committed Jun 12, 2019
1 parent 6d2e883 commit 6fff83a
Show file tree
Hide file tree
Showing 6 changed files with 131 additions and 0 deletions.
2 changes: 2 additions & 0 deletions _data/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,8 @@
- config
- custom-fields
- department
- inquiries.list
- inquiries.take
- message
- room
- sms-incoming
Expand Down
2 changes: 2 additions & 0 deletions contributing/documentation/documentation-map/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,8 @@ Here you can also find what articles are incomplete and missing.
- config
- custom-fields
- department
- inquiries.list
- inquiries.take
- message
- room
- sms-incoming
Expand Down
7 changes: 7 additions & 0 deletions developer-guides/rest-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,13 @@ When calling a production Rocket.Chat server, ensure it is running via HTTPS and
| `/api/v1/integrations.list` | Lists all of the integrations. | [Link](integration/list/) |
| `/api/v1/integrations.remove` | Removes an integration. | [Link](integration/remove/) |

### Livechat

| Url | Short Description | Details Page |
| :------------------------------- | :------------------------------------------------------------ | :------------------------------- |
| `/api/v1/livechat/inquiries.list`| Retrieves a list of open inquiries. | [Link](livechat/inquiries-list/) |
| `/api/v1/livechat/inquiries.take`| Take an open inquiry. | [Link](livechat/inquiries-take/) |

### Permissions

| Url | Short Description | Details Page |
Expand Down
2 changes: 2 additions & 0 deletions developer-guides/rest-api/livechat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ 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/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: 56 additions & 0 deletions developer-guides/rest-api/livechat/inquiries-list/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# 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 |
62 changes: 62 additions & 0 deletions developer-guides/rest-api/livechat/inquiries-take/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# 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 |

0 comments on commit 6fff83a

Please sign in to comment.