This module allows you to automate Slack tasks (at least some!) w/o the need to register an application in your Slack workspace. All what you need is a regular user account. No need for an approval from your space administrator!
It is possible by utilizing the Slack Web API - the API which the web-client uses. To execute methods of that API you need two pieces of authentication material: your user token (starts with "xoxc-") and one of your cookies (a so called "d-cookie").
DISCLAMER: the API-calls are reverse-engineered - the module may stop working any moment. Please use at your own risk.
Install-Module SlackWeb
- Find your web-token and the d-cookie:
- Open Developer tools in your preferred web-browser.
- Open your Slack team in that web-browser.
- In "Developer tools" on the "Network" tab look for a request starting with client.boot
- Click the request, go to the "Payload" tab, copy the value of the "token" parameter:
- Switch to the "Headers" tab and copy the value of the "d" cookie from there:
- Import the module. It will ask you for values for the token and the cookie. If you want to change them later, use
Set-SlackWebConfiguration
.
That's it: no need to manually specify your team - the module detects it automatically from your authentication data.
Currently the module allows you to:
- send messages (
Send-SlackWebMessage
), - get/search for a channel (
Get-SlackWebChannel
), - get/export history from channels, direct messages, group messages (
Get-SlackWebChannelMessages
,Export-SlackWebChannelHistory
); - get/export accounts from your workspace and all workspaces connected to it (
Get-SlackWebPeople
,Export-SlackWebPeople
).
Please suggest what features you would like to see next by creating issues in this repo.