public class Slack extends Object implements AutoCloseable
This class internally uses the OkHttpClient and the client has its own daemon thread for realizing its optimal resource management. When your app needs to close all the threads when shutting down etc, call #close() method to terminate those threads.
If your application depends on the Gson library for JSON manipulation as with this SDK and the app uses the latest version for some reasons, just in case, you may need to check the binary-compatibility among their releases. We don't think any issues happened before but in general, some libraries may break bin-compatibility among major/minor releases.
| Constructor and Description |
|---|
Slack() |
| Modifier and Type | Method and Description |
|---|---|
AuditClient |
audit()
Creates a Audit Logs API client.
|
AuditClient |
audit(String token) |
void |
close() |
SlackConfig |
getConfig() |
SlackHttpClient |
getHttpClient() |
static Slack |
getInstance() |
static Slack |
getInstance(SlackConfig config) |
static Slack |
getInstance(SlackConfig config,
SlackHttpClient httpClient) |
static Slack |
getInstance(SlackHttpClient httpClient) |
MethodsClient |
methods()
Creates a Methods API client.
|
MethodsClient |
methods(String token) |
AsyncMethodsClient |
methodsAsync() |
AsyncMethodsClient |
methodsAsync(String token) |
MethodsStats |
methodsStats(String teamId) |
MethodsStats |
methodsStats(String executorName,
String teamId) |
RTMClient |
rtm(String apiToken)
Creates an RTM API client.
|
RTMClient |
rtmConnect(String apiToken)
Creates an RTM API client using `/rtm.connect`.
|
RTMClient |
rtmConnect(String apiToken,
boolean fullUserInfoRequired)
Creates an RTM API client using `/rtm.connect`.
|
RTMClient |
rtmStart(String apiToken)
Creates an RTM API client using `/rtm.start`.
|
RTMClient |
rtmStart(String apiToken,
boolean fullUserInfoRequired)
Creates an RTM API client using `/rtm.start`.
|
SCIMClient |
scim()
Creates a SCIM API client.
|
SCIMClient |
scim(String token) |
WebhookResponse |
send(String url,
Payload payload)
Send a data to Incoming Webhook endpoint.
|
WebhookResponse |
send(String url,
String payload)
Send a raw JSON body to Incoming Webhook endpoint.
|
StatusClient |
status() |
LegacyStatusClient |
statusLegacy()
Creates a Status API client.
|
public static Slack getInstance()
public static Slack getInstance(SlackConfig config)
public static Slack getInstance(SlackConfig config, SlackHttpClient httpClient)
public static Slack getInstance(SlackHttpClient httpClient)
public SlackConfig getConfig()
public SlackHttpClient getHttpClient()
public void close()
throws Exception
close in interface AutoCloseableExceptionpublic WebhookResponse send(String url, Payload payload) throws IOException
IOExceptionpublic WebhookResponse send(String url, String payload) throws IOException
IOExceptionpublic RTMClient rtm(String apiToken) throws IOException
IOExceptionpublic RTMClient rtmConnect(String apiToken) throws IOException
IOExceptionpublic RTMClient rtmConnect(String apiToken, boolean fullUserInfoRequired) throws IOException
IOExceptionpublic RTMClient rtmStart(String apiToken) throws IOException
IOExceptionpublic RTMClient rtmStart(String apiToken, boolean fullUserInfoRequired) throws IOException
IOExceptionpublic LegacyStatusClient statusLegacy()
public StatusClient status()
public SCIMClient scim()
public SCIMClient scim(String token)
public AuditClient audit()
public AuditClient audit(String token)
public MethodsClient methods()
public MethodsClient methods(String token)
public AsyncMethodsClient methodsAsync()
public AsyncMethodsClient methodsAsync(String token)
public MethodsStats methodsStats(String teamId)
public MethodsStats methodsStats(String executorName, String teamId)
Copyright © 2020. All rights reserved.