You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the default settings, only `ConnectionErrorRetryHandler` with its default configuration (=only one retry in the manner of [exponential backoff and jitter](https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/)) is enabled. The retry handler retries if an API client encounters a connectivity-related failure (e.g., connection reset by peer).
You can also create one on your own by defining a new class that inherits `slack_sdk.http_retryRetryHandler` (`AsyncRetryHandler` for asyncio apps) and implements required methods (internals of `can_retry` / `prepare_for_next_retry`). Check out the source code for the ones that are built in to learn how to properly implement them.
70
+
You can also create one on your own by defining a new class that inherits `slack_sdk.http_retry.RetryHandler` (`AsyncRetryHandler` for asyncio apps) and implements required methods (internals of `can_retry` / `prepare_for_next_attempt`). Check out the source code for the ones that are built in to learn how to properly implement them.
71
71
72
72
```python
73
73
import socket
@@ -100,4 +100,4 @@ client = AuditLogsClient(
100
100
)
101
101
```
102
102
103
-
For asyncio apps, `Async` prefixed corresponding modules are available. All the methods in those methods are async/await compatible. Check [the source code](https://github.com/slackapi/python-slack-sdk/blob/main/slack_sdk/http_retry/async_handler.py) for more details.
103
+
For asyncio apps, `Async` prefixed corresponding modules are available. All the methods in those modules are async/await compatible. Check [the source code](https://github.com/slackapi/python-slack-sdk/blob/main/slack_sdk/http_retry/async_handler.py) for more details.
Copy file name to clipboardExpand all lines: docs/english/index.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ The Slack Python SDK has corresponding packages for Slack APIs. They are small a
4
4
5
5
The Slack platform offers several APIs to build apps. Each Slack API delivers part of the capabilities from the platform, so that you can pick just those that fit your needs.
6
6
7
-
## Features {#features}
7
+
## Features {/*#features*/}
8
8
9
9
| Feature | Use | Package |
10
10
|---|---|---|
@@ -20,7 +20,7 @@ The Slack platform offers several APIs to build apps. Each Slack API delivers pa
20
20
21
21
You can also view the [Python module documents](https://docs.slack.dev/tools/python-slack-sdk/reference)!
22
22
23
-
## Getting help {#getting-help}
23
+
## Getting help {/*#getting-help*/}
24
24
25
25
These docs have lots of information on the Python Slack SDK. There's also an in-depth Reference section. Please explore!
26
26
@@ -29,7 +29,7 @@ If you get stuck, we're here to help. The following are the best ways to get ass
29
29
*[Issue Tracker](http://github.com/slackapi/python-slack-sdk/issues) for questions, bug reports, feature requests, and general discussion related to the Python Slack SDK. Try searching for an existing issue before creating a new one.
30
30
*[Email](mailto:support@slack.com) our developer support team: `support@slack.com`.
31
31
32
-
## Contributing {#contributing}
32
+
## Contributing {/*#contributing*/}
33
33
34
34
These docs live within the [Python Slack SDK](https://github.com/slackapi/python-slack-sdk) repository and are open source.
Copy file name to clipboardExpand all lines: docs/english/installation.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ python test.py
39
39
40
40
It's also good to try on the Python REPL.
41
41
42
-
## Access tokens {#handling-tokens}
42
+
## Access tokens {/*#handling-tokens*/}
43
43
44
44
Making calls to the Slack API often requires a [token](/authentication/tokens) with associated scopes that grant access to resources. Collecting a token can be done from app settings or with an OAuth installation depending on your app's requirements.
Refer to our [best practices for security](/security) page for more information.
73
73
74
-
## Installing on a single workspace {#single-workspace}
74
+
## Installing on a single workspace {/*#single-workspace*/}
75
75
76
76
If you're building an application for a single Slack workspace, there's no need to build out the entire OAuth flow. Once you've set up your features, click the **Install App to Team** button on the **Install App** page. If you add new permission scopes or Slack app features after an app has been installed, you must reinstall the app to your workspace for the changes to take effect.
77
77
78
78
Refer to the [Slack quickstart](/quickstart) guide for more details.
79
79
80
-
## Installing on multiple workspaces {#multi-workspace}
80
+
## Installing on multiple workspaces {/*#multi-workspace*/}
81
81
82
82
If you intend for an app to be installed on multiple Slack workspaces, you will need to handle this installation via the industry-standard OAuth protocol. Read more about [installing with OAuth](/authentication/installing-with-oauth).
To begin the OAuth flow that will install your app on a workspace, you'll need to provide the user with a link to the Slack OAuth page. This can be a simple link to `https://slack.com/oauth/v2/authorize` with the
103
103
`scope` and `client_id` query parameters.
@@ -113,7 +113,7 @@ def pre_install():
113
113
'Add to Slack</a>'
114
114
```
115
115
116
-
### The OAuth completion page {#oauth-completion}
116
+
### The OAuth completion page {/*#oauth-completion*/}
117
117
118
118
Once the user has agreed to the permissions you've requested, Slack will redirect the user to your auth completion page, which includes a `code` query string parameter. You'll use the `code` parameter to call the [`oauth.v2.access`](/reference/methods/oauth.v2.access) API method that will grant you the token.
119
119
@@ -172,7 +172,7 @@ Once your user has completed the OAuth flow, you'll be able to use the provided
172
172
173
173
Refer to the [basic usage](/tools/python-slack-sdk/legacy/basic_usage) page for more examples.
Refer to our [best practices for security](/security) page for more information.
35
35
36
-
## Installing on a single workspace {#single-workspace}
36
+
## Installing on a single workspace {/*#single-workspace*/}
37
37
38
38
If you're building an application for a single Slack workspace, there's no need to build out the entire OAuth flow. Once you've set up your features, click the **Install App to Team** button on the **Install App** page. If you add new permission scopes or Slack app features after an app has been installed, you must reinstall the app to your workspace for the changes to take effect.
39
39
40
40
Refer to the [quickstart](/quickstart) guide for more details.
41
41
42
-
## Installing on multiple workspaces {#multi-workspace}
42
+
## Installing on multiple workspaces {/*#multi-workspace*/}
43
43
44
44
If you intend for an app to be installed on multiple Slack workspaces, you will need to handle this installation via the industry-standard OAuth protocol. Read more about [installing with OAuth](/authentication/installing-with-oauth).
To begin the OAuth flow that will install your app on a workspace, you'll need to provide the user with a link to the Slack OAuth page. This can be a simple link to `https://slack.com/oauth/v2/authorize` with the
65
65
`scope` and `client_id` query parameters.
@@ -75,7 +75,7 @@ def pre_install():
75
75
'Add to Slack</a>'
76
76
```
77
77
78
-
### The OAuth completion page {#oauth-completion}
78
+
### The OAuth completion page {/*#oauth-completion*/}
79
79
80
80
Once the user has agreed to the permissions you've requested, Slack will redirect the user to your auth completion page, which includes a `code` query string parameter. You'll use the `code` parameter to call the [`oauth.v2.access`](/reference/methods/oauth.v2.access) API method that will grant you the token.
Copy file name to clipboardExpand all lines: docs/english/legacy/basic_usage.md
+17-17Lines changed: 17 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ Accessing Slack API methods requires an OAuth token — read more about [install
12
12
13
13
Each of these [API methods](/reference/methods) is fully documented on our developer site at [docs.slack.dev](/).
14
14
15
-
## Sending a message {#sending-messages}
15
+
## Sending a message {/*#sending-messages*/}
16
16
17
17
One of the primary uses of Slack is posting messages to a channel using the channel ID, or as a DM to another person using their user ID. This method will handle either a channel ID or a user ID passed to the `channel` parameter.
See the [`chat.postEphemeral`](/reference/methods/chat.postEphemeral) API method for more details.
57
57
58
-
## Formatting messages with Block Kit {#block-kit}
58
+
## Formatting messages with Block Kit {/*#block-kit*/}
59
59
60
60
Messages posted from apps can contain more than just text; they can also include full user interfaces composed of blocks using [Block Kit](/block-kit).
61
61
@@ -104,7 +104,7 @@ client.chat_postMessage(
104
104
105
105
:::
106
106
107
-
## Threading messages {#threading-messages}
107
+
## Threading messages {/*#threading-messages*/}
108
108
109
109
Threaded messages are a way of grouping messages together to provide greater context. You can reply to a thread or start a new threaded conversation by simply passing the original message's `ts` ID in the `thread_ts` attribute when posting a message. If you're replying to a threaded message, you'll pass the `thread_ts` ID of the message you're replying to.
110
110
@@ -137,7 +137,7 @@ When appearing in the channel, it won't contain any attachments or message butto
137
137
138
138
Refer to the [threading messages](/messaging#threading) page for more information.
139
139
140
-
## Updating a message {#updating-messages}
140
+
## Updating a message {/*#updating-messages*/}
141
141
142
142
Let's say you have a bot that posts the status of a request. When that request changes, you'll want to update the message to reflect it's state.
See the [`chat.update`](/reference/methods/chat.update) API method for formatting options and some special considerations when calling this with a bot user.
See the [`chat.delete`](/reference/methods/chat.delete) API method for more
166
166
details.
167
167
168
-
## Opening a modal {#opening-modals}
168
+
## Opening a modal {/*#opening-modals*/}
169
169
170
170
Modals allow you to collect data from users and display dynamic information in a focused surface. Modals use the same blocks that compose messages, with the addition of an `input` block.
171
171
@@ -244,14 +244,14 @@ if __name__ == "__main__":
244
244
app.run("localhost", 3000)
245
245
```
246
246
247
-
See the [`views.open`](/reference/methods/views.open) API method more details and additional parameters.
247
+
See the [`views.open`](/reference/methods/views.open) API method for more details and additional parameters.
248
248
249
249
To run the above example, the following [app configurations](https://api.slack.com/apps) are required:
250
250
251
251
* Enable **Interactivity** with a valid Request URL: `https://{your-public-domain}/slack/events`
252
252
* Add a global shortcut with the callback ID: `open-modal-shortcut`
253
253
254
-
## Updating and pushing modals {#updating-pushing-modals}
254
+
## Updating and pushing modals {/*#updating-pushing-modals*/}
255
255
256
256
You can dynamically update a view inside of a modal by calling the `views.update` API method and passing the view ID returned in the previous `views.open` API method call.
257
257
@@ -298,7 +298,7 @@ See the [`views.update`](/reference/methods/views.update) API method for more de
298
298
299
299
If you want to push a new view onto the modal instead of updating an existing view, see the [`views.push`](/reference/methods/views.push) API method.
300
300
301
-
## Emoji reactions {#emoji}
301
+
## Emoji reactions {/*#emoji*/}
302
302
303
303
You can quickly respond to any message on Slack with an emoji reaction. Reactions can be used for any purpose: voting, checking off to-do items, showing excitement, or just for fun.
See the [`reactions.add`](/reference/methods/reactions.add) and [`reactions.remove`](/reference/methods/reactions.remove) API methods for more details.
326
326
327
-
## Listing public channels {#listing-public-channels}
327
+
## Listing public channels {/*#listing-public-channels*/}
328
328
329
329
At some point, you'll want to find out what channels are available to your app. This is how you get that list.
See the [`files.upload`](/reference/methods/files.upload) API method for more details.
398
398
399
-
## Calling API methods {#calling-API-methods}
399
+
## Calling API methods {/*#calling-API-methods*/}
400
400
401
401
This library covers all the public endpoints as the methods in `WebClient`. That said, you may see a bit of a delay with the library release. When you're in a hurry, you can directly use the `api_call` method as below.
When posting messages to a channel, Slack allows apps to send no more than one message per channel per second. We allow bursts over that limit for short periods; however, if your app continues to exceed the limit over a longer period of time, it will be rate limited. Different API methods have other limits — be sure to check the [rate limits](/apis/web-api/rate-limits) and test that your app has a graceful fallback if it should hit those limits.
0 commit comments