Module: ko/share/slack/api

api methods for ko/share/slack

Methods


require("ko/share/slack/api").deleteKey()

Delete the currently saved key. Just incase. May be used later if we need to handle invalid keys.


require("ko/share/slack/api").getChannels(callback)

Retrieve the list of available channels for the authenticated user and save it to the prefs. Just pull them from the prefs if they are already there.

Parameters:
Name Type Description
callback function

function to do something with the return channels. This callback gets passed a array of channel objects

channels = { Groups: [ { name:"bestgroup", id:"G01982739" } ], Channels: [ { name:"BestChannel", id:"C01982730" } ] Users: [ { name:"Carey", id:"W01982730" } ] }


require("ko/share/slack/api").post(params, callback)

Post your file to Slack

Parameters:
Name Type Description
params Object

params to push a file

callback function

function run when post is complete


require("ko/share/slack/api").saveKey()

Save the API key Only saves one key. Deletes the previously saved key if it exists.