docs: update links to go to new api docs site (#428)
Co-authored-by: haleychaas <[email protected]>
This commit is contained in:
co-authored by
haleychaas
parent
d07fadf6b9
commit
7cbfbe97de
@@ -74,7 +74,7 @@ The `proxy` option can also be provided with the `HTTPS_PROXY` or `https_proxy`
|
||||
|
||||
## Retrying failed requests
|
||||
|
||||
Sometimes outgoing requests fail due to [rate limits](https://api.slack.com/apis/rate-limits) or similar [HTTP responses](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) and can be retried later.
|
||||
Sometimes outgoing requests fail due to [rate limits](https://docs.slack.dev/apis/web-api/rate-limits) or similar [HTTP responses](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) and can be retried later.
|
||||
|
||||
The `retries` option can be configured to the needs of your workflow with one of these values:
|
||||
|
||||
|
||||
+10
-10
@@ -4,20 +4,20 @@ sidebar_label: Overview
|
||||
|
||||
# Sending data using a Slack API method
|
||||
|
||||
A bot token or user token or [token of some other kind](https://api.slack.com/concepts/token-types) must be used to call one of [the Slack API methods](https://api.slack.com/methods) with this technique.
|
||||
A bot token or user token or [token of some other kind](https://docs.slack.dev/authentication/tokens) must be used to call one of [the Slack API methods](https://docs.slack.dev/reference/methods) with this technique.
|
||||
|
||||
## Setup
|
||||
|
||||
Different [Slack API methods](https://api.slack.com/methods) require different [scopes](https://api.slack.com/scopes), but setup should be similar for all methods:
|
||||
Different [Slack API methods](https://docs.slack.dev/reference/methods) require different [scopes](https://docs.slack.dev/reference/scopes), but setup should be similar for all methods:
|
||||
|
||||
1. [Create a Slack app](https://api.slack.com/apps/new) for your workspace or use an existing app.
|
||||
2. Depending on the Slack API [method](https://api.slack.com/methods) you wish to call, add the required **scopes** to your app under the **OAuth & Permissions** page on [app settings](https://api.slack.com/apps).
|
||||
2. Depending on the Slack API [method](https://docs.slack.dev/reference/methods) you wish to call, add the required **scopes** to your app under the **OAuth & Permissions** page on [app settings](https://api.slack.com/apps).
|
||||
3. Install the app to your workspace using the **Install App** page.
|
||||
4. Once your app is installed to a workspace, a new [token](https://api.slack.com/concepts/token-types) with your app's specified scopes will be minted for that workspace. It is worth noting that tokens are only valid for a single workspace! Find the token on the **OAuth & Permissions** page.
|
||||
4. Once your app is installed to a workspace, a new [token](https://docs.slack.dev/authentication/tokens) with your app's specified scopes will be minted for that workspace. It is worth noting that tokens are only valid for a single workspace! Find the token on the **OAuth & Permissions** page.
|
||||
5. Add the token as [a repository secret](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository) called `SLACK_BOT_TOKEN` or something similar and memorable.
|
||||
6. [Add this Action as a step](https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idsteps) to your GitHub workflow and provide an input payload to send to the method.
|
||||
|
||||
Methods that require an app configuration token should gather this token from the [app configuration token](https://api.slack.com/reference/manifests#config-tokens) settings instead of from a specific app since this token is associated with the workspace.
|
||||
Methods that require an app configuration token should gather this token from the [app configuration token](https://docs.slack.dev/app-manifests/configuring-apps-with-app-manifests#config-tokens) settings instead of from a specific app since this token is associated with the workspace.
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -25,7 +25,7 @@ Choosing inputs for these steps is left as an exercise for the actioneer since e
|
||||
|
||||
### Posting a message with text
|
||||
|
||||
Posting a message with the [`chat.postMessage`](https://api.slack.com/methods/chat.postMessage) method can be achieved by adding this step to a job in your GitHub workflow and inviting the bot associated with your app to the channel for posting:
|
||||
Posting a message with the [`chat.postMessage`](https://docs.slack.dev/reference/methods/chat.postMessage) method can be achieved by adding this step to a job in your GitHub workflow and inviting the bot associated with your app to the channel for posting:
|
||||
|
||||
```yaml
|
||||
- name: Post text to a Slack channel
|
||||
@@ -40,7 +40,7 @@ Posting a message with the [`chat.postMessage`](https://api.slack.com/methods/ch
|
||||
|
||||
### Posting a message with blocks
|
||||
|
||||
More complex message layouts, such as messages made with [Block Kit](https://api.slack.com/surfaces/messages#complex_layouts) blocks, can also be sent with one of the Slack API methods:
|
||||
More complex message layouts, such as messages made with [Block Kit](https://docs.slack.dev/block-kit/) blocks, can also be sent with one of the Slack API methods:
|
||||
|
||||
```yaml
|
||||
- name: Post blocks to a Slack channel
|
||||
@@ -60,7 +60,7 @@ More complex message layouts, such as messages made with [Block Kit](https://api
|
||||
|
||||
### Updating a message
|
||||
|
||||
Updating a message after it's posted can be done with the [`chat.update`](https://api.slack.com/methods/chat.update) method and chaining multiple steps together using outputs from past steps as inputs to current ones:
|
||||
Updating a message after it's posted can be done with the [`chat.update`](https://docs.slack.dev/reference/methods/chat.update) method and chaining multiple steps together using outputs from past steps as inputs to current ones:
|
||||
|
||||
```yaml
|
||||
- name: Initiate the deployment launch sequence
|
||||
@@ -99,7 +99,7 @@ Updating a message after it's posted can be done with the [`chat.update`](https:
|
||||
|
||||
### Replying to a message
|
||||
|
||||
Posting [threaded replies to a message](https://api.slack.com/messaging/sending#threading) from a past job can be done by including the `thread_ts` attribute of the parent message in the `payload`:
|
||||
Posting [threaded replies to a message](https://docs.slack.dev/messaging/#threading) from a past job can be done by including the `thread_ts` attribute of the parent message in the `payload`:
|
||||
|
||||
```yaml
|
||||
- name: Initiate a deployment
|
||||
@@ -124,7 +124,7 @@ Posting [threaded replies to a message](https://api.slack.com/messaging/sending#
|
||||
|
||||
### Uploading a file
|
||||
|
||||
Calling [a Slack API method](https://api.slack.com/methods) with [`@slack/web-api`](https://tools.slack.dev/node-slack-sdk/web-api) makes [uploading a file](https://api.slack.com/messaging/files#upload) just another API call with all of the convenience of the [`files.uploadV2`](https://tools.slack.dev/node-slack-sdk/web-api/#upload-a-file) method:
|
||||
Calling [a Slack API method](https://docs.slack.dev/reference/methods) with [`@slack/web-api`](https://tools.slack.dev/node-slack-sdk/web-api) makes [uploading a file](https://docs.slack.dev/messaging/working-with-files#uploading_files) just another API call with all of the convenience of the [`files.uploadV2`](https://tools.slack.dev/node-slack-sdk/web-api/#upload-a-file) method:
|
||||
|
||||
```yaml
|
||||
- name: Share a file to that channel
|
||||
|
||||
+4
-4
@@ -4,16 +4,16 @@ sidebar_label: Overview
|
||||
|
||||
# Sending data as a message with a Slack incoming webhook URL
|
||||
|
||||
This technique uses this Action to post a message to a channel or direct message with [incoming webhooks](https://api.slack.com/messaging/webhooks) and a Slack app.
|
||||
This technique uses this Action to post a message to a channel or direct message with [incoming webhooks](https://docs.slack.dev/messaging/sending-messages-using-incoming-webhooks) and a Slack app.
|
||||
|
||||
Incoming webhooks follow the same [formatting](https://api.slack.com/reference/surfaces/formatting) patterns as other Slack messaging APIs. Posted messages can be as short as a single line of text, include additional interactivity with [interactive components](https://api.slack.com/messaging/interactivity), or be formatted with [Block Kit](https://api.slack.com/surfaces/messages#complex_layouts) to build visual components.
|
||||
Incoming webhooks follow the same [formatting](https://docs.slack.dev/apis/) patterns as other Slack messaging APIs. Posted messages can be as short as a single line of text, include additional interactivity with [interactive components](https://docs.slack.dev/messaging/creating-interactive-messages), or be formatted with [Block Kit](https://docs.slack.dev/block-kit/) to build visual components.
|
||||
|
||||
## Setup
|
||||
|
||||
Gather a Slack incoming webhook URL:
|
||||
|
||||
1. [Create a Slack app](https://api.slack.com/apps/new) for your workspace or use an existing app.
|
||||
2. Add the [`incoming-webhook`](https://api.slack.com/scopes/incoming-webhook) bot scope under **OAuth & Permissions** page on [app settings](https://api.slack.com/apps).
|
||||
2. Add the [`incoming-webhook`](https://docs.slack.dev/reference/scopes/incoming-webhook) bot scope under **OAuth & Permissions** page on [app settings](https://api.slack.com/apps).
|
||||
3. Install the app to your workspace and select a channel to notify from the **Install App** page.
|
||||
4. Create additional webhooks from the **Incoming Webhooks** page.
|
||||
5. Add the generated incoming webhook URL as [a repository secret](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository) called `SLACK_WEBHOOK_URL`.
|
||||
@@ -27,7 +27,7 @@ https://hooks.slack.com/services/T0123456789/B1001010101/7IsoQTrixdUtE971O1xQTm4
|
||||
|
||||
## Usage
|
||||
|
||||
Add the collected webhook from above to a GitHub workflow and configure the step using [`mrkdwn`](https://api.slack.com/reference/surfaces/formatting) formatting values for a message or [Block Kit](https://api.slack.com/surfaces/messages#complex_layouts) blocks:
|
||||
Add the collected webhook from above to a GitHub workflow and configure the step using [`mrkdwn`](https://docs.slack.dev/messaging/formatting-message-text) formatting values for a message or [Block Kit](https://docs.slack.dev/block-kit/) blocks:
|
||||
|
||||
```yaml
|
||||
- name: Post a message in a channel
|
||||
|
||||
@@ -20,15 +20,15 @@ The following outputs are returned with each of the techniques:
|
||||
|---|---|---|
|
||||
|`time` | `number` | The Unix [epoch time](https://en.wikipedia.org/wiki/Unix_time) that the step completed.
|
||||
| `ok` | `boolean` | If the request completed with success.
|
||||
| `response` | `string` | The [response](https://api.slack.com/web#responses) from the request as stringified JSON.
|
||||
| `response` | `string` | The [response](https://docs.slack.dev/apis/web-api/#responses) from the request as stringified JSON.
|
||||
|
||||
While these outputs are returned with certain Slack API methods:
|
||||
|
||||
| Output | Type | Description|
|
||||
|---|---|---|
|
||||
|`channel_id` | `string` | The [channel ID](https://api.slack.com/types/conversation) included in the response.
|
||||
| `ts`| `string` | The [timestamp](https://api.slack.com/messaging/retrieving#individual_messages) of the Slack event or message.
|
||||
| `thread_ts` | `string` | The [timestamp](https://api.slack.com/messaging/retrieving#individual_messages) of a parent Slack message with [threaded replies](https://api.slack.com/messaging/retrieving#finding_threads).
|
||||
|`channel_id` | `string` | The [channel ID](https://docs.slack.dev/reference/objects/conversation-object) included in the response.
|
||||
| `ts`| `string` | The [timestamp](https://docs.slack.dev/messaging/retrieving-messages#individual_messages) of the Slack event or message.
|
||||
| `thread_ts` | `string` | The [timestamp](https://docs.slack.dev/messaging/retrieving-messages#individual_messages) of a parent Slack message with [threaded replies](https://docs.slack.dev/messaging/retrieving-messages#pulling_threads).
|
||||
|
||||
## Example responses
|
||||
|
||||
|
||||
Reference in New Issue
Block a user