Skip to content
Slack Web API explorer.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config
public
script
slack-api-explorer
spec
.gitignore
.rspec
.rubocop.yml
.rubocop_todo.yml
.travis.yml
CHANGELOG.md
CONTRIBUTING.md
DEBUGGING.md
DEPLOYMENT.md
Gemfile
Gemfile.lock
LICENSE.md
Procfile
README.md
Rakefile
app.json
config.ru
slack-api-explorer.rb

README.md

Slack API Explorer

Add to Slack

Or roll your own ...

Build Status

An API explorer for Slack.

You can DM the bot.

Or invite it to a channel.

Post a message into a channel.

Usage

Help

Get help with api help.

Basics

All the commands of slack-ruby-client are supported. The output is JSON.

auth test

{
  "ok": true,
  "url": "https://dblockdotorg.slack.com/",
  "team": "dblock",
  "user": "api",
  "team_id": "T04KB5WQH",
  "user_id": "U0HPMN0GY"
}

Parsing

You can pipe a JSON parser. See jsonpath for detailed syntax.

Your team ID.

auth test | $.team_id

[
  "T04KB5WQH"
]

Names of all unarchived channels.

channels list | $..[?(@.is_archived==false)].name

[
  "demo",
  "general",
  "apiapi",
]

Find out the ID of the #general channel, the easy way.

channels id --channel=#general

{
  "ok": true,
  "channel": {
    "id": "C04KB5X4D"
  }
}

Find out the ID of the #general channel, the hard way.

channels list | $..[?(@.name=="general")].id

[
  "C04KB5X4D"
]

Post a message into the #general channel.

chat postMessage --as_user=true --text="Hello World" --channel=#general

{
  "ok": true,
  "channel": "C034LSACD",
  "ts": "1453588359.000006",
  "message": {
    "type": "message",
    "user": "U0K28DFCY",
    "text": "Hello World",
    "ts": "1453588359.000006"
  }
}

Installation

Create a new Bot Integration under services/new/bot. Note the API token. You will be able to invoke the explorer by the name you give it in the UI above.

Run SLACK_API_TOKEN=<your API token> foreman start

Production Deployment

See DEPLOYMENT

Contributing

This bot is built with slack-ruby-bot. See CONTRIBUTING.

Copyright and License

Copyright (c) 2016-2018, Daniel Doubrovkine, Artsy and Contributors.

This project is licensed under the MIT License.

You can’t perform that action at this time.