Slack public API
doesn't expose any information about huddles.
There is an undocumented API endpoint (https://edgeapi.slack.com/cache/{TEAM_ID}/huddles/info
) returning info about ongoing huddles but it requires user token
for authorization. Bot accounts are not permitted to access this endpoint, so instead the app pretends to be an actual user by using a real user token for authorization.
- Log in to Slack in browser to the desired workspace
- Open network tab and look for requests to
edgeapi.slack.com
- Choose a request and check
request payload
fortoken
- the value of token will start withxoxc-
- Set env variable
SLACK_USER_TOKEN
to the value of the token - From the same request, check the
cookie
tab and copy either the whole cookie or only the needed keys -d
andx
- Set env variable
COOKIE
to the value you get in previous step. The variable should look like this:
COOKIE="d=xoxd-%2BmcyU%2BLTIRdfKO%2BmMboAB9weYlV%2BrzLkXRqrZXTnXzUGzLIBAkyRfcUURrNw8VLXZk7tFHVPa%2BwjIHULIepheLJL65mA3YXXeo9wxRD37Mn8c%2By1VcyWvdBdFoy8m%2B0FZ7X19vSRj534xjv2c0ya9jufd7f8sf7dfy7dsfyd7ffd7fydf%3D; x=enod5kiefgfgfd5mgioqfv8s2.1660519318;"
There are many ways to do that but I believe this is the simplest one:
- Log in to Slack in browser to the desired workspace
- Open console
- Join a huddle in the channel of your choice
- You should see a log of ongoing events, look for a line that looks like this
11:02:47.700 Aug-15 11:02:47.700 [HUDDLES] (T03T0K10A2W) sh_room_join, channelId: C03T0K143RQ, participants: 1
channelId
is yourCHANNEL_ID
and the value in brackets (but without them)(T03T0K10A2W)
isTEAM_ID
. Example:
CHANNEL_ID=C03T0K143RQ
TEAM_ID=T03T0K10A2W
- Go to Slack Apps page
- Click
Create New App
button and selectFrom an app manifest
- Select a workspace - if you don't see your desired workspace, click
Sign into a different workspace
and sign in - Click
Next
and paste the contents ofmanifest.yml
found in the root directory in this repository into theYAML
textarea - Review the changes if you wish and click
Create
- In the
Basic Information
tab, scroll down toApp-Level Tokens
- this is needed forSocket Mode
funcionality, which you'll be using in development - Click
Generate Token and Scopes
. Name the token however you want then clickAdd scope
and selectconnections:write
and then clickGenerate
- You'll see your token, write it down - it will be used as value for
SLACK_APP_TOKEN
env variable - Scroll up to
App Credentials
section and reveal theSigning Secret
value - it will be used asSLACK_SIGNING_SECRET
env variable - Scroll up to
Install your app
, click it then clickInstall to Workspace
button and then clickAllow
- You'll be shown your
Bot User OAuth Token
- the value is used forSLACK_BOT_TOKEN
env variable. If lost, you can access it fromInstall App
orOAuth & Permissions
pages - Inside
Slack app
go to a channel of your choice then and go to options - Go to
Integrations
tab and in theApps
section clickAdd an App
and select your app.
- Add an
.env
file in the root directory and fill it according totemplate.env
- Run your local MongoDB and fill the
MONGO_CONNECTION_STRING
env variable
MONGO_CONNECTION_STRING=mongodb://localhost:27017/{database_name}
Or connect to a remote database
npm install
npm run dev
to compile.ts
files in watch modenpm start