Skip to content

Instantly share code, notes, and snippets.

@treeder
Created July 20, 2015 17:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save treeder/badf15f4343a1c81f45d to your computer and use it in GitHub Desktop.
Save treeder/badf15f4343a1c81f45d to your computer and use it in GitHub Desktop.
Simple script to list all your slack channels. Good way to get the id.
require 'rest-client'
r = RestClient.post "https://yourskinbox.slack.com/api/channels.list",
{
:token => 'API_TOKEN'
}
r = JSON.parse(r)
r['channels'].each do |c|
puts "#{c['name']} - id: #{c['id']}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment