public final class SlackApi extends Object
You must configure your Slack API OAuth and Permissions page with a localhost URL like http://localhost:53203/oauth/, passing the same port to this class’ constructor.
| Modifier and Type | Field and Description |
|---|---|
String |
clientId |
String |
clientSecret |
int |
port |
| Constructor and Description |
|---|
SlackApi(String clientId,
String clientSecret,
int port) |
| Modifier and Type | Method and Description |
|---|---|
HttpUrl |
authorizeUrl(String scopes,
HttpUrl redirectUrl,
okio.ByteString state,
String team)
See https://api.slack.com/docs/oauth.
|
OAuthSession |
exchangeCode(String code,
HttpUrl redirectUrl)
See https://api.slack.com/methods/oauth.access.
|
WebSocket |
rtm(HttpUrl url,
WebSocketListener listener)
See https://api.slack.com/rtm.
|
RtmStartResponse |
rtmStart(String accessToken)
See https://api.slack.com/methods/rtm.start.
|
public final String clientId
public final String clientSecret
public final int port
public HttpUrl authorizeUrl(String scopes, HttpUrl redirectUrl, okio.ByteString state, String team)
public OAuthSession exchangeCode(String code, HttpUrl redirectUrl) throws IOException
IOExceptionpublic RtmStartResponse rtmStart(String accessToken) throws IOException
IOExceptionpublic WebSocket rtm(HttpUrl url, WebSocketListener listener)
Copyright © 2017. All Rights Reserved.