Slack Developer Kit for Node.js
Go to GitHub

WebClient

A client for Slack’s Web API

This client provides an alias for each Web API method. Each method is a convenience wrapper for calling the WebClient#apiCall method using the method name as the first parameter.

Kind: static class of @slack/client
Extends: EventEmitter
Properties

Name Type Description
token string | undefined Authentication and authorization token for accessing Slack Web API (usually begins with xoxa, xoxp, or xoxb). This should be treated as readonly. Setting this value is used for refreshing tokens, and it is deprecated.
[refreshToken] string OAuth 2.0 refresh token used to automatically create new access tokens (token) when the current is expired. Deprecated: {tag.description}
[clientId] string OAuth 2.0 client identifier Deprecated: {tag.description}
[clientSecret] string OAuth 2.0 client secret Deprecated: {tag.description}
[slackApiUrl] string The base URL for reaching Slack’s Web API. Consider changing this value for testing purposes.

webClient.apiCall(method, options) ⇒ Promise.<WebAPICallResult>

Generic method for calling a Web API method

Kind: instance method of WebClient

Param Type Description
method string the Web API method to call {@see https://api.slack.com/methods}
options WebAPICallOptions options

webClient.apiCall(method, options, callback)

Kind: instance method of WebClient

Param Type
method string
options WebAPICallOptions
callback WebAPIResultCallback

webClient.apiCall(method, options, callback)

Kind: instance method of WebClient

Param Type
method string
options WebAPICallOptions
callback WebAPIResultCallback