snapshot of https://github.com/mattermost/mattermost.git (master, 2026-09-16; blobs > 131072B omitted)
Some checks failed
Server CI / Postgres (shard 0) (push) Has been skipped
Server CI / Postgres (shard 3) (push) Has been skipped
BuildEnv Docker Image / build-image (push) Failing after 4s
BuildEnv Docker Image / build-image-fips (push) Failing after 4s
Migration Review & Release Notes / Generate migration review & release notes (push) Failing after 3s
Server CI / Build Environment (push) Failing after 3s
Server CI / Postgres (shard 1) (push) Has been skipped
Tools CI / check-style (mattermost-govet) (push) Failing after 4s
Server CI / Postgres (shard 2) (push) Has been skipped
Tools CI / check-style (mmgotool) (push) Failing after 3s
Server CI / Elasticsearch v8 Compatibility (push) Has been skipped
Server CI / OpenSearch v2 Compatibility (push) Has been skipped
Server CI / Postgres FIPS (shard 0) (push) Has been skipped
Tools CI / Test (mattermost-govet) (push) Failing after 3s
Server CI / Postgres FIPS (shard 1) (push) Has been skipped
Server CI / Postgres FIPS (shard 2) (push) Has been skipped
Tools CI / Test (mmgotool) (push) Failing after 3s
Server CI / Postgres FIPS (shard 3) (push) Has been skipped
Server CI / Run mmctl tests (push) Has been skipped
Server CI / Run mmctl tests (FIPS) (push) Has been skipped
Server CI / Merge Postgres Test Results (push) Has been skipped
Server CI / Merge Postgres FIPS Test Results (push) Has been skipped
Server CI / Check backport migrations (push) Has been skipped
Server CI / Check generated files (push) Has been skipped
Server CI / check-style (push) Has been skipped
Server CI / Vet API (push) Has been skipped
Server CI / Build mattermost server app (push) Has been skipped
Server CI / Server CI Complete (push) Failing after 2s
Server CI / Server CI Artifacts (push) Has been skipped
Server CI / Sentry Upload (push) Has been skipped
Server CI / Server CI Report (push) Failing after 5m1s
Server CI Nightly Race / Race Detector (push) Has been skipped
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Webapp CI Cache Warm / Warm Webapp node_modules Cache (push) Has been cancelled
E2E CI Cache Warm / Warm E2E npm Registry Cache (push) Has been cancelled
API / build (push) Has been cancelled
Web App CI / check-types (push) Has been cancelled
Web App CI / check-lint (push) Has been cancelled
Web App CI / check-i18n (push) Has been cancelled
Web App CI / check-external-links (push) Has been cancelled
Web App CI / test (platform) (push) Has been cancelled
Web App CI / test (mattermost-redux) (push) Has been cancelled
Web App CI / test (channels shard 1/4) (push) Has been cancelled
Web App CI / test (channels shard 2/4) (push) Has been cancelled
Web App CI / test (channels shard 3/4) (push) Has been cancelled
Web App CI / test (channels shard 4/4) (push) Has been cancelled
Web App CI / upload-coverage (push) Has been cancelled
Web App CI / build (push) Has been cancelled
YAML Lint / yamllint (push) Has been cancelled
Push mirrored docker images / cd/Push mirrored docker images (push) Has been cancelled
docs-cd / Build and deploy docs (push) Has been cancelled
Docs CI / build (push) Has been cancelled
E2E Cache Warm: Cypress deps / Warm Cypress deps cache (push) Has been cancelled
Scorecards supply-chain security / Scorecard analysis (push) Has been cancelled
Server CI Weekly / Postgres FIPS (push) Has been skipped
Server CI Weekly / Run mmctl tests (FIPS) (push) Has been skipped
Server CI Weekly / Postgres with binary parameters (push) Has been skipped
Server CI Weekly / Build Environment (push) Failing after 1s
Server CI Cache Warm / Warm Go Module and Build Cache (push) Failing after 2s
Server CI Nightly Race / Build Environment (push) Failing after 1s

This commit is contained in:
upstream-mirror
2026-09-16 00:29:55 +05:00
commit 240db4e2a7
15309 changed files with 2173406 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
---
title: "Built-in commands"
sidebar_position: 10
---
Each Mattermost installation comes with some built-in slash commands that are ready to use. See the [Mattermost product documentation](https://docs.mattermost.com/channels/interact-with-channels.html) for details on available slash commands available in the [latest Mattermost release](https://mattermost.com/download)
To create a custom slash command, see the [Custom slash commands](/developers/integrate/slash-commands/custom) developer documentation.

View File

@@ -0,0 +1,136 @@
---
title: "Custom slash commands"
sidebar_label: "Custom commands"
sidebar_position: 20
---
Suppose you want to write an external application that is able to check the weather for certain cities. By creating a custom slash command and setting up the application to handle the HTTP `POST` or `GET` from the command, you can let your users check the weather in their city for the week using your command, say `/weather toronto week`.
You can follow these general guidelines to set up a custom Mattermost slash command for your application.
1. Open **Product menu > Integrations > Slash Commands**. If you don't have the **Integrations** option in your Main Menu, slash commands may not be enabled on your Mattermost Server or may be disabled for non-admins. Enable them from **System Console > Integrations > Integration Management** or ask your Mattermost System Admin to do so.
2. Select **Add Slash Command**; the **Add** dialog will appear. Use the following guidelines to configure the slash command:
- Set the **Title** and **Description** for the command.
- Set the **Command Trigger Word**. The trigger word must be unique and cannot begin with a slash or contain any spaces. It also cannot be one of the [built-in commands](/developers/integrate/slash-commands/built-in).
- Set the **Request URL** and **Request Method**. The request URL is the endpoint that Mattermost hits to reach your application, and the request method is either `POST` or `GET` and specifies the type of request sent to the request URL.
- (_Optional_) Set the **Response Username** and **Response Icon** the command will post messages as in Mattermost. If not set, the command will use your username and profile picture.
- (_Optional_) Select the **Autocomplete** option to include the slash command in the command autocomplete list, displayed when typing ``/`` in an empty input box. Use it to make your command easier to discover by your teammates. You can also provide a hint listing the arguments of your command and a short description displayed in the autocomplete list.
<Note title="Note">
[Enable integrations to override usernames](https://docs.mattermost.com/configure/configuration-settings.html#enable-integrations-to-override-usernames) must be set to `true` in `config.json` to override usernames. Enable them from **System Console > Integrations > Integration Management**, or ask your System Admin to do so. If not enabled, the username is set to `webhook`.
Similarly, [Enable integrations to override profile picture icons](https://docs.mattermost.com/configure/configuration-settings.html#enable-integrations-to-override-profile-picture-icons) must be set to `true` in `config.json` to override profile picture icons. Enable them from **System Console > Integrations > Integration Management**, or ask your System Admin to do so. If not enabled, the icon of the creator of the webhook URL is used to post messages.
</Note>
3. Select **Save**. On the next page, copy the **Token** value. This will be used in a later step.
![image](slash_commands_token.png)
4. Next, write your external application. Include a function which receives HTTP `POST` or HTTP `GET` requests from Mattermost. The request will look something like this:
```http request
POST /weather HTTP/1.1
Host: weather-service:4000
Accept: application/json
Accept-Encoding: gzip
Authorization: Token qzgakf1nx3yt9dr4n8585ihbxy
Content-Length: 567
Content-Type: application/x-www-form-urlencoded
User-Agent: Mattermost-Bot/1.1
channel_id=fukxanjgjbnp7ng383at53k1sy&
channel_name=town-square&
command=%2Fweather&
response_url=http%3A%2F%2Flocalhost%3A8066%2Fhooks%2Fcommands%2Fi11f6nnfgfyk8eg56x9omc6dpa&
team_domain=team-awesome&
team_id=wx4zz8t4ttgmtxqiwfohijayzc&
text=toronto+week&
token=qzgakf1nx3yt9dr4n8585ihbxy&
trigger_id=ZWZ5ZjRndzR4YmJxOHJlZWh4MXpkaHozbnI6ZXJqNnFjazNyZmd0dWpzODZ3NXI2cmNremg6MTY2MjA0MTY5Njg5NjpNRVFDSUQ5cTZ3MkRHU1RaNjhyaDh1TGl1STlSVHh2R1czSXZ5aGVRYjhkWThuZnlBaUI2YnlPR2ZpWlczR1FmVkdIODlreEp4MmlVT0UxMm9LMjlkZ1d0RC8xbjZRPT0%3D&
user_id=erj6qck3rfgtujs86w5r6rckzh&
user_name=alan
```
If your integration sends back a JSON response, make sure it returns the `application/json` content-type.
5. The HTTP `POST` or `GET` request will contain an `Authorization` header with a bearer token. The bearer token should match the **Token** value from step 3 for a request to be considered valid.
6. To have your application post a message back to `town-square`, it can respond to the HTTP `POST` or `GET` request with a JSON payload.
Mattermost supports several [parameters](#response-parameters) in the response to fine-tune the user's experience. For instance, you can override the username and profile picture the messages post as, or specify a custom post type in the slash command response payload for use by [plugins](/developers/integrate/plugins). Messages with advanced formatting can be created by including [Mattermost Blocks](/developers/integrate/reference/mm-blocks), an [attachment array](/developers/integrate/reference/message-attachments), or [interactive message buttons](/developers/integrate/plugins/interactive-messages) in the response payload.
Our external weather application could respond with a JSON payload like so:
```
{"response_type": "in_channel", "text": "
---
#### Weather in Toronto, Ontario for the Week of February 16th, 2016
| Day | Description | High | Low |
|:--------------------|:---------------------------------|:-------|:-------|
| Monday, Feb. 15 | Cloudy with a chance of flurries | 3 °C | -12 °C |
| Tuesday, Feb. 16 | Sunny | 4 °C | -8 °C |
| Wednesday, Feb. 17 | Partly cloudly | 4 °C | -14 °C |
| Thursday, Feb. 18 | Cloudy with a chance of rain | 2 °C | -13 °C |
| Friday, Feb. 19 | Overcast | 5 °C | -7 °C |
| Saturday, Feb. 20 | Sunny with cloudy patches | 7 °C | -4 °C |
| Sunday, Feb. 21 | Partly cloudy | 6 °C | -9 °C |
---
"}
```
The JSON response would render in Mattermost as:
![image](weatherBot.png)
## Response parameters
Slash command responses support more than just the `text` field. Here is a full list of supported parameters.
| Parameter | Description | Required |
|----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------|
| `text` | [Markdown-formatted](https://docs.mattermost.com/messaging/formatting-text.html) message to display in the post. | If `attachments` is not set, yes |
| `attachments` | [Message attachments](/developers/integrate/reference/message-attachments) used for richer formatting options. | If `text` is not set, yes |
| `response_type` | Set to blank or `ephemeral` to reply with a message that only the user can see. <br/> Set to `in_channel` to create a regular message.<br/> Defaults to `ephemeral`. | No |
| `username` | Overrides the username the message posts as.<br/> Defaults to the username set during webhook creation or the webhook creator's username if the former was not set.<br/> Must be enabled [in the configuration](https://docs.mattermost.com/configure/configuration-settings.html#enable-integrations-to-override-usernames). | No |
| `channel_id` | Overrides the channel to which the message gets posted.<br/> Defaults to the channel in which the command was issued. | No |
| `icon_url ` | Overrides the profile picture the message posts with.<br/> Defaults to the URL set during webhook creation or the webhook creator's profile picture if the former was not set.<br/> Must be enabled [in the configuration](https://docs.mattermost.com/configure/configuration-settings.html#enable-integrations-to-override-profile-picture-icons). | No |
| `goto_location` | A URL to redirect the user to. Supports many protocols, including `http://`, `https://`, `ftp://`, `ssh://` and `mailto://`. | No |
| `type` | Sets the post `type`, mainly for use by plugins.<br/> If not blank, must begin with `custom_`. Passing `attachments` will ignore this field and set the type to `slack_attachment`. | No |
| `extra_responses` | An array of responses used to send more than one post in your response. Each item in this array takes the shape of its own command response, so it can include any of the other parameters listed here, except `goto_location` and `extra_responses` itself. Available from Mattermost v5.6. | No |
| `skip_slack_parsing` | If set to `true` Mattermost will skip the [Slack compatibility](/developers/integrate/slash-commands/slack) handling. Useful if the post contains text or code which is incorrectly handled by the Slack compatibility logic. Available from Mattermost v5.20. | No |
| `props` | Sets the post `props`, a JSON property bag for storing extra or meta data on the post. Mainly used by other integrations accessing posts through the [REST API](https://api.mattermost.com).<br/>The following keys are reserved and server-controlled on the REST API (stripped from client-supplied props; set only by trusted integration entry points such as slash commands and incoming webhooks): `from_webhook`, `from_bot`, `from_oauth_app`, `from_plugin`, `force_notification`, `silent_notification`, `override_username`, `override_icon_url`, `override_icon_emoji`, `webhook_display_name`, `card`, and `attachments`.<br/>`override_username` / `override_icon_url` / `override_icon_emoji` in `props` also require the corresponding [Enable integrations to override usernames](https://docs.mattermost.com/configure/configuration-settings.html#enable-integrations-to-override-usernames) / [profile picture icons](https://docs.mattermost.com/configure/configuration-settings.html#enable-integrations-to-override-profile-picture-icons) settings — the same gates as the top-level `username` / `icon_url` response fields.<br/>Use `props.mm_blocks` (array of block objects for layout and interactive controls) and `props.mm_blocks_actions` (map of action IDs to server-side handlers) for [Mattermost Blocks](/developers/integrate/reference/mm-blocks) interactive content. | No |
An response payload using several parameters could look like this:
```json
{
"response_type": "in_channel",
"text": "\n#### Test results for July 27th, 2017\n@channel here are the requested test results.\n\n| Component | Tests Run | Tests Failed |\n| ---------- | ----------- | ---------------------------------------------- |\n| Server | 948 | :white_check_mark: 0 |\n| Web Client | 123 | :warning: 2 [(see details)](https://linktologs) |\n| iOS Client | 78 | :warning: 3 [(see details)](https://linktologs) |\n\t\t ",
"username": "test-automation",
"icon_url": "https://mattermost.com/wp-content/uploads/2022/02/icon.png",
"props": {
"test_data": {
"ios": 78,
"server": 948,
"web": 123
}
},
}
```
## Delayed and multiple responses
You can use the `response_url` parameter to supply multiple responses or a delayed response to a slash command. Response URLs can be used to send five additional messages within a 30-minute time period from the original command invocation.
Delayed responses are useful when the action takes more than three seconds to perform. For instance:
- Retrieval of data from external third-party services, where the response time may take longer than three seconds.
- Report generation, batch processing or other long-running processes that take longer than three seconds to respond.
Any requests that are made to the response URL should either be a plain text or JSON-encoded body. The JSON-encoded message supports both [Markdown formatting](https://docs.mattermost.com/messaging/formatting-text.html) and [message attachments](/developers/integrate/reference/message-attachments).
For information on the Slack compatibility of slash commands, see the [Slack compatibility](/developers/integrate/slash-commands/slack) page.

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -0,0 +1,115 @@
---
title: "Slash commands"
sidebar_position: 30
---
Slash commands are messages that begin with `/` and trigger an HTTP request to a web service that can in turn post one or more messages in response.
Slash commands have an additional feature, **autocomplete**, that displays a list of possible commands based on what has been typed in the message box. Typing `/` in an empty message box will display a list of all slash commands. As the slash command is typed in the message box, autocomplete will also display possible arguments and flags for the command.
Unlike [outgoing webhooks](/developers/integrate/webhooks/outgoing), slash commands work in private channels and direct messages in addition to public channels, and can be configured to auto-complete when typing.
Mattermost includes a number of [built-in slash commands](https://docs.mattermost.com/channels/interact-with-channels.html). You can also create [custom slash commands](/custom).
## Tips and best practices
1. Slash commands are designed to easily allow you to post messages. For other actions such as channel creation, you must also use the [Mattermost APIs](https://api.mattermost.com).
2. Posts size is limited to 16383 characters for servers running [Mattermost Server v5.0 or later](https://docs.mattermost.com/administration/important-upgrade-notes.html). Use the `extra_responses` field to reply to a triggered slash command with more than one post.
3. You can restrict who can create slash commands in [System Console > Integrations > Integration Management](https://docs.mattermost.com/configure/configuration-settings.html#enable-custom-slash-commands).
4. Mattermost [outgoing webhooks](/developers/integrate/webhooks/outgoing) are Slack-compatible. You can copy-and-paste code used for a Slack outgoing webhook to create Mattermost integrations. Mattermost [automatically translates Slack's proprietary JSON payload format](/slack#translate-slacks-data-format-to-mattermost).
5. The external application may be written in any programming language. It needs to provide a URL which receives the request sent by your Mattermost Server and responds with in the required JSON format.
## FAQ
### How do I debug slash commands?
To debug slash commands in **System Console > Logs**, set **System Console > Logging > Enable Webhook Debugging** to **true** and set **System Console > Logging > Console Log Level** to **DEBUG**.
### How do I send multiple responses from a slash command?
You can send multiple responses with an `extra_responses` parameter as follows.
```http
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 696
```
### What if my slash command takes time to build a response?
Reply immediately with an `ephemeral` message to confirm response of the command, and then use the `response_url` to send up to five additional messages within a 30-minute time period from the original command invocation.
### Why does my slash command fail to connect to `localhost`?
By default, Mattermost prohibits outgoing connections that resolve to certain common IP ranges, including the loopback (`127.0.0.0/8`) and various private-use subnets.
During development, you may override this behaviour by setting `ServiceSettings.AllowedUntrustedInternalConnections` to `"127.0.0.0/8"` in your `config.json` or via **System Console > Advanced > Developer**. See the [configuration settings documentation](https://docs.mattermost.com/configure/environment-configuration-settings.html#allow-untrusted-internal-connections) for more details.
### Should I configure my slash command to use `POST` or `GET`?
Best practice suggests using `GET` only if a request is considered idempotent. This means that the request can be repeated safely and can be expected to return the same response for a given input. Some servers hosting your slash command may also impose a limit to the amount of data passed through the query string of a `GET` request.
Ultimately, however, the choice is yours. If in doubt, configure your slash command to use a `POST` request.
<Note title="Mattermost releases prior to 5.0.0">
Note that slash commands configured to use a <code>GET</code> request were broken prior to Mattermost release 5.0.0. The payload was incorrectly encoded in the body of the <code>GET</code> request instead of in the query string. While it was still technically possible to extract the payload, this was non-standard and broke some development stacks.
</Note>
### Why does my slash command always fail with `returned an empty response`?
If you are emitting the `Content-Type: application/json` header, your body must be valid JSON. Any JSON decoding failure will result in this error message.
Also, you must provide a `response_type`. Mattermost does not assume a default if this field is missing.
### Why does my slash command print the JSON data instead of formatting it?
Ensure you are emitting the `Content-Type: application/json` header, otherwise your body will be treated as plain text and posted as such.
### Are slash commands Slack-compatible?
See the [Slack compatibility](/slack) page.
### How do I use Bot Accounts to reply to slash commands?
#### If you are developing an integration
- Set up a [Personal Access Token](/developers/integrate/reference/personal-access-token) for the Bot Account you want to reply with.
- Use the [REST API](https://api.mattermost.com/#tag/posts/operation/CreatePost) to create a post with the Access Token.
#### If you are developing a plugin
Use [`CreatePost`](/developers/integrate/reference/server#API.CreatePost) plugin API. Make sure to set the `UserId` of the post to the `UserId` of the Bot Account. If you want to create an ephemeral post, use [`SendEphemeralPost`](/developers/integrate/reference/server#API.SendEphemeralPost) plugin API instead.
## Troubleshoot slash commands
Join the [Mattermost user community](https://mattermost.com/pl/default-ask-mattermost-community) for help troubleshooting your slash command.
## Share your integration
If you've built an integration for Mattermost, please consider [sharing your work](/developers/integrate/getting-started) in our [Marketplace](https://mattermost.com/marketplace/).
The [Marketplace](https://mattermost.com/marketplace/) lists open source integrations developed by the Mattermost community and are available for download, customization, and deployment to your private cloud or self-hosted infrastructure.
### Are slash commands Slack-compatible?
See the [Slack compatibility](/slack) page.
### How do I use Bot Accounts to reply to slash commands?
#### If you are developing an integration
- Set up a [Personal Access Token](/developers/integrate/reference/personal-access-token) for the Bot Account you want to reply with.
- Use the [REST API](https://api.mattermost.com/#tag/posts/operation/CreatePost) to create a post with the Access Token.
#### If you are developing a plugin
Use [`CreatePost`](/developers/integrate/reference/server#API.CreatePost) plugin API. Make sure to set the `UserId` of the post to the `UserId` of the Bot Account. If you want to create an ephemeral post, use [`SendEphemeralPost`](/developers/integrate/reference/server#API.SendEphemeralPost) plugin API instead.
## Troubleshoot slash commands
Join the [Mattermost user community](https://mattermost.com/pl/default-ask-mattermost-community) for help troubleshooting your slash command.
## Share your integration
If you've built an integration for Mattermost, please consider [sharing your work](/developers/integrate/getting-started) in our [Marketplace](https://mattermost.com/marketplace/).
The [Marketplace](https://mattermost.com/marketplace/) lists open source integrations developed by the Mattermost community and are available for download, customization, and deployment to your private cloud or self-hosted infrastructure.

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

View File

@@ -0,0 +1,45 @@
---
title: "Outgoing OAuth connections"
sidebar_position: 30
---
From Mattermost v9.6, you can integrate Mattermost with custom integrations hosted within your internal OAuth infrastructure. More specifically, [slash commands](https://developers.mattermost.com/integrate/slash-commands/custom) now support communicating to external systems using the [Client Credentials](https://oauth.net/2/grant-types/client-credentials) OAuth 2.0 grant type. In a future iteration of this feature, we plan to support [outgoing webhooks](https://developers.mattermost.com/integrate/webhooks/outgoing), [interactive dialogs](https://developers.mattermost.com/integrate/plugins/interactive-dialogs), and [interactive messages](https://developers.mattermost.com/integrate/plugins/interactive-messages).
To configure Mattermost to communicate with your OAuth system, you first need to create an Outgoing OAuth Connection in Mattermost. This involves providing the following values in the connection configuration form:
- `Client Id` & `Client Secret`
- `Token URL` - The URL that Mattermost will contact to retrieve a new token for each request to your integration.
- `Audience URLs` - The URLs that your custom integration hosts to process requests, e.g. slash command submission requests.
Once this is set up, whenever Mattermost sends a request to your custom integration, Mattermost will first fetch an access token from the `Token URL`, and include the access token in the request to your integration. A new token will be requested for every request sent to your integration.
### Configure the Outgoing OAuth Connection
To configure a new outgoing OAuth connection, navigate to your Mattermost server's integrations backstage console, as shown below, then go to the **Outgoing OAuth 2.0 Connections** tab, and select **Add Outgoing OAuth Connection**. If you don't have the **Integrations** option, integrations may not be enabled on your Mattermost Server, or integrations may be disabled for non-admins. Enable integrations by going to **System Console > Integrations > Integration Management** or ask your Mattermost system admin to do so.
![image](product_switcher.png)
![image](backstage_sidebar.png)
Now we can configure our OAuth connection. With the values configured in the example below, Mattermost will perform the following operations when a user interacts with your integration, e.g. when the user submits a slash command associated with your integration.
- Mattermost will request an access token from `Token URL`, by providing the `Client Id` and `Client Secret` via a URL-encoded form submission.
- Mattermost will send a request to your slash command submission handler, with the access token in the request's `Authorization` HTTP header, in the format of `Bearer (token)`.
In the future, any further requests to your integration (such as interactive dialog submissions) will perform the above steps as well.
Notice that the `Audience URL` configured below ends in a wildcard `*`. This means that an access token will be retrieved for any integration request that matches that URL, i.e. any URL that has the prefix of the string leading up to the `*` character. If you would like to restrict the OAuth connection to exact URLs, simply omit the `*`, and supply the exact URLs you would like to configure for your integration. You can come back to this form to update these values at any time. Note that the `Client Secret` will not be shown again when you return to this form.
You can validate that the connection is set up properly by selecting the **Validate Connection** button. This will cause Mattermost to request a token from the `Token URL` using the provided credentials. If a token is retrieved successfully, a **Validated Connection** message will be shown in the UI. If the token retrieval was unsuccessful for any reason, an error will be shown in the UI. Note that validating the connection here is optional, though a warning will be shown upon submitting the form if the connection was not validated before submission.
![image](add_outgoing_oauth_connection_form.png)
![image](edit_outgoing_oauth_connection_form.png)
### Configure a Slash Command to use the Outgoing OAuth Connection
In order to configure your custom Slash Command to use the OAuth connection, we just need to provide a request URL that matches the `Audience URL` provided in the OAuth connection form. If you have at least one OAuth connection configured on your Mattermost instance, you will see a message in the slash command configuration form stating whether or not your slash command will use a configured OAuth connection.
![image](slash_command_form_not_connected.png)
![image](slash_command_form_connection.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

View File

@@ -0,0 +1,27 @@
---
title: "Slack compatibility"
sidebar_position: 40
---
Mattermost makes it easy to migrate integrations written for Slack to Mattermost.
## Translate Slack's data format to Mattermost
Mattermost automatically translates the data coming from Slack:
1. JSON responses written for Slack, that contain the following, are translated to Mattermost markdown and rendered equivalently to Slack:
- `<>` to denote a URL link, such as `{"text": "<https://mattermost.com/>"}`.
- `|` within a `<>` to define linked text, such as `{"text": "Click <https://mattermost.com/|here> for a link."}`.
- `<userid>` to trigger a mention to a user, such as `{"text": "<5fb5f7iw8tfrfcwssd1xmx3j7y> this is a notification."}`.
- `<!channel>`, `<!here>`, or `<!all>` to trigger a mention to a channel, such as `{"text": "<!channel> this is a notification."}`.
2. Both the HTTP `POST` and `GET` request bodies sent to a web service are formatted the same as Slack's. This means your Slack integration's receiving function does not need change to be compatible with Mattermost.
## Known Slack compatibility issues
- Using `icon_emoji` to override the username is not supported.
- Referencing channels using `<#CHANNEL_ID>` does not link to the channel.
- `<!everyone>` and `<!group>` are not supported.
- Parameters `mrkdwn`, `parse`, and `link_names` are not supported (Mattermost always converts markdown and automatically links @mentions).
- Bold formatting supplied as `*bold*` is not supported (must be done as `**bold**`).
- Slack assumes default values for some fields if they are not specified by the integration, while Mattermost does not.