scopes.Rmd
slackteams
uses incoming webhook tokens to interact with the Slack API. There are two main methods to create a token.
slackteams::add_team_interactive
to interactively create a token for the R session.Each has their own pros and cons depending on what type of usage you may have
Token Type | User Level | Session Persistent | Manage Multiple Teams in Session | Store Credentials Locally | Depend on External Server |
---|---|---|---|---|---|
Interactive | All | No | Yes | No | No |
BYOT | Intermediate | Yes | No | Yes | No |
This is similar to oauth2 implementation you would see in googlesheets4. The steps are:
R
consoleThis is by far the easiest method.
The main piece that the user controls are the permission scopes the token has attached to it. To help with this we use a yaml file to allow users to define locally what scopes they want to define. {slackteams} comes with its own yaml file with the scopes that are needed to use all of slackverse
.
scopes
channels
: public channels in the workspacegroups
: private channels that your slack app has been added tousers
: people in the workspaceim
: direct messages that your slack app has been added tompim
: group direct messages that your slack app has been added toemoji
: custom emoji in the workspacefiles
: files shared in channels and conversations that your slack app has been added tousergroups
: user groups in the workspacechat
: messages in approved channels & conversationsteam
: team metainformationpermissions
write
access mean that you can post content in a scoperead
access mean that you can view basic information about a scopehistory
access mean that you can view messages and other content in a scopeThe following yaml contains a base
role which contains only read access permissions and slackverse
role containing permissions needed for the packages in slackverse
.
Click the triangle to view the scopes and the permission of each of these roles:
Scopes
base:
- channels:
- read
- users:
- read
- groups:
- read
- mpim:
- read
- im:
- read
- team:
- read
slackverse:
- channels:
- history
- read
- write
- users:
- read
- groups:
- history
- read
- write
- mpim:
- history
- read
- write
- im:
- history
- read
- write
- usergroups:
- read
- chat:
- write
- emoji:
- read
- files:
- read
- write
- team:
- read