77 lines
2.2 KiB
JSON
77 lines
2.2 KiB
JSON
{
|
|
"type": "slack",
|
|
"version": 1,
|
|
"displayName": "Slack",
|
|
"description": "Post messages and manage Slack resources through the Web API",
|
|
"kind": "action",
|
|
"categories": ["Communication"],
|
|
"icon": "node:slack",
|
|
"iconColor": "#4A154B",
|
|
"inputs": [{ "kind": "main" }],
|
|
"outputs": [
|
|
{ "kind": "main" },
|
|
{ "kind": "error", "label": "error" }
|
|
],
|
|
"runMode": "eachItem",
|
|
"origin": "connector",
|
|
"documentationUrl": "https://api.slack.com/methods/chat.postMessage",
|
|
"connector": {
|
|
"baseUrl": "https://slack.com",
|
|
"path": "/api/{operation}",
|
|
"method": "POST",
|
|
"contentType": "json",
|
|
"bodyParameter": "body",
|
|
"credentialAlias": "slack",
|
|
"successPath": "ok",
|
|
"errorPath": "error",
|
|
"errorDetailsPath": "needed",
|
|
"errorCodeMap": {
|
|
"paid_teams_only": "slack_plan_required",
|
|
"ratelimited": "slack_rate_limited",
|
|
"rate_limited": "slack_rate_limited",
|
|
"missing_scope": "slack_missing_scope",
|
|
"not_allowed_token_type": "slack_user_token_required",
|
|
"invalid_action_token": "slack_user_token_required",
|
|
"not_admin": "slack_admin_required"
|
|
}
|
|
},
|
|
"parameters": [
|
|
{
|
|
"name": "operation",
|
|
"displayName": "Operation",
|
|
"type": "options",
|
|
"default": "chat.postMessage",
|
|
"noDataExpression": true,
|
|
"options": [
|
|
{ "name": "Post Message", "value": "chat.postMessage" }
|
|
]
|
|
},
|
|
{
|
|
"name": "credential",
|
|
"displayName": "Credential",
|
|
"type": "resourceLocator",
|
|
"loadOptionsMethod": "listCredentials",
|
|
"default": ""
|
|
},
|
|
{
|
|
"name": "body",
|
|
"displayName": "Body",
|
|
"type": "json",
|
|
"default": {},
|
|
"description": "Slack method payload, e.g. { \"channel\": \"C012345\", \"text\": \"hi\" }"
|
|
},
|
|
{
|
|
"name": "options",
|
|
"displayName": "Options",
|
|
"type": "collection",
|
|
"fields": [
|
|
{ "name": "neverError", "displayName": "Never error on API failure", "type": "boolean", "default": false },
|
|
{ "name": "timeoutMs", "displayName": "Timeout (ms)", "type": "number", "default": 30000 }
|
|
]
|
|
}
|
|
],
|
|
"credentials": [
|
|
{ "alias": "slack", "displayName": "Slack", "required": true }
|
|
]
|
|
}
|