/SlackWeb

Enables you to work with Slack via the web-API rather then the regular API. This allows you to automate Slack actions w/o registering an application in your workspace

Primary LanguagePowerShellMIT LicenseMIT

SlackWeb

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.

How to start

  1. Install-Module SlackWeb
  2. Find your web-token and the d-cookie:
    1. Open Developer tools in your preferred web-browser.
    2. Open your Slack team in that web-browser.
    3. In "Developer tools" on the "Network" tab look for a request starting with client.boot image
    4. Click the request, go to the "Payload" tab, copy the value of the "token" parameter: image
    5. Switch to the "Headers" tab and copy the value of the "d" cookie from there: image
  3. 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.

What options are available now

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.