Package com.slack.api.bolt
Class App
java.lang.Object
com.slack.api.bolt.App
A Slack App instance.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionApp()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, AssistantThreadContextService assistantThreadContextService) Creates a newAppinstance.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.AppBuilderbuilder()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, boolean allowMultipleEventHandlers, BoltEventHandler<E> handler) event(Class<E> eventClass, BoltEventHandler<E> handler) The built-in handy way to run operations asynchronously.function(String callbackId, BoltEventHandler<FunctionExecutedEvent> handler) function(Pattern callbackId, BoltEventHandler<FunctionExecutedEvent> handler) 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) voidinitializer(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 ResponserunHandler(Request slackRequest) protected ResponserunMiddleware(Request request, Response response, Middleware current, LinkedList<Middleware> remaining) service(AssistantThreadContextService assistantThreadContextService) service(InstallationService installationService) service(OAuthCallbackService oAuthCallbackService) service(OAuthStateService oAuthStateService) service(OpenIDConnectNonceService openIDConnectNonceService) slack()start()status()step(WorkflowStep step) Deprecated.Use new custom steps: https://docs.slack.dev/workflows/workflow-stepsstop()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) Deprecated.Use new custom steps: https://docs.slack.dev/workflows/workflow-stepsworkflowStepEdit(Pattern callbackId, WorkflowStepEditHandler handler) Deprecated.Use new custom steps: https://docs.slack.dev/workflows/workflow-stepsworkflowStepExecute(String pattern, WorkflowStepExecuteHandler handler) Deprecated.Use new custom steps: https://docs.slack.dev/workflows/workflow-stepsworkflowStepExecute(Pattern pattern, WorkflowStepExecuteHandler handler) Deprecated.Use new custom steps: https://docs.slack.dev/workflows/workflow-stepsworkflowStepSave(String callbackId, WorkflowStepSaveHandler handler) Deprecated.Use new custom steps: https://docs.slack.dev/workflows/workflow-stepsworkflowStepSave(Pattern callbackId, WorkflowStepSaveHandler handler) Deprecated.Use new custom steps: https://docs.slack.dev/workflows/workflow-steps
-
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, AssistantThreadContextService assistantThreadContextService) Creates a newAppinstance.- Parameters:
appConfig- The given AppConfig in this App.executorService- The built-in handy way to run operations asynchronously. It's totally fine to use your own one instead.middlewareList- Registered middleware.status- Current status of this App.installationService-tokensRevokedEventHandler-appUninstalledEventHandler-oAuthStateService-openIDConnectNonceService-oAuthSuccessHandler-oAuthV2SuccessHandler-openIDConnectSuccessHandler-oAuthErrorHandler-oAuthAccessErrorHandler-oAuthV2AccessErrorHandler-openIDConnectErrorHandler-oAuthStateErrorHandler-oAuthExceptionHandler-oAuthCallbackService-assistantThreadContextService-
-
-
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
-
assistant
-
event
-
event
protected <E extends Event> App event(Class<E> eventClass, boolean allowMultipleEventHandlers, BoltEventHandler<E> handler) -
event
-
function
-
function
-
message
-
message
-
command
-
command
-
blockAction
-
blockAction
-
blockSuggestion
-
blockSuggestion
-
globalShortcut
-
globalShortcut
-
messageShortcut
-
messageShortcut
-
viewSubmission
-
viewSubmission
-
viewClosed
-
viewClosed
-
step
Deprecated.Use new custom steps: https://docs.slack.dev/workflows/workflow-steps -
workflowStepEdit
Deprecated.Use new custom steps: https://docs.slack.dev/workflows/workflow-steps -
workflowStepEdit
Deprecated.Use new custom steps: https://docs.slack.dev/workflows/workflow-steps -
workflowStepSave
Deprecated.Use new custom steps: https://docs.slack.dev/workflows/workflow-steps -
workflowStepSave
Deprecated.Use new custom steps: https://docs.slack.dev/workflows/workflow-steps -
workflowStepExecute
Deprecated.Use new custom steps: https://docs.slack.dev/workflows/workflow-steps -
workflowStepExecute
Deprecated.Use new custom steps: https://docs.slack.dev/workflows/workflow-steps -
attachmentAction
-
attachmentAction
-
dialogSubmission
-
dialogSubmission
-
dialogSuggestion
-
dialogSuggestion
-
dialogCancellation
-
dialogCancellation
-
asOAuthApp
-
asOpenIDConnectApp
-
service
-
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:
IOExceptionSlackApiException
-
builder
-
toBuilder
-