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

Docs for integrations get one endpoint #1520

Merged
merged 5 commits into from
Dec 23, 2019
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 _data/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@
- setTopic
- Integration:
- create
- get
- history
- list
- remove
Expand Down
1 change: 1 addition & 0 deletions contributing/documentation/documentation-map/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ Here you can also find what articles are incomplete and missing.
- setTopic
- Integration:
- create
- get
- history
- list
- remove
Expand Down
1 change: 1 addition & 0 deletions developer-guides/rest-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ When calling a production Rocket.Chat server, ensure it is running via HTTPS and
| Url | Short Description | Details Page |
| :----------------------------- | :------------------------------------------------------------ | :-------------------------- |
| `/api/v1/integrations.create` | Creates an integration. | [Link](integration/create/) |
| `/api/v1/integrations.get` | Gets an integration. | [Link](integration/get/) |
| `/api/v1/integrations.history` | Lists all history of the specified integration. | [Link](integration/history/)|
| `/api/v1/integrations.list` | Lists all of the integrations. | [Link](integration/list/) |
| `/api/v1/integrations.remove` | Removes an integration. | [Link](integration/remove/) |
Expand Down
1 change: 1 addition & 0 deletions developer-guides/rest-api/integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
| Url | Short Description | Details Page |
| :--- | :--- | :--- |
| `/api/v1/integrations.create` | Creates an integration. | [Link](create/) |
| `/api/v1/integrations.get` | Gets an integration. | [Link](get/) |
| `/api/v1/integrations.history` | Lists all history of the specified integration. | [Link](history/) |
| `/api/v1/integrations.list` | Lists all of the integrations. | [Link](list/) |
| `/api/v1/integrations.remove` | Removes an integration. | [Link](remove/) |
119 changes: 119 additions & 0 deletions developer-guides/rest-api/integration/get/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# Integrations get one

Retrieves an integration by id.

| URL | Requires Auth | HTTP Method |
| :--- | :--- | :--- |
| `/api/v1/integrations.get` | `yes` | `GET` |

## Query Parameters

| Argument | Example | Required | Description |
| :--- | :--- | :--- | :--- |
| `integrationId` | `ByehQjC44FwMeiLbX` | Required | The integration's id |
| `createdBy` | `fn5u45ui34fvb` | Optional | The user's id who created the integration |

## Example Call

```bash
curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
-H "X-User-Id: aobEdbYhXfu5hkeqG" \
http://localhost:3000/api/v1/integrations.get?integrationId=ByehQjC44FwMeiLbX
```

## Example Result

```json
{
"history": [
{
"_id": "f2sd51f65sd1f65sd1fs",
"type": "outgoing-webhook",
"step": "after-http-call",
"integration": {
"event": "roomJoined",
"enabled": true,
"username": "rocket.cat",
"channel": [
"#general"
],
"name": "testeytyrtyrtyrtyer",
"triggerWords": [
"!webhhok"
],
"urls": [
"http://localhost:3000/admin/integrations/outgoing"
],
},
"event": "roomJoined",
"_createdAt": "2019-11-29T14:15:27.518Z",
"_updatedAt": "2019-11-29T14:15:27.606Z",
"data": {
"token": "xMxa3o95xzJSpbyEjz4Z72LJ",
"bot": false,
"timestamp": "2019-11-29T14:15:27.522Z",
"channel_id": "GENERAL",
"channel_name": "general",
"user_id": "8pdja8tTb2s2XbvkQ",
"user_name": "dsds",
"user": {
"_id": "8pdja8tTb2s2XbvkQ",
"createdAt": "2019-11-29T14:14:36.936Z",
"username": "dsds",
"emails": [
{
"address": "ddsds@d.com",
"verified": false
}
],
"type": "user",
"status": "offline",
"active": true,
"_updatedAt": "2019-11-29T14:15:15.677Z",
"roles": [
"user"
],
"name": "dsdsds",
"requirePasswordChange": true,
"settings": {}
},
"room": {
"_id": "GENERAL",
"ts": "2019-10-17T22:56:31.861Z",
"t": "c",
"name": "general",
"usernames": [],
"msgs": 125,
"usersCount": 45,
"default": true,
"_updatedAt": "2019-11-29T14:13:14.752Z",
"lastMessage": {
"_id": "6CiNGq8FPEYCfceNL",
"rid": "GENERAL",
"msg": "!webhook",
"ts": "2019-11-29T14:13:14.645Z",
"u": {
"_id": "CaevAPDbXN252kyXa",
"username": "marcos.defendi",
"name": "Marcos Defendi"
},
"_updatedAt": "2019-11-29T14:13:14.705Z",
"mentions": [],
"channels": []
},
"lm": "2019-11-29T14:13:14.645Z",
"jitsiTimeout": "2019-10-22T19:20:28.404Z"
}
},
"url": "http://localhost:3000/admin/integrations/outgoing",
}
],
"success": true
}
```

## Change Log

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