diff --git a/docs/api-generated/connectors/connector-apis-passthru.asciidoc b/docs/api-generated/connectors/connector-apis-passthru.asciidoc
index a478c7eb57512..385807de6a7d4 100644
--- a/docs/api-generated/connectors/connector-apis-passthru.asciidoc
+++ b/docs/api-generated/connectors/connector-apis-passthru.asciidoc
@@ -46,7 +46,9 @@ Any modifications made to this file will be overwritten.
spaceId (required)
-
Path Parameter — An identifier for the space. If /s/
and the identifier are omitted from the path, the default space is used. default: null
+
Path Parameter — An identifier for the space. If /s/
and the identifier are omitted from the path, the default space is used. default: null
id (required)
+
+
Path Parameter — An UUID v1 or v4 identifier for the connector. If you omit this parameter, an identifier is randomly generated. default: null
Consumes
@@ -951,7 +953,8 @@ Any modifications made to this file will be overwritten.
connector_response_properties_servicenow
- Connector response properties for a ServiceNow ITSM connector
connector_response_properties_servicenow_itom
- Connector response properties for a ServiceNow ITOM connector
connector_response_properties_servicenow_sir
- Connector response properties for a ServiceNow SecOps connector
- connector_response_properties_slack
- Connector response properties for a Slack connector
+ connector_response_properties_slack_api
- Connector response properties for a Slack connector
+ connector_response_properties_slack_webhook
- Connector response properties for a Slack connector
connector_response_properties_swimlane
- Connector response properties for a Swimlane connector
connector_response_properties_teams
- Connector response properties for a Microsoft Teams connector
connector_response_properties_tines
- Connector response properties for a Tines connector
@@ -969,7 +972,8 @@ Any modifications made to this file will be overwritten.
create_connector_request_servicenow
- Create ServiceNow ITSM connector request
create_connector_request_servicenow_itom
- Create ServiceNow ITOM connector request
create_connector_request_servicenow_sir
- Create ServiceNow SecOps connector request
- create_connector_request_slack
- Create Slack connector request
+ create_connector_request_slack_api
- Create Slack connector request
+ create_connector_request_slack_webhook
- Create Slack connector request
create_connector_request_swimlane
- Create Swimlane connector request
create_connector_request_teams
- Create Microsoft Teams connector request
create_connector_request_tines
- Create Tines connector request
@@ -1015,6 +1019,8 @@ Any modifications made to this file will be overwritten.
secrets_properties_opsgenie
- Connector secrets properties for an Opsgenie connector
secrets_properties_resilient
- Connector secrets properties for IBM Resilient connector
secrets_properties_servicenow
- Connector secrets properties for ServiceNow ITOM, ServiceNow ITSM, and ServiceNow SecOps connectors
+ secrets_properties_slack_api
- Connector secrets properties for a Web API Slack connector
+ secrets_properties_slack_webhook
- Connector secrets properties for a Webhook Slack connector
secrets_properties_swimlane
- Connector secrets properties for a Swimlane connector
updateConnector_400_response
-
update_connector_request_cases_webhook
- Update Webhook - Case Managment connector request
@@ -1025,6 +1031,8 @@ Any modifications made to this file will be overwritten.
update_connector_request_serverlog
- Update server log connector request
update_connector_request_servicenow
- Update ServiceNow ITSM connector or ServiceNow SecOps request
update_connector_request_servicenow_itom
- Create ServiceNow ITOM connector request
+ update_connector_request_slack_api
- Update Slack connector request
+ update_connector_request_slack_webhook
- Update Slack connector request
update_connector_request_swimlane
- Update Swimlane connector request
@@ -1543,7 +1551,21 @@ Any modifications made to this file will be overwritten.
-
+
+
+
+
connector_type_id
+
+
.slack_api
+
id
String The identifier for the connector.
+
is_deprecated
Boolean Indicates whether the connector type is deprecated.
+
is_missing_secrets (optional)
Boolean Indicates whether secrets are missing for the connector. Secrets configuration properties vary depending on the connector type.
+
is_preconfigured
Boolean Indicates whether it is a preconfigured connector. If true, the
config
and
is_missing_secrets
properties are omitted from the response.
+
name
String The display name for the connector.
+
+
+
+
connector_type_id
@@ -1766,14 +1788,25 @@ Any modifications made to this file will be overwritten.
-
+
+
The Slack connector uses Slack Incoming Webhooks.
+
+
connector_type_id
+
+
.slack_api
+
name
String The display name for the connector.
+
secrets
+
+
+
+
The Slack connector uses Slack Incoming Webhooks.
connector_type_id
.slack
name
String The display name for the connector.
-
secrets
+
secrets
@@ -2220,6 +2253,20 @@ Any modifications made to this file will be overwritten.
username (optional)
String The username for HTTP basic authentication. This property is required when
isOAuth
is
false
.
+
+
+
Defines secrets for connectors when type is .slack
.
+
+
token
String Slack bot user OAuth token.
+
+
+
+
+
Defines secrets for connectors when type is .slack
.
+
+
Defines secrets for connectors when type is .swimlane
.
@@ -2305,6 +2352,22 @@ Any modifications made to this file will be overwritten.
secrets
+
+
+
+
+
name
String The display name for the connector.
+
secrets
+
+
+
+
+
+
+
name
String The display name for the connector.
+
secrets
+
+
diff --git a/docs/management/connectors/action-types/slack.asciidoc b/docs/management/connectors/action-types/slack.asciidoc
index 140ea742692b9..c5db456fc56a6 100644
--- a/docs/management/connectors/action-types/slack.asciidoc
+++ b/docs/management/connectors/action-types/slack.asciidoc
@@ -4,26 +4,29 @@
Slack
++++
-The Slack connector uses https://api.slack.com/incoming-webhooks[Slack Incoming Webhooks].
+The Slack connector uses incoming webhooks or an API method to send Slack messages.
[float]
[[define-slack-ui]]
=== Create connectors in {kib}
-You can create connectors in *{stack-manage-app} > {connectors-ui}*
-or as needed when you're creating a rule. For example:
+You can create connectors in *{stack-manage-app} > {connectors-ui}* or as needed when you're creating a rule.
+You can choose to use a webhook URL that's specific to a single channel. For example:
[role="screenshot"]
-image::management/connectors/images/slack-connector.png[Slack connector]
+image::management/connectors/images/slack-webhook-connector.png[Slack connector]
+// NOTE: This is an autogenerated screenshot. Do not edit it directly.
-[float]
-[[slack-connector-configuration]]
-==== Connector configuration
+Alternatively, you can create a connector that supports multiple channels. For example:
+
+[role="screenshot"]
+image::management/connectors/images/slack-api-connector.png[Slack API connector]
+// NOTE: This is an autogenerated screenshot. Do not edit it directly.
-Slack connectors have the following configuration properties:
+If you use the latter method, you choose your channel when you create a rule action.
+Thus a connector can be used in multiple rules and actions to communicate with different channels.
-Name:: The name of the connector.
-Webhook URL:: The URL of the incoming webhook. See https://api.slack.com/messaging/webhooks#getting_started[Slack Incoming Webhooks] for instructions on generating this URL. If you are using the <
> setting, make sure the hostname is added to the allowed hosts.
+For Slack setup details, go to <>.
[float]
[[preconfigured-slack-configuration]]
@@ -31,21 +34,30 @@ Webhook URL:: The URL of the incoming webhook. See https://api.slack.com/messa
If you are running {kib} on-prem, you can define connectors by
adding `xpack.actions.preconfigured` settings to your `kibana.yml` file.
-For example:
+.Example Slack connector with webhook
[source,text]
--
xpack.actions.preconfigured:
my-slack:
- name: preconfigured-slack-connector-type
+ name: preconfigured-slack-webhook-connector-type
actionTypeId: .slack
secrets:
- webhookUrl: 'https://hooks.slack.com/services/abcd/efgh/ijklmnopqrstuvwxyz'
+ webhookUrl: 'https://hooks.slack.com/services/xxxx/xxxx/xxxx' <1>
--
+<1> To obtain this value, go to <>.
-Secrets defines sensitive information for the connector type.
-
-`webhookUrl`:: A string that corresponds to *Webhook URL*.
+.Example Slack connector with web API
+[source,text]
+--
+xpack.actions.preconfigured:
+ my-slack:
+ name: preconfigured-slack-api-connector-type
+ actionTypeId: .slack_api
+ secrets:
+ token: 'xoxb-xxxx-xxxx-xxxx' <1>
+--
+<1> To obtain this value, go to <>.
[float]
[[slack-action-configuration]]
@@ -55,30 +67,46 @@ You can test connectors with the <> or
as you're creating or editing the connector in {kib}. For example:
[role="screenshot"]
-image::management/connectors/images/slack-params-test.png[Slack params test]
+image::management/connectors/images/slack-api-params.png[Slack API connector test]
+// NOTE: This is an autogenerated screenshot. Do not edit it directly.
Slack actions have the following properties:
-Message:: The message text, converted to the `text` field in the Webhook JSON payload. Currently only the text field is supported. Markdown, images, and other advanced formatting are not yet supported.
+Channels::
+One or more channels that your Slack app has access to.
+This option is available only in the web API type of connector.
+
+Message:: The Slack message text, which cannot contain Markdown, images, or other advanced formatting.
[float]
[[slack-connector-networking-configuration]]
=== Connector networking configuration
-Use the <> to customize connector networking configurations, such as proxies, certificates, or TLS settings. You can set configurations that apply to all your connectors or use `xpack.actions.customHostSettings` to set per-host configurations.
+Use the <> to customize connector networking configurations, such as proxies, certificates, or TLS settings.
+You can set configurations that apply to all your connectors or use `xpack.actions.customHostSettings` to set per-host configurations.
[float]
[[configuring-slack]]
-==== Configure a Slack account
+=== Configure a Slack account
-You need a https://api.slack.com/incoming-webhooks[Slack webhook URL] to
-configure a Slack account. To create a webhook
-URL, set up an an **Incoming Webhook Integration** through the Slack console:
+Before you can create a Slack connector, you must configure your account and obtain the necessary URL or token.
+
+[float]
+[[configuring-slack-webhook]]
+==== Configure a Slack account for incoming webhooks
. Log in to http://slack.com[slack.com] as a team administrator.
-. Go to https://my.slack.com/services/new/incoming-webhook.
-. Select a default channel for the integration.
-+
-image::images/slack-add-webhook-integration.png[]
-. Click *Add Incoming Webhook Integration*.
+. Create a Slack app, enable incoming webhooks, then create an incoming webhook. Refer to https://api.slack.com/messaging/webhooks.
. Copy the generated webhook URL so you can paste it into your Slack connector form.
+. If you are using the <> setting, make sure the hostname from the URL is added to the allowed hosts.
+
+[float]
+[[configuring-slack-web-api]]
+==== Configure a Slack account for Web API
+
+. Create a Slack app. Refer to https://api.slack.com/authentication/basics#creating.
+. Add scope: `channels:read`, `groups:read`, `chat:write` and `chat:write.public`. Refer to https://api.slack.com/authentication/basics#scopes.
+. Install the app to a workspace. Refer to https://api.slack.com/authentication/basics#installing.
+. Copy the `Bot User OAuth Token` so you can paste it into your Slack connector form.
+. If you need to send messages to a private channel, you need to write `/invite @App_name` in it.
+ Putting "@" triggers Slack to start auto-suggesting, which is why it then becomes easy to find your app name in the list.
diff --git a/docs/management/connectors/images/slack-api-connector.png b/docs/management/connectors/images/slack-api-connector.png
new file mode 100644
index 0000000000000..41eef0b73d9c8
Binary files /dev/null and b/docs/management/connectors/images/slack-api-connector.png differ
diff --git a/docs/management/connectors/images/slack-api-params.png b/docs/management/connectors/images/slack-api-params.png
new file mode 100644
index 0000000000000..a3cbb42b5250f
Binary files /dev/null and b/docs/management/connectors/images/slack-api-params.png differ
diff --git a/docs/management/connectors/images/slack-connector.png b/docs/management/connectors/images/slack-connector.png
deleted file mode 100644
index 7342d962d2a2b..0000000000000
Binary files a/docs/management/connectors/images/slack-connector.png and /dev/null differ
diff --git a/docs/management/connectors/images/slack-params-test.png b/docs/management/connectors/images/slack-params-test.png
deleted file mode 100644
index 603f66301af12..0000000000000
Binary files a/docs/management/connectors/images/slack-params-test.png and /dev/null differ
diff --git a/docs/management/connectors/images/slack-webhook-connector.png b/docs/management/connectors/images/slack-webhook-connector.png
new file mode 100644
index 0000000000000..ab793c7354de3
Binary files /dev/null and b/docs/management/connectors/images/slack-webhook-connector.png differ
diff --git a/x-pack/plugins/actions/docs/openapi/bundled.json b/x-pack/plugins/actions/docs/openapi/bundled.json
index aa9cdcd3d927e..53f48394d26bd 100644
--- a/x-pack/plugins/actions/docs/openapi/bundled.json
+++ b/x-pack/plugins/actions/docs/openapi/bundled.json
@@ -39,6 +39,16 @@
},
{
"$ref": "#/components/parameters/space_id"
+ },
+ {
+ "in": "path",
+ "name": "id",
+ "description": "An UUID v1 or v4 identifier for the connector. If you omit this parameter, an identifier is randomly generated.\n",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "example": "ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74"
+ }
}
],
"requestBody": {
@@ -83,7 +93,10 @@
"$ref": "#/components/schemas/create_connector_request_servicenow_sir"
},
{
- "$ref": "#/components/schemas/create_connector_request_slack"
+ "$ref": "#/components/schemas/create_connector_request_slack_api"
+ },
+ {
+ "$ref": "#/components/schemas/create_connector_request_slack_webhook"
},
{
"$ref": "#/components/schemas/create_connector_request_swimlane"
@@ -317,6 +330,12 @@
{
"$ref": "#/components/schemas/update_connector_request_servicenow_itom"
},
+ {
+ "$ref": "#/components/schemas/update_connector_request_slack_api"
+ },
+ {
+ "$ref": "#/components/schemas/update_connector_request_slack_webhook"
+ },
{
"$ref": "#/components/schemas/update_connector_request_swimlane"
}
@@ -1945,13 +1964,63 @@
}
}
},
- "secrets_properties_slack": {
- "title": "Connector secrets properties for a Slack connector",
+ "secrets_properties_slack_api": {
+ "title": "Connector secrets properties for a Web API Slack connector",
"description": "Defines secrets for connectors when type is `.slack`.",
+ "required": [
+ "token"
+ ],
"type": "object",
- "additionalProperties": true
+ "properties": {
+ "token": {
+ "type": "string",
+ "description": "Slack bot user OAuth token."
+ }
+ }
},
- "create_connector_request_slack": {
+ "create_connector_request_slack_api": {
+ "title": "Create Slack connector request",
+ "description": "The Slack connector uses Slack Incoming Webhooks.",
+ "type": "object",
+ "required": [
+ "connector_type_id",
+ "name",
+ "secrets"
+ ],
+ "properties": {
+ "connector_type_id": {
+ "type": "string",
+ "description": "The type of connector.",
+ "enum": [
+ ".slack_api"
+ ],
+ "example": ".slack_api"
+ },
+ "name": {
+ "type": "string",
+ "description": "The display name for the connector.",
+ "example": "my-connector"
+ },
+ "secrets": {
+ "$ref": "#/components/schemas/secrets_properties_slack_api"
+ }
+ }
+ },
+ "secrets_properties_slack_webhook": {
+ "title": "Connector secrets properties for a Webhook Slack connector",
+ "description": "Defines secrets for connectors when type is `.slack`.",
+ "required": [
+ "webhookUrl"
+ ],
+ "type": "object",
+ "properties": {
+ "webhookUrl": {
+ "type": "string",
+ "description": "Slack webhook url."
+ }
+ }
+ },
+ "create_connector_request_slack_webhook": {
"title": "Create Slack connector request",
"description": "The Slack connector uses Slack Incoming Webhooks.",
"type": "object",
@@ -1975,7 +2044,7 @@
"example": "my-connector"
},
"secrets": {
- "$ref": "#/components/schemas/secrets_properties_slack"
+ "$ref": "#/components/schemas/secrets_properties_slack_webhook"
}
}
},
@@ -2894,7 +2963,44 @@
}
}
},
- "connector_response_properties_slack": {
+ "connector_response_properties_slack_api": {
+ "title": "Connector response properties for a Slack connector",
+ "type": "object",
+ "required": [
+ "connector_type_id",
+ "id",
+ "is_deprecated",
+ "is_preconfigured",
+ "name"
+ ],
+ "properties": {
+ "connector_type_id": {
+ "type": "string",
+ "description": "The type of connector.",
+ "enum": [
+ ".slack_api"
+ ]
+ },
+ "id": {
+ "type": "string",
+ "description": "The identifier for the connector."
+ },
+ "is_deprecated": {
+ "$ref": "#/components/schemas/is_deprecated"
+ },
+ "is_missing_secrets": {
+ "$ref": "#/components/schemas/is_missing_secrets"
+ },
+ "is_preconfigured": {
+ "$ref": "#/components/schemas/is_preconfigured"
+ },
+ "name": {
+ "type": "string",
+ "description": "The display name for the connector."
+ }
+ }
+ },
+ "connector_response_properties_slack_webhook": {
"title": "Connector response properties for a Slack connector",
"type": "object",
"required": [
@@ -3170,7 +3276,10 @@
"$ref": "#/components/schemas/connector_response_properties_servicenow_sir"
},
{
- "$ref": "#/components/schemas/connector_response_properties_slack"
+ "$ref": "#/components/schemas/connector_response_properties_slack_api"
+ },
+ {
+ "$ref": "#/components/schemas/connector_response_properties_slack_webhook"
},
{
"$ref": "#/components/schemas/connector_response_properties_swimlane"
@@ -3348,6 +3457,44 @@
}
}
},
+ "update_connector_request_slack_api": {
+ "title": "Update Slack connector request",
+ "type": "object",
+ "required": [
+ "name",
+ "secrets"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The display name for the connector."
+ },
+ "secrets": {
+ "type": "object",
+ "description": "The secrets object containing the necessary fields for authentication.",
+ "$ref": "#/components/schemas/secrets_properties_slack_api"
+ }
+ }
+ },
+ "update_connector_request_slack_webhook": {
+ "title": "Update Slack connector request",
+ "type": "object",
+ "required": [
+ "name",
+ "secrets"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The display name for the connector."
+ },
+ "secrets": {
+ "type": "object",
+ "description": "The secrets object containing the necessary fields for authentication.",
+ "$ref": "#/components/schemas/secrets_properties_slack_webhook"
+ }
+ }
+ },
"update_connector_request_swimlane": {
"title": "Update Swimlane connector request",
"type": "object",
diff --git a/x-pack/plugins/actions/docs/openapi/bundled.yaml b/x-pack/plugins/actions/docs/openapi/bundled.yaml
index ee6bbe629522b..8cd264536b8e7 100644
--- a/x-pack/plugins/actions/docs/openapi/bundled.yaml
+++ b/x-pack/plugins/actions/docs/openapi/bundled.yaml
@@ -26,6 +26,14 @@ paths:
parameters:
- $ref: '#/components/parameters/kbn_xsrf'
- $ref: '#/components/parameters/space_id'
+ - in: path
+ name: id
+ description: |
+ An UUID v1 or v4 identifier for the connector. If you omit this parameter, an identifier is randomly generated.
+ required: true
+ schema:
+ type: string
+ example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74
requestBody:
required: true
content:
@@ -45,7 +53,8 @@ paths:
- $ref: '#/components/schemas/create_connector_request_servicenow'
- $ref: '#/components/schemas/create_connector_request_servicenow_itom'
- $ref: '#/components/schemas/create_connector_request_servicenow_sir'
- - $ref: '#/components/schemas/create_connector_request_slack'
+ - $ref: '#/components/schemas/create_connector_request_slack_api'
+ - $ref: '#/components/schemas/create_connector_request_slack_webhook'
- $ref: '#/components/schemas/create_connector_request_swimlane'
- $ref: '#/components/schemas/create_connector_request_teams'
- $ref: '#/components/schemas/create_connector_request_tines'
@@ -174,6 +183,8 @@ paths:
- $ref: '#/components/schemas/update_connector_request_serverlog'
- $ref: '#/components/schemas/update_connector_request_servicenow'
- $ref: '#/components/schemas/update_connector_request_servicenow_itom'
+ - $ref: '#/components/schemas/update_connector_request_slack_api'
+ - $ref: '#/components/schemas/update_connector_request_slack_webhook'
- $ref: '#/components/schemas/update_connector_request_swimlane'
examples:
updateIndexConnectorRequest:
@@ -1297,12 +1308,48 @@ components:
example: my-connector
secrets:
$ref: '#/components/schemas/secrets_properties_servicenow'
- secrets_properties_slack:
- title: Connector secrets properties for a Slack connector
+ secrets_properties_slack_api:
+ title: Connector secrets properties for a Web API Slack connector
description: Defines secrets for connectors when type is `.slack`.
+ required:
+ - token
type: object
- additionalProperties: true
- create_connector_request_slack:
+ properties:
+ token:
+ type: string
+ description: Slack bot user OAuth token.
+ create_connector_request_slack_api:
+ title: Create Slack connector request
+ description: The Slack connector uses Slack Incoming Webhooks.
+ type: object
+ required:
+ - connector_type_id
+ - name
+ - secrets
+ properties:
+ connector_type_id:
+ type: string
+ description: The type of connector.
+ enum:
+ - .slack_api
+ example: .slack_api
+ name:
+ type: string
+ description: The display name for the connector.
+ example: my-connector
+ secrets:
+ $ref: '#/components/schemas/secrets_properties_slack_api'
+ secrets_properties_slack_webhook:
+ title: Connector secrets properties for a Webhook Slack connector
+ description: Defines secrets for connectors when type is `.slack`.
+ required:
+ - webhookUrl
+ type: object
+ properties:
+ webhookUrl:
+ type: string
+ description: Slack webhook url.
+ create_connector_request_slack_webhook:
title: Create Slack connector request
description: The Slack connector uses Slack Incoming Webhooks.
type: object
@@ -1322,7 +1369,7 @@ components:
description: The display name for the connector.
example: my-connector
secrets:
- $ref: '#/components/schemas/secrets_properties_slack'
+ $ref: '#/components/schemas/secrets_properties_slack_webhook'
config_properties_swimlane:
title: Connector request properties for a Swimlane connector
required:
@@ -2010,7 +2057,34 @@ components:
name:
type: string
description: The display name for the connector.
- connector_response_properties_slack:
+ connector_response_properties_slack_api:
+ title: Connector response properties for a Slack connector
+ type: object
+ required:
+ - connector_type_id
+ - id
+ - is_deprecated
+ - is_preconfigured
+ - name
+ properties:
+ connector_type_id:
+ type: string
+ description: The type of connector.
+ enum:
+ - .slack_api
+ id:
+ type: string
+ description: The identifier for the connector.
+ is_deprecated:
+ $ref: '#/components/schemas/is_deprecated'
+ is_missing_secrets:
+ $ref: '#/components/schemas/is_missing_secrets'
+ is_preconfigured:
+ $ref: '#/components/schemas/is_preconfigured'
+ name:
+ type: string
+ description: The display name for the connector.
+ connector_response_properties_slack_webhook:
title: Connector response properties for a Slack connector
type: object
required:
@@ -2199,7 +2273,8 @@ components:
- $ref: '#/components/schemas/connector_response_properties_servicenow'
- $ref: '#/components/schemas/connector_response_properties_servicenow_itom'
- $ref: '#/components/schemas/connector_response_properties_servicenow_sir'
- - $ref: '#/components/schemas/connector_response_properties_slack'
+ - $ref: '#/components/schemas/connector_response_properties_slack_api'
+ - $ref: '#/components/schemas/connector_response_properties_slack_webhook'
- $ref: '#/components/schemas/connector_response_properties_swimlane'
- $ref: '#/components/schemas/connector_response_properties_teams'
- $ref: '#/components/schemas/connector_response_properties_tines'
@@ -2318,6 +2393,34 @@ components:
description: The display name for the connector.
secrets:
$ref: '#/components/schemas/secrets_properties_servicenow'
+ update_connector_request_slack_api:
+ title: Update Slack connector request
+ type: object
+ required:
+ - name
+ - secrets
+ properties:
+ name:
+ type: string
+ description: The display name for the connector.
+ secrets:
+ type: object
+ description: The secrets object containing the necessary fields for authentication.
+ $ref: '#/components/schemas/secrets_properties_slack_api'
+ update_connector_request_slack_webhook:
+ title: Update Slack connector request
+ type: object
+ required:
+ - name
+ - secrets
+ properties:
+ name:
+ type: string
+ description: The display name for the connector.
+ secrets:
+ type: object
+ description: The secrets object containing the necessary fields for authentication.
+ $ref: '#/components/schemas/secrets_properties_slack_webhook'
update_connector_request_swimlane:
title: Update Swimlane connector request
type: object
diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/connector_response_properties.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/connector_response_properties.yaml
index b73584568df6b..ef72d88e31480 100644
--- a/x-pack/plugins/actions/docs/openapi/components/schemas/connector_response_properties.yaml
+++ b/x-pack/plugins/actions/docs/openapi/components/schemas/connector_response_properties.yaml
@@ -12,7 +12,8 @@ oneOf:
- $ref: 'connector_response_properties_servicenow.yaml'
- $ref: 'connector_response_properties_servicenow_itom.yaml'
- $ref: 'connector_response_properties_servicenow_sir.yaml'
- - $ref: 'connector_response_properties_slack.yaml'
+ - $ref: 'connector_response_properties_slack_api.yaml'
+ - $ref: 'connector_response_properties_slack_webhook.yaml'
- $ref: 'connector_response_properties_swimlane.yaml'
- $ref: 'connector_response_properties_teams.yaml'
- $ref: 'connector_response_properties_tines.yaml'
diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/connector_response_properties_slack_api.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/connector_response_properties_slack_api.yaml
new file mode 100644
index 0000000000000..eab369907b5a5
--- /dev/null
+++ b/x-pack/plugins/actions/docs/openapi/components/schemas/connector_response_properties_slack_api.yaml
@@ -0,0 +1,26 @@
+title: Connector response properties for a Slack connector
+type: object
+required:
+ - connector_type_id
+ - id
+ - is_deprecated
+ - is_preconfigured
+ - name
+properties:
+ connector_type_id:
+ type: string
+ description: The type of connector.
+ enum:
+ - .slack_api
+ id:
+ type: string
+ description: The identifier for the connector.
+ is_deprecated:
+ $ref: 'is_deprecated.yaml'
+ is_missing_secrets:
+ $ref: 'is_missing_secrets.yaml'
+ is_preconfigured:
+ $ref: 'is_preconfigured.yaml'
+ name:
+ type: string
+ description: The display name for the connector.
diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/connector_response_properties_slack.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/connector_response_properties_slack_webhook.yaml
similarity index 94%
rename from x-pack/plugins/actions/docs/openapi/components/schemas/connector_response_properties_slack.yaml
rename to x-pack/plugins/actions/docs/openapi/components/schemas/connector_response_properties_slack_webhook.yaml
index d0254e0518316..19ddc08fc125a 100644
--- a/x-pack/plugins/actions/docs/openapi/components/schemas/connector_response_properties_slack.yaml
+++ b/x-pack/plugins/actions/docs/openapi/components/schemas/connector_response_properties_slack_webhook.yaml
@@ -16,7 +16,7 @@ properties:
type: string
description: The identifier for the connector.
is_deprecated:
- $ref: 'is_deprecated.yaml'
+ $ref: 'is_deprecated.yaml'
is_missing_secrets:
$ref: 'is_missing_secrets.yaml'
is_preconfigured:
diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_slack_api.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_slack_api.yaml
new file mode 100644
index 0000000000000..a16ba7416e7bc
--- /dev/null
+++ b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_slack_api.yaml
@@ -0,0 +1,20 @@
+title: Create Slack connector request
+description: The Slack connector uses Slack Incoming Webhooks.
+type: object
+required:
+ - connector_type_id
+ - name
+ - secrets
+properties:
+ connector_type_id:
+ type: string
+ description: The type of connector.
+ enum:
+ - .slack_api
+ example: .slack_api
+ name:
+ type: string
+ description: The display name for the connector.
+ example: my-connector
+ secrets:
+ $ref: 'secrets_properties_slack_api.yaml'
diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_slack.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_slack_webhook.yaml
similarity index 89%
rename from x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_slack.yaml
rename to x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_slack_webhook.yaml
index 0634d48b543a1..1c046cc3f000c 100644
--- a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_slack.yaml
+++ b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_slack_webhook.yaml
@@ -17,4 +17,4 @@ properties:
description: The display name for the connector.
example: my-connector
secrets:
- $ref: 'secrets_properties_slack.yaml'
\ No newline at end of file
+ $ref: 'secrets_properties_slack_webhook.yaml'
diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/secrets_properties_slack.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/secrets_properties_slack.yaml
deleted file mode 100644
index 4a681e8a195f3..0000000000000
--- a/x-pack/plugins/actions/docs/openapi/components/schemas/secrets_properties_slack.yaml
+++ /dev/null
@@ -1,5 +0,0 @@
-title: Connector secrets properties for a Slack connector
-description: Defines secrets for connectors when type is `.slack`.
-type: object
-additionalProperties: true
-# TO-DO: Add the properties for this connector.
\ No newline at end of file
diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/secrets_properties_slack_api.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/secrets_properties_slack_api.yaml
new file mode 100644
index 0000000000000..d59845a876c77
--- /dev/null
+++ b/x-pack/plugins/actions/docs/openapi/components/schemas/secrets_properties_slack_api.yaml
@@ -0,0 +1,9 @@
+title: Connector secrets properties for a Web API Slack connector
+description: Defines secrets for connectors when type is `.slack`.
+required:
+ - token
+type: object
+properties:
+ token:
+ type: string
+ description: Slack bot user OAuth token.
diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/secrets_properties_slack_webhook.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/secrets_properties_slack_webhook.yaml
new file mode 100644
index 0000000000000..6b16601255d68
--- /dev/null
+++ b/x-pack/plugins/actions/docs/openapi/components/schemas/secrets_properties_slack_webhook.yaml
@@ -0,0 +1,9 @@
+title: Connector secrets properties for a Webhook Slack connector
+description: Defines secrets for connectors when type is `.slack`.
+required:
+ - webhookUrl
+type: object
+properties:
+ webhookUrl:
+ type: string
+ description: Slack webhook url.
diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/update_connector_request_slack.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/update_connector_request_slack_api.yaml
similarity index 54%
rename from x-pack/plugins/actions/docs/openapi/components/schemas/update_connector_request_slack.yaml
rename to x-pack/plugins/actions/docs/openapi/components/schemas/update_connector_request_slack_api.yaml
index 6e1bf95b3944a..e85a0436a035b 100644
--- a/x-pack/plugins/actions/docs/openapi/components/schemas/update_connector_request_slack.yaml
+++ b/x-pack/plugins/actions/docs/openapi/components/schemas/update_connector_request_slack_api.yaml
@@ -8,4 +8,6 @@ properties:
type: string
description: The display name for the connector.
secrets:
- $ref: 'secrets_properties_slack.yaml'
\ No newline at end of file
+ type: object
+ description: The secrets object containing the necessary fields for authentication.
+ $ref: 'secrets_properties_slack_api.yaml'
diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/update_connector_request_slack_webhook.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/update_connector_request_slack_webhook.yaml
new file mode 100644
index 0000000000000..4ed93f519f3c2
--- /dev/null
+++ b/x-pack/plugins/actions/docs/openapi/components/schemas/update_connector_request_slack_webhook.yaml
@@ -0,0 +1,13 @@
+title: Update Slack connector request
+type: object
+required:
+ - name
+ - secrets
+properties:
+ name:
+ type: string
+ description: The display name for the connector.
+ secrets:
+ type: object
+ description: The secrets object containing the necessary fields for authentication.
+ $ref: 'secrets_properties_slack_webhook.yaml'
diff --git a/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connector.yaml b/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connector.yaml
index b3d42c3f47484..24fddf1a8b972 100644
--- a/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connector.yaml
+++ b/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connector.yaml
@@ -36,7 +36,8 @@ post:
- $ref: '../components/schemas/create_connector_request_servicenow.yaml'
- $ref: '../components/schemas/create_connector_request_servicenow_itom.yaml'
- $ref: '../components/schemas/create_connector_request_servicenow_sir.yaml'
- - $ref: '../components/schemas/create_connector_request_slack.yaml'
+ - $ref: '../components/schemas/create_connector_request_slack_api.yaml'
+ - $ref: '../components/schemas/create_connector_request_slack_webhook.yaml'
- $ref: '../components/schemas/create_connector_request_swimlane.yaml'
- $ref: '../components/schemas/create_connector_request_teams.yaml'
- $ref: '../components/schemas/create_connector_request_tines.yaml'
diff --git a/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connector@{connectorid}.yaml b/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connector@{connectorid}.yaml
index e2c679deea94b..a417a457a9448 100644
--- a/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connector@{connectorid}.yaml
+++ b/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connector@{connectorid}.yaml
@@ -104,7 +104,8 @@ put:
- $ref: '../components/schemas/update_connector_request_serverlog.yaml'
- $ref: '../components/schemas/update_connector_request_servicenow.yaml'
- $ref: '../components/schemas/update_connector_request_servicenow_itom.yaml'
-# - $ref: '../components/schemas/update_connector_request_slack.yaml'
+ - $ref: '../components/schemas/update_connector_request_slack_api.yaml'
+ - $ref: '../components/schemas/update_connector_request_slack_webhook.yaml'
- $ref: '../components/schemas/update_connector_request_swimlane.yaml'
# - $ref: '../components/schemas/update_connector_request_teams.yaml'
# - $ref: '../components/schemas/update_connector_request_tines.yaml'
diff --git a/x-pack/plugins/stack_connectors/public/connector_types/slack/action_form.test.tsx b/x-pack/plugins/stack_connectors/public/connector_types/slack/action_form.test.tsx
index 32eb23f9a167f..cfa9014e5bb4c 100644
--- a/x-pack/plugins/stack_connectors/public/connector_types/slack/action_form.test.tsx
+++ b/x-pack/plugins/stack_connectors/public/connector_types/slack/action_form.test.tsx
@@ -172,6 +172,6 @@ describe('ActionForm - Slack API Connector', () => {
);
- expect(await screen.findByText('Selected channel is required.')).toBeInTheDocument();
+ expect(await screen.findByText('Channel is required.')).toBeInTheDocument();
});
});
diff --git a/x-pack/plugins/stack_connectors/public/connector_types/slack/slack.tsx b/x-pack/plugins/stack_connectors/public/connector_types/slack/slack.tsx
index c1b4b72182fa9..8fe351407ab92 100644
--- a/x-pack/plugins/stack_connectors/public/connector_types/slack/slack.tsx
+++ b/x-pack/plugins/stack_connectors/public/connector_types/slack/slack.tsx
@@ -36,7 +36,7 @@ export function getConnectorType(): ConnectorTypeModel {
expect(await connectorTypeModel.validateParams(actionParams)).toEqual({
errors: {
text: [],
- channels: ['Selected channel is required.'],
+ channels: ['Channel is required.'],
},
});
});
diff --git a/x-pack/plugins/stack_connectors/public/connector_types/slack_api/translations.ts b/x-pack/plugins/stack_connectors/public/connector_types/slack_api/translations.ts
index 2c3ea5276ab92..dda8807485347 100644
--- a/x-pack/plugins/stack_connectors/public/connector_types/slack_api/translations.ts
+++ b/x-pack/plugins/stack_connectors/public/connector_types/slack_api/translations.ts
@@ -16,7 +16,7 @@ export const MESSAGE_REQUIRED = i18n.translate(
export const CHANNEL_REQUIRED = i18n.translate(
'xpack.stackConnectors.components.slack.error.requiredSlackChannel',
{
- defaultMessage: 'Selected channel is required.',
+ defaultMessage: 'Channel is required.',
}
);
export const TOKEN_LABEL = i18n.translate(
@@ -31,7 +31,7 @@ export const WEB_API = i18n.translate('xpack.stackConnectors.components.slack.we
export const SELECT_MESSAGE = i18n.translate(
'xpack.stackConnectors.components.slack.selectMessageText',
{
- defaultMessage: 'Send a message to a Slack channel or user.',
+ defaultMessage: 'Send messages to Slack channels.',
}
);
export const ACTION_TYPE_TITLE = i18n.translate(
diff --git a/x-pack/plugins/triggers_actions_ui/README.md b/x-pack/plugins/triggers_actions_ui/README.md
index 598322b4aea13..dcf378162516d 100644
--- a/x-pack/plugins/triggers_actions_ui/README.md
+++ b/x-pack/plugins/triggers_actions_ui/README.md
@@ -978,7 +978,7 @@ export function getActionType(): ActionTypeModel {
selectMessage: i18n.translate(
'xpack.triggersActionsUI.components.builtinActionTypes.slackAction.selectMessageText',
{
- defaultMessage: 'Send a message to a Slack channel or user.',
+ defaultMessage: 'Send messages to Slack channels.',
}
),
actionTypeTitle: i18n.translate(
diff --git a/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/connector_types.ts b/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/connector_types.ts
index 4da22a8e807a8..7b4b35d64f389 100644
--- a/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/connector_types.ts
+++ b/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/connector_types.ts
@@ -83,6 +83,37 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await flyOutCancelButton.click();
});
+ it('slack api connector screenshots', async () => {
+ await pageObjects.common.navigateToApp('connectors');
+ await pageObjects.header.waitUntilLoadingHasFinished();
+ await actions.common.openNewConnectorForm('slack');
+ await testSubjects.click('.slack_apiButton');
+ await testSubjects.setValue('nameInput', 'Slack api test connector');
+ await testSubjects.setValue('secrets.token-input', 'xoxb-XXXX-XXXX-XXXX');
+ await commonScreenshots.takeScreenshot('slack-api-connector', screenshotDirectories);
+ await testSubjects.click('create-connector-flyout-save-test-btn');
+ await testSubjects.click('toastCloseButton');
+ await pageObjects.common.closeToast();
+ await commonScreenshots.takeScreenshot('slack-api-params', screenshotDirectories);
+ await testSubjects.click('euiFlyoutCloseButton');
+ });
+
+ it('slack webhook connector screenshots', async () => {
+ await pageObjects.common.navigateToApp('connectors');
+ await pageObjects.header.waitUntilLoadingHasFinished();
+ await actions.common.openNewConnectorForm('slack');
+ await testSubjects.setValue('nameInput', 'Slack webhook test connector');
+ await testSubjects.setValue(
+ 'slackWebhookUrlInput',
+ 'https://hooks.slack.com/services/abcd/ljklmnopqrstuvwxz'
+ );
+ await commonScreenshots.takeScreenshot('slack-webhook-connector', screenshotDirectories);
+ await testSubjects.click('create-connector-flyout-save-test-btn');
+ await testSubjects.click('toastCloseButton');
+ await commonScreenshots.takeScreenshot('slack-webhook-params', screenshotDirectories);
+ await testSubjects.click('euiFlyoutCloseButton');
+ });
+
it('email connector screenshots', async () => {
await pageObjects.common.navigateToApp('connectors');
await pageObjects.header.waitUntilLoadingHasFinished();