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
Making calls to the Slack API often requires a [token](https://docs.slack.dev/authentication/tokens) with associated scopes that grant access to resources.
46
+
47
+
Collecting a token can be done from app settings or with an OAuth installation depending on your app's requirements:
@@ -85,13 +91,11 @@ Credentials](https://api.slack.com/authentication/best-practices) page within th
85
91
86
92
### Single Workspace Install
87
93
88
-
If you're building an application for a single Slack workspace,
89
-
there's no need to build out the entire OAuth flow.
94
+
If you're building an application for a single Slack workspace, there's no need to build out the entire OAuth flow.
95
+
96
+
After [creating an app](https://api.slack.com/apps?new_app=1) and adding [scopes](http://docs.slack.dev/reference/scopes) on the **OAuth & Permissions** page, go to the **Install App** page and click the **Install to Team** button to authorize the app and generate a token.
90
97
91
-
Once you've setup your features, click on the **Install App to Team**
92
-
button found on the **Install App** page. If you add new permission
93
-
scopes or Slack app features after an app has been installed, you must
94
-
reinstall the app to your workspace for changes to take effect.
98
+
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 changes to take effect.
95
99
96
100
## Multiple Workspace Install
97
101
@@ -109,9 +113,9 @@ token once it is granted. The client ID and client secret are available
109
113
from your [app's configuration page](https://api.slack.com/apps). The
110
114
scopes are determined by the functionality of the app — every method
111
115
you wish to access has a corresponding scope and your app will need to
112
-
request that scope in order to be able to access the method. Review the [full list of Slack OAuth scopes](https://api.slack.com/scopes).
116
+
request that scope in order to be able to access the method. Review the [full list of Slack OAuth scopes](http://docs.slack.dev/reference/scopes).
113
117
114
-
```python
118
+
```python
115
119
import os
116
120
from slack_sdk import WebClient
117
121
from flask import Flask, request
@@ -136,7 +140,7 @@ This link directs the user to the Slack OAuth acceptance page, where the
136
140
user will review and accept or refuse the permissions your app is
137
141
requesting as defined by the scope(s).
138
142
139
-
```python
143
+
```python
140
144
@app.route("/slack/install", methods=["GET"])
141
145
defpre_install():
142
146
state ="randomly-generated-one-time-value"
@@ -154,7 +158,7 @@ will redirect the user to your auth completion page, which includes a
154
158
[endpoint](https://api.slack.com/methods/oauth.v2.access) that will
0 commit comments