Package com.slack.api.bolt
Class App
java.lang.Object
com.slack.api.bolt.App
A Slack App instance.
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionApp()
App
(AppConfig appConfig, Slack slack, List<Middleware> middlewareList) App
(AppConfig appConfig, ExecutorService executorService, List<Middleware> middlewareList, App.Status status, InstallationService installationService, DefaultTokensRevokedEventHandler tokensRevokedEventHandler, DefaultAppUninstalledEventHandler appUninstalledEventHandler, OAuthStateService oAuthStateService, OpenIDConnectNonceService openIDConnectNonceService, OAuthSuccessHandler oAuthSuccessHandler, OAuthV2SuccessHandler oAuthV2SuccessHandler, OpenIDConnectSuccessHandler openIDConnectSuccessHandler, OAuthErrorHandler oAuthErrorHandler, OAuthAccessErrorHandler oAuthAccessErrorHandler, OAuthV2AccessErrorHandler oAuthV2AccessErrorHandler, OpenIDConnectErrorHandler openIDConnectErrorHandler, OAuthStateErrorHandler oAuthStateErrorHandler, OAuthExceptionHandler oAuthExceptionHandler, OAuthCallbackService oAuthCallbackService) App
(AppConfig appConfig, List<Middleware> middlewareList) -
Method Summary
Modifier and TypeMethodDescriptionasOAuthApp
(boolean enabled) asOpenIDConnectApp
(boolean enabled) attachmentAction
(String callbackId, AttachmentActionHandler handler) attachmentAction
(Pattern callbackId, AttachmentActionHandler handler) blockAction
(String actionId, BlockActionHandler handler) blockAction
(Pattern actionId, BlockActionHandler handler) blockSuggestion
(String actionId, BlockSuggestionHandler handler) blockSuggestion
(Pattern actionId, BlockSuggestionHandler handler) buildAuthorizeUrl
(String state) Get the Slack URL for beginning the OAuth flow, including the query params necessary to identify this application to Slack.buildAuthorizeUrl
(String state, String nonce) protected List<Middleware>
buildDefaultMiddlewareList
(AppConfig config) static App.AppBuilder
builder()
client()
command
(String command, SlashCommandHandler handler) command
(Pattern command, SlashCommandHandler handler) config()
dialogCancellation
(String callbackId, DialogCancellationHandler handler) dialogCancellation
(Pattern callbackId, DialogCancellationHandler handler) dialogSubmission
(String callbackId, DialogSubmissionHandler handler) dialogSubmission
(Pattern callbackId, DialogSubmissionHandler handler) dialogSuggestion
(String callbackId, DialogSuggestionHandler handler) dialogSuggestion
(Pattern callbackId, DialogSuggestionHandler handler) endpoint
(WebEndpoint.Method method, String path, WebEndpointHandler handler) endpoint
(String path, WebEndpointHandler handler) endpoint
(String method, String path, WebEndpointHandler handler) event
(EventHandler<?> handler) event
(Class<E> eventClass, BoltEventHandler<E> handler) The built-in handy way to run operations asynchronously.The default Web API client without any tokens.getOauthInstallationUrl
(String state) Deprecated.getSlack()
Slack instance and its configurations to be used for API calls.globalShortcut
(String callbackId, GlobalShortcutHandler handler) globalShortcut
(Pattern callbackId, GlobalShortcutHandler handler) void
initializer
(String name, Initializer initializer) message
(String pattern, BoltEventHandler<MessageEvent> messageHandler) message
(Pattern pattern, BoltEventHandler<MessageEvent> messageHandler) messageShortcut
(String callbackId, MessageShortcutHandler handler) messageShortcut
(Pattern callbackId, MessageShortcutHandler handler) oauthCallback
(OAuthSuccessHandler handler) oauthCallback
(OAuthV2SuccessHandler handler) oauthCallbackError
(OAuthErrorHandler handler) oauthPersistenceCallback
(OAuthV2SuccessPersistenceCallback persistenceCallback) oauthPersistenceErrorCallback
(OAuthV2SuccessPersistenceErrorCallback persistenceErrorCallback) protected Response
runHandler
(Request slackRequest) protected Response
runMiddleware
(Request request, Response response, Middleware current, LinkedList<Middleware> remaining) service
(InstallationService installationService) service
(OAuthCallbackService oAuthCallbackService) service
(OAuthStateService oAuthStateService) service
(OpenIDConnectNonceService openIDConnectNonceService) slack()
start()
status()
step
(WorkflowStep step) stop()
Deprecated.Deprecated.use
(Middleware middleware) viewClosed
(String callbackId, ViewClosedHandler handler) viewClosed
(Pattern callbackId, ViewClosedHandler handler) viewSubmission
(String callbackId, ViewSubmissionHandler handler) viewSubmission
(Pattern callbackId, ViewSubmissionHandler handler) workflowStepEdit
(String callbackId, WorkflowStepEditHandler handler) workflowStepEdit
(Pattern callbackId, WorkflowStepEditHandler handler) workflowStepExecute
(String pattern, WorkflowStepExecuteHandler handler) workflowStepExecute
(Pattern pattern, WorkflowStepExecuteHandler handler) workflowStepSave
(String callbackId, WorkflowStepSaveHandler handler) workflowStepSave
(Pattern callbackId, WorkflowStepSaveHandler handler)
-
Constructor Details
-
App
public App() -
App
-
App
-
App
-
App
public App(AppConfig appConfig, ExecutorService executorService, List<Middleware> middlewareList, App.Status status, InstallationService installationService, DefaultTokensRevokedEventHandler tokensRevokedEventHandler, DefaultAppUninstalledEventHandler appUninstalledEventHandler, OAuthStateService oAuthStateService, OpenIDConnectNonceService openIDConnectNonceService, OAuthSuccessHandler oAuthSuccessHandler, OAuthV2SuccessHandler oAuthV2SuccessHandler, OpenIDConnectSuccessHandler openIDConnectSuccessHandler, OAuthErrorHandler oAuthErrorHandler, OAuthAccessErrorHandler oAuthAccessErrorHandler, OAuthV2AccessErrorHandler oAuthV2AccessErrorHandler, OpenIDConnectErrorHandler openIDConnectErrorHandler, OAuthStateErrorHandler oAuthStateErrorHandler, OAuthExceptionHandler oAuthExceptionHandler, OAuthCallbackService oAuthCallbackService)
-
-
Method Details
-
getSlack
Slack instance and its configurations to be used for API calls. -
getClient
The default Web API client without any tokens. -
buildDefaultMiddlewareList
-
defaultTokensRevokedEventHandler
-
defaultAppUninstalledEventHandler
-
enableTokenRevocationHandlers
-
buildAuthorizeUrl
Get the Slack URL for beginning the OAuth flow, including the query params necessary to identify this application to Slack.Appends the optional `redirect_uri` query param based on the provided AppConfig to ensure that the correct OAuth redirect URI is selected in cases where a Slack application may have multiple redirect URIs associated with it.
- Parameters:
state
- The OAuth state param- Returns:
- The Slack URL to redirect users to for beginning the OAuth flow
-
buildAuthorizeUrl
- Parameters:
state
- The OAuth state paramnonce
- The OAUth nonce param- Returns:
-
getOauthInstallationUrl
Deprecated.Use #buildAuthorizeUrl(String) instead (this method will be removed in v2.0) -
getWebEndpointHandlers
-
config
-
slack
-
client
-
executorService
The built-in handy way to run operations asynchronously. It's totally fine to use your own one instead. -
status
-
initializer
-
initialize
public void initialize() -
start
-
stop
-
run
- Throws:
Exception
-
use
-
event
-
event
-
message
-
message
-
command
-
command
-
blockAction
-
blockAction
-
blockSuggestion
-
blockSuggestion
-
globalShortcut
-
globalShortcut
-
messageShortcut
-
messageShortcut
-
viewSubmission
-
viewSubmission
-
viewClosed
-
viewClosed
-
step
-
workflowStepEdit
-
workflowStepEdit
-
workflowStepSave
-
workflowStepSave
-
workflowStepExecute
-
workflowStepExecute
-
attachmentAction
-
attachmentAction
-
dialogSubmission
-
dialogSubmission
-
dialogSuggestion
-
dialogSuggestion
-
dialogCancellation
-
dialogCancellation
-
asOAuthApp
-
asOpenIDConnectApp
-
service
-
service
-
service
-
service
-
oauthCallback
-
oauthCallback
-
oauthPersistenceCallback
-
oauthPersistenceErrorCallback
public App oauthPersistenceErrorCallback(OAuthV2SuccessPersistenceErrorCallback persistenceErrorCallback) -
oauthCallbackError
-
oauthCallbackStateError
-
oauthCallbackAccessError
-
oauthCallbackAccessError
-
openIDConnectSuccess
-
openIDConnectError
-
oauthCallbackException
-
toOAuthStartApp
Deprecated. -
toOAuthInstallPathEnabledApp
-
toOAuthCallbackApp
Deprecated. -
toOAuthRedirectUriPathEnabledApp
-
endpoint
-
endpoint
-
endpoint
-
runMiddleware
protected Response runMiddleware(Request request, Response response, Middleware current, LinkedList<Middleware> remaining) throws Exception - Throws:
Exception
-
runHandler
- Throws:
IOException
SlackApiException
-
builder
-
toBuilder
-