Permissions required to create incoming integrations:
manage-incoming-integrations
manage-own-incoming-integrations
Permissions required to create outgoing integrations:
manage-outgoing-integrations
manage-own-outgoing-integrations
Changelog
Version | Description |
---|---|
1.1.0 | Separate permissions in incoming and outgoing. |
0.49.0 | Added |
The authorization token of the user.
The user ID of the user.
{
"type": "webhook-incoming",
"username": "test.cat",
"channel": "#general",
"scriptEnabled": true,
"name": "test.cat",
"enabled": true
}
{
"type": "webhook-outgoing",
"username": "test.cat",
"channel": "#general",
"scriptEnabled": true,
"name": "test.cat",
"enabled": true,
"event": "sendMessage",
"urls": [
"https://text2gif.guggy.com/guggify"
]
}
The type of integration to create. The possible values are:
webhook-incoming
webhook-outgoing
The username to post this the messages as.
The channel, group, or @username. The value can also be all_public_channels
, all_private_groups
, or all_direct_messages
. Comma separated for more than one.
Whether the script should be enabled.
The script that is triggered when this integration is triggered.
The name of the integration.
Whether this integration should be enabled or not.
The alias which should be applied to messages when this integration is processed.
The logo to apply to the messages that this integration sends. For example, http://res.guggy.com/logo_128.png
The emoji which should be displayed as the avatar for messages from this integration.
Required for outgoing integrations.
The type of event can be any of the following:
sendMessage
fileUploaded
roomArchived
roomCreated
roomJoined
roomLeft
userCreated
Required for outgoing integrations.
The urls to call whenever this integration is triggered.
This is an outgoing integration parameter. Specific words, separated by commas, that should trigger this integration.
This is an outgoing integration parameter. If your integration requires a special token from the server (API key), use this parameter.
{
"integration": {
"type": "webhook-incoming",
"username": "test.cat",
"channel": [
"#general"
],
"scriptEnabled": true,
"name": "test.cat",
"enabled": true,
"scriptEngine": "isolated-vm",
"overrideDestinationChannelEnabled": false,
"token": "XuHp73MccmCvJ9m3fKdQK6HKW9tjhBcbTKKHCSSLsv7qn4fk",
"userId": "CkCPNcvsvCDfmWLqC",
"_createdAt": "2024-01-10T14:12:07.739Z",
"_createdBy": {
"_id": "CkCPNcvsvCDfmWLqC",
"username": "test.cat"
},
"_id": "659ea5b72dd9f928ada3e43e"
},
"success": true
}
{
"integration": {
"type": "webhook-outgoing",
"username": "test.cat",
"channel": [
"#general"
],
"scriptEnabled": true,
"name": "test.cat",
"enabled": true,
"event": "sendMessage",
"urls": [
"https://text2gif.guggy.com/guggify"
],
"scriptEngine": "isolated-vm",
"userId": "CkCPNcvsvCDfmWLqC",
"_createdAt": "2024-01-10T14:12:52.201Z",
"_createdBy": {
"_id": "CkCPNcvsvCDfmWLqC",
"username": "test.cat"
},
"_id": "659ea5e42dd9f928ada3e451"
},
"success": true
}
Bad Request
{
"success": false,
"error": "must have required property 'type'\n must have required property 'type'\n must match exactly one schema in oneOf [invalid-params]",
"errorType": "invalid-params"
}
{
"success": false,
"error": "must have required property 'username'\n must have required property 'username'\n must match exactly one schema in oneOf [invalid-params]",
"errorType": "invalid-params"
}
Unauthorized
{
"status": "error",
"message": "You must be logged in to do this."
}