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

Commit

Permalink
Docs for livechat agent departments endpoint (#1433)
Browse files Browse the repository at this point in the history
* Docs for livechat agent departments endpoint

* Remove pagination support

* Fix version

Co-authored-by: Martin Schoeler <martin.schoeler@rocket.chat>
  • Loading branch information
MarcosSpessatto and MartinSchoeler committed Dec 23, 2019
1 parent b285c37 commit 7fad461
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
1 change: 1 addition & 0 deletions developer-guides/rest-api/livechat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Manage Livechat related data:
| `/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) |
| `/api/v1/livechat/agents/:agentId/departments` | `GET` | Get the agent departments. | [info](agent/index.html#get-agent-departments) |
| `/api/v1/livechat/config/:token` | `GET` | Get basic Livechat widget configuration info and additional visitor data. | [info](config/index.html) |
| `/api/v1/livechat/custom.field` | `POST` | Send a Livechat custom field. | [info](custom-fields/index.html#send-a-livechat-custom-field) |
| `/api/v1/livechat/custom.fields` | `POST` | Send an array of Livechat custom fields. | [info](custom-fields/index.html#send-an-array-of-livechat-custom-fields) |
Expand Down
54 changes: 54 additions & 0 deletions developer-guides/rest-api/livechat/agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,57 @@ curl http://localhost:3000/api/v1/livechat/agent.next/iNKE8a6k6cjbqWhWd
| Version | Description |
| :------ | :---------- |
| 0.70.0 | Added |

## Get agent departments.

| URL | Requires Auth | HTTP Method |
| :---------------------------------------------- | :------------ | :---------- |
| `/api/v1/livechat/agents/:agentId/departments` | `yes` | `GET` |

## Url params

| Argument | Example | Required | Description |
| :------- | :-------------------- | :------- | :-------------------- |
| `agentId` | `iNKE8a6k6cjbqWhWd` | Required | The agent Id. |

## Example Call

```bash
curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
-H "X-User-Id: aobEdbYhXfu5hkeqG" \
http://localhost:3000/api/v1/livechat/agents/iNKE8a6k6cjbqWhWd/departments
```

## Example Result

```json
{
"departments": [
{
"_id": "7FKDYAFFQ42tBEizA",
"agentId": "bp9s6p76ocZ9QCkbz",
"departmentId": "KGvTnGdv7jZYWDK5D",
"_updatedAt": "2019-10-01T18:15:38.319Z",
"count": 0,
"order": 0,
"username": "marcos"
},
{
"_id": "hTY4cR3RrkZgZBX4T",
"agentId": "bp9s6p76ocZ9QCkbz",
"departmentId": "E3vjWSY3wNkW3unBo",
"_updatedAt": "2019-10-04T21:46:59.781Z",
"count": 0,
"order": 0,
"username": "marcos"
}
],
"success": true
}
```

## Change Log

| Version | Description |
| :------ | :---------- |
| 2.4.0 | Added |

0 comments on commit 7fad461

Please sign in to comment.