Skip to content

Commit fd06b11

Browse files
Marcos Spessatto Defendisampaiodiego
authored andcommitted
Added docs for livechat/triggers endpoint (RocketChat#1430)
1 parent b62c300 commit fd06b11

File tree

4 files changed

+116
-0
lines changed

4 files changed

+116
-0
lines changed

_data/toc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,7 @@
405405
- room
406406
- rooms
407407
- sms-incoming
408+
- triggers
408409
- users
409410
- video-call
410411
- visitor

contributing/documentation/documentation-map/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@ Here you can also find what articles are incomplete and missing.
400400
- room
401401
- rooms
402402
- sms-incoming
403+
- triggers
403404
- users
404405
- video-call
405406
- Miscellaneous:

developer-guides/rest-api/livechat/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ Manage Livechat related data:
3333
| `/api/v1/livechat/room.forward` | `POST` | Allow Livechat Agents to forward a Livechat room to another agent, department or return it back to the Queue. | [info](room/index.html#forward-livechat-room) |
3434
| `/api/v1/livechat/room.survey` | `POST` | Send a Livechat survey to Rocket.Chat. | [info](room/index.html#send-the-livechat-survey) |
3535
| `/api/v1/livechat/transcript` | `POST` | Request a Livechat transcript. | [info](transcript/) |
36+
| `/api/v1/livechat/triggers` | `GET` | Get the Livechat triggers. | [info](triggers/) |
37+
| `/api/v1/livechat/triggers/:_id` | `GET` | Get a Livechat trigger. | [info](triggers/) |
3638
| `/api/v1/livechat/video.call/:token` | `GET` | Request a new video call room. | [info](video-call/) |
3739
| `/api/v1/livechat/visitor` | `POST` | Register a new Livechat visitor. | [info](visitor/index.html) |
3840
| `/api/v1/livechat/visitor/:token` | `GET` | Retrieve a visitor data. | [info](visitor/index.html) |
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# Livechat Triggers
2+
3+
## Get the Livechat Triggers
4+
5+
Lists all Livechat triggers. It supports the [Offset, Count, and Sort Query Parameters](../../offset-and-count-and-sort-info/).
6+
7+
| URL | Requires Auth | HTTP Method |
8+
| :----------------------------------- | :------------ | :---------- |
9+
| `/api/v1/livechat/triggers` | `yes` | `GET` |
10+
11+
## Example Call
12+
13+
```bash
14+
curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
15+
-H "X-User-Id: aobEdbYhXfu5hkeqG" \
16+
http://localhost:3000/api/v1/livechat/triggers
17+
```
18+
19+
## Example Result
20+
21+
```json
22+
{
23+
"triggers": [
24+
{
25+
"_id": "Lk52shJFYyb55trw8",
26+
"name": "test",
27+
"description": "test",
28+
"enabled": true,
29+
"runOnce": true,
30+
"conditions": [
31+
{
32+
"name": "page-url",
33+
"value": ""
34+
}
35+
],
36+
"actions": [
37+
{
38+
"name": "send-message",
39+
"params": {
40+
"sender": "",
41+
"msg": ""
42+
}
43+
}
44+
],
45+
"_updatedAt": "2019-10-04T15:36:29.695Z"
46+
}
47+
],
48+
"count": 1,
49+
"offset": 0,
50+
"total": 1,
51+
"success": true
52+
}
53+
```
54+
55+
## Change Log
56+
57+
| Version | Description |
58+
| :------ | :---------- |
59+
| 2.2.0 | Added |
60+
61+
## Get a Livechat Trigger
62+
63+
Get a Livechat Trigger by id.
64+
65+
| URL | Requires Auth | HTTP Method |
66+
| :----------------------------------- | :------------ | :---------- |
67+
| `/api/v1/livechat/triggers/:_id` | `yes` | `GET` |
68+
69+
## Example Call
70+
71+
```bash
72+
curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
73+
-H "X-User-Id: aobEdbYhXfu5hkeqG" \
74+
http://localhost:3000/api/v1/livechat/triggers/Lk52shJFYyb55trw8
75+
```
76+
77+
## Example Result
78+
79+
```json
80+
{
81+
"trigger": {
82+
"_id": "Lk52shJFYyb55trw8",
83+
"name": "test",
84+
"description": "test",
85+
"enabled": true,
86+
"runOnce": true,
87+
"conditions": [
88+
{
89+
"name": "page-url",
90+
"value": ""
91+
}
92+
],
93+
"actions": [
94+
{
95+
"name": "send-message",
96+
"params": {
97+
"sender": "",
98+
"msg": ""
99+
}
100+
}
101+
],
102+
"_updatedAt": "2019-10-04T15:36:29.695Z"
103+
},
104+
"success": true
105+
}
106+
```
107+
108+
## Change Log
109+
110+
| Version | Description |
111+
| :------ | :---------- |
112+
| 2.2.0 | Added |

0 commit comments

Comments
 (0)