# developer Apex SDK for Slack (Beta) (salesforce-slack-sdk) - Full Documentation # Access a Slack Client Use these Apex classes to get access to a Slack client. **note:** The following methods are deprecated on the App.apex class: `getConnectedSalesforceUserId`, `getConnectedSalesforceUserIdMap`,`getConnectedSlackUserId`, `getConnectedSlackUserIdMap`. The `Slack.App` class required that you access the listed methods within the context of an Apex Slack app. In the Summer ’23 release, the [UserMappingService](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_usermapping_service.md) class exposes these methods without requiring app context. Use the UserMappingService methods instead for an accurate picture of your org mappings. ## App Class The `Slack.App` class represents a Slack app that enables interacting with a user or bot. **Usage** Use the [`Slack.RunnableHandler Interface`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_runnablehandler.md) to create an instance of the Slack client. ```java // Extend the dispatcher (e.g. EventDispatcher, SlashCommandDispatcher, etc.) // Invoke the ActionHandler and implement the RunnableHandler interface public class EventDispatcherEventExample extends Slack.EventDispatcher { public override Slack.ActionHandler invoke(Slack.EventParameters parameters, Slack.RequestContext context) { return Slack.ActionHandler.ack(new Handler(parameters, context)); } public class Handler implements Slack.RunnableHandler { Slack.EventParameters parameters; Slack.RequestContext context; public Handler(Slack.EventParameters parameters, Slack.RequestContext context) { this.parameters = parameters; this.context = context; } public void run() { Slack.App app = Slack.App.MySlackApp.get(); // Create an instance of a Slack client Slack.BotClient client = app.getBotClientForTeam(this.context.getTeamId()); } } } ``` Create an instance of a Slack client depending on the [permission scopes](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/scopes.md) you're using. - [Work with a Slack App Client](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_client.md) - [Work with a Slack Bot Client](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_client_bot.md) - [Work with a Slack User Client](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_client_user.md) ### App Methods The following are methods for `Slack.App`. #### getAppKey() Gets the Slack app key, also known as the Slack app ID. **Signature** ```java public String getAppKey() ``` **Return Value** Type: String #### getAppClient() Reserved for future use. Returns a client to invoke Slack API methods as the Slack app in this context. **Signature** ```java public Slack.AppClient getAppClient() ``` **Return Value** Type: [Slack.AppClient](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_client.md) #### getBotClientForTeam(teamId) Returns a client to invoke Slack API methods as a Slack bot user for the app in the given team. **Signature** ```java public Slack.BotClient getBotClientForTeam(String teamId) ``` **Parameters** _teamId_ Type: String The Slack workspace ID used to retrieve the client **Return Value** Type: [Slack.BotClient](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_client_bot.md) #### getUserClientForTeam(teamId, slackUserId) Returns a client to invoke Slack API methods as a Slack user for the app in the given team. **Signature** ```java public Slack.UserClient getUserClientForTeam(String teamId, String slackUserId) ``` **Parameters** _teamId_ Type: String The Slack workspace ID used to retrieve the client. _slackUserId_ Type: String The Slack user ID used to retrieve the client. **Return Value** Type: [Slack.UserClient](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_client_user.md) #### getConnectedSalesforceUserId(teamId, slackUserId) Gets the Salesforce user ID for a given Slack user ID within a Slack workspace. **Signature** ```java public String getConnectedSalesforceUserId( String teamId, String slackUserId ) ``` **Parameters** _teamId_ Type: String The team ID used to retrieve the Salesforce user ID. _slackUserId_ Type: String The Slack user ID used to retrieve the Salesforce user ID. **Return Value** Type: String #### getConnectedSalesforceUserIdMap(teamId, slackUserIds) Gets the Salesforce user IDs given a list of Slack user IDs in a Slack workspace for a specific Slack app. If at least one successful mapping is possible, then the returned map contains an entry for each supplied Slack user ID. **Signature** ```java public Map getConnectedSalesforceUserIdMap( String teamId, List slackUserIds ) ``` **Parameters** _teamId_ Type: String The Slack team ID associated with the Salesforce user IDs. _slackUserIds_ Type: List\ Map of Slack user ID and Salesforce user ID. **Return Value** Type: Map #### getConnectedSlackUserId(teamId, salesforceUserId) Gets the Slack user ID for a given Salesforce ID within a Slack workspace. **Signature** ```java public String getConnectedSlackUserId( String teamId, String salesforceUserId ) ``` **Parameters** _teamId_ Type: String The Slack team ID associated with the Slack user ID. _salesforceUserId_ Type: String The Salesforce user ID associated with the Slack user ID. **Return Value** Type: String #### getConnectedSlackUserIdMap(teamId, salesforceUserIds) Gets the Slack user mappings given a list of Salesforce User IDs in a Slack workspace for a specific Slack app. If at least one successful mapping is possible, then the returned map contains an entry for each supplied Salesforce user ID. **Signature** ```java public Map getConnectedSlackUserIdMap( String teamId, List salesforceUserIds ) ``` **Parameters** _teamId_ Type: String The Slack team ID associated with the Slack user ID. _salesforceUserIds_ Type: List\ The Salesforce user IDs associated with the Slack user ID. # Accessibility [Input Blocks](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/layout.md#input) are the only way to add visual labels for input fields. We recommend that you wrap every input field in an input block. Currently, every input must appear on its own line with its label directly above it. Use text-only labels for each input field as emojis add extra noise for screen reader users. For [Select](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/elements.md#select) fields, use descriptive placeholder text. Instead of "Select an option", we recommend you use clear placeholder text that conveys the field's purpose, like "Select a status". On-screen readers, the placeholder overrides the label for select fields. If you don't include a placeholder, the screen reader announces "Pick an option". # Apex Reference for Slack Use Apex classes in the `Slack` namespace to simplify your Slack app development. The `Slack` namespace provides classes and methods for interacting with your Slack apps, such as creating handlers for Slack actions and events, and getting access to a Slack client. Before you create a handler, you must configure the connection and view definition for your Slack App. When creating your handler, extend the dispatcher based on the type of operation you’re handling. - Actions: `Slack.ActionDispatcher` - Commands: `Slack.SlashCommandDispatcher` - Events: `Slack.EventDispatcher` - Shortcuts: `Slack.ShortcutDispatcher` **tip:** To determine which classes and methods you need for your app, review the [permission scopes](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/scopes.md) your app requires to perform the tasks. For more information, see [Handle Slack Actions](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/actions.md). To make a call to Slack from an Apex trigger, use the [`@future` annotation](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_annotation_future.htm), queuable apex, or another [asynchronous method](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_async_overview.htm). # Apex SDK for Slack Organizations must evolve quickly with our customers' needs. With Slack and Salesforce, you can make everyone's work simpler, more pleasant, and more productive while enabling them with the data and services they need. Apex SDK for Slack accelerates development by providing you with a collection of tools for effective collaboration and communication. To build a Slack app, you create view definitions in YAML-based files that the SDK translates to rich, interactive user interfaces using Block Kit. ![Apex SDK for Slack Overview](https://developer.salesforce.com/docs/media/overview.png) Apex SDK for Slack empowers developers by enabling them to create apps that interact with Salesforce data from within Slack via events, shortcuts, and slash commands. Create command logic to respond to interactions in Slack. Respond to requests directly from a handler, such as responding to slash commands with a modal. You can also issue Slack API calls using Apex classes in the `Slack` namespace. Additionally, Apex SDK for Slack manages the search and CRUD functionality and metadata interpretation so you can focus on your business logic and app interaction. # Apex SDK for Slack Components These components are specific to the Apex SDK and don't have Slack block equivalents. ## Date Time Picker Available in: [Surface components](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/surface.md) Select a date from a calendar and select a time. ![Datetime Picker Example](https://developer.salesforce.com/media/datetimepicker_standard.png) The date time picker component is a unique type of component; it isn't a surface, layout component, or element. **Examples** This example shows a date time picker with a selected date and time. ```yaml components: - definition: datetimepicker name: "exampleDatetimepickerId" properties: label: date: "Example date" time: "Example time" value: "2021-04-01T09:00" placeholder: "Enter a date & time" name: "exampleDatetimepickerName" ``` This example shows various ways to use a date time picker. ```yaml description: "Example usage of the datetimepicker component" components: - definition: modal properties: title: "Datetimepicker Example" submitLabel: "Submit" closeLabel: "Close" components: - definition: section properties: text: "Datetimepicker with required properties only" - definition: datetimepicker name: "exampleDatetimepickerId" properties: label: date: text: "Pick a date with a smile :smile:" emoji: true time: text: "Pick a time" emoji: false name: "exampleDatetimepickerName" - definition: divider - definition: section properties: text: "Datetimepicker with placeholder" - definition: datetimepicker name: "exampleDatetimepickerPlaceholderId" properties: label: "Pick a date & time" name: "exampleDatetimepickerPlaceholderName" placeholder: "Provide a datetime" - definition: divider - definition: section properties: text: "Datetimepicker with confirm dialog" - definition: datetimepicker name: "exampleDatetimepickerConfirmId" properties: label: date: "Pick a date" time: "Pick a time" name: "exampleDatetimepickerConfirmName" confirm: title: "Confirm selection" text: "Please confirm the selection" confirm: "Confirm" deny: "Cancel" style: "primary" - definition: datetimepicker name: "exampleDatetimepickerRequiredId" properties: label: date: "Pick a date (required)" time: "Pick a time (required)" required: true name: "exampleDatetimepickerRequiredName" ``` **Keys** | Key | Type | Required | Description | | ------------------------ | ------------------------------------------------------------------------------------------------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | | `definition` | String | Yes | The value must be `datetimepicker`. | | `properties` | Object | Yes | The component's properties. | | `properties.label` | String, [Plain Text](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#plain-text), [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md), Object | Yes | An object containing the labels for the date time picker, or a label for the date time picker. | | `properties.label.date` | String, [Plain Text](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#plain-text), [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | A label for the date input of the date time picker. | | `properties.label.time` | String, [Plain Text](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#plain-text), [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | A label for the time input of the date time picker. | | `properties.value` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | The initial time that's selected when the date time picker is loaded in the format `YYYY-MM-DDThh:mm`. The time zone is local to the Slack user client. | | `properties.required` | Boolean, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | If `true`, the form can't be submitted when either values in the date time component are empty. The default value is `false`. | | `properties.placeholder` | String, [Plain Text](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#plain-text), [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | Text used as a placeholder when the `value` is empty. | | `properties.name` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | Yes | A name applied to the date time picker. The name is used to retrieve the value on submission. If not specified, a name is automatically generated for you. | | `properties.confirm` | [Confirm](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#confirm), [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | A confirmation dialog to display after a date/time is selected. | | `name` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | The name to uniquely identify this component within the view. | ## Field Available in: [Surface components](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/surface.md) **warning:** This component has been deprecated. We recommend that you use a [section](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#section) layout component and render the field name and value using [mrkdwn](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#mrkdwn) instead. Add a field-value pair to your view. A field is an [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) that references a value from a data provider. The field component is a unique type of component; it isn't a surface, layout component, or element. **Example** ```yaml components: - definition: field properties: label: "Name" field: "{! record.Name }" # 'record' references a value from a data provider ``` **Keys** | Key | Type | Required | Description | | ---------------------------- | ------------------------------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `definition` | String | Yes | The value must be `field`. | | `properties` | Object | Yes | The field's properties. | | `properties.label` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | Yes | The label for the field. This value is interpreted as [Mrkdwn](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#mrkdwn). | | `properties.field` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | Yes | An expression referencing the field on a record. This value is interpreted as [Mrkdwn](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#mrkdwn). | | `properties.verbatim` | Boolean, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | When set to `false`, Slack detects and parses certain values like links in markdown. The default value is `true`. To turn on automatic parsing, set this key to `false`. See [Mrkdwn](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#mrkdwn) for more details. | | `properties.disableEncoding` | Boolean, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | An optional parameter that disables encoding for control characters in [Mrkdwn](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#mrkdwn). | ## Iteration Available in: [Surface components](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/surface.md) Operates on: [Layout components](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md) To iterate over data in a view, use the iteration component. The iteration component is a unique type of component; it isn't a surface component, layout component, or element component. The iteration component can contain only layout components. It uses the specified components as a template to display data for each item in a data set. **Examples** This example iterates over a list of records from a data provider. ```yaml components: - definition: iteration properties: foreach: "{! records }" # where 'records' references a value from a data provider foritem: "record" components: - definition: text text: "{! record.Name }" ``` This example iterates over a list of commands. ```yaml description: "A component for the help command that displays a list of available commands." schema: properties: commands: type: List required: true components: - definition: message properties: text: "List of commands" components: - definition: section properties: text: "Here are the available commands for this app" - definition: iteration properties: foreach: "{!view.properties.commands}" foritem: "command" components: - definition: divider - definition: section properties: text: text: "*Command*: `{!command.commandName}`" type: "mrkdwn" fields: - text: "*Title*: {!command.title}" type: "mrkdwn" - text: "*Description*: {!command.description}" type: "mrkdwn" ``` This example uses a simple list and a list of maps that are passed into a view. ```yaml description: "This displays a simple list and list of maps passed into a view to be used in an iteration" schema: properties: names: type: list defaultValue: - Assam - Chai - Earl Grey - Green Tea - Matcha - Oolong others: type: list defaultValue: - name: Chamomile - name: Darjeeling - name: Peppermint components: - definition: modal properties: title: Popular Tea components: - definition: iteration properties: foreach: "{!view.properties.names}" foritem: "name" components: - definition: section properties: text: "{!name}" - definition: divider # distinction between "cards" - definition: section properties: text: "More fancy tea variety:" - definition: iteration properties: foreach: "{!view.properties.others}" foritem: "tea" components: - definition: section properties: text: "{!tea.name}" ``` **Keys** | Key | Type | Required | Description | | -------------------- | --------------------------------------- | -------- | ------------------------------------------------------------------- | | `definition` | String | Yes | The value must be `iteration`. | | `properties` | Object | Yes | The component's properties. | | `properties.foreach` | [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | Yes | The list to iterate over. | | `properties.foritem` | String | Yes | Used to refer to the current item in the array of child components. | | `components` | Array | No | An array of child components to render inside the iteration. | # Asset Access Apex SDK for Slack restricts access to assets using access check validation. Assets include your Slack app definitions, view definitions, actions, and data providers. Your assets are retrieved from the database on-demand with their associated metadata. It validates that a reference to an asset from another asset is valid. It checks that an asset has access to the asset it's referencing. For example, the framework validates that a component in the `c` namespace can reference an action in `mynamespace` and vice versa. ## Restrict Access to Assets Access to an Apex action or data provider is based on [access modifiers on your Apex methods](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_access_modifiers.htm). You can't set the access based on metadata. Only `public` and `global` access modifiers are supported. - `public`- Your Apex action or data provider can be referenced from the same namespace. - `global`- Your Apex action or data provider can be referenced from the same or different namespace. This example class uses the `public` access modifier. ```java public class AppHomeOpened extends Slack.EventDispatcher { } ``` This method uses the `global` access modifier. ```java global static String echo(String echoStr) { } ``` ## Asset Access Considerations Invalid use cases can prevent your app or view from being saved correctly. Consider these guidelines when working with Apex SDK for Slack assets. An app definition (`.slackapp`) references an Apex action using the `apex__action__ClassName` or `apex__action__Namespace.ClassName` format. Let's say that `NamespaceA.ClassName` is `public`. If your app is in `NamespaceB`, it cannot reference `NamespaceA.ClassName`. A view definition references a data provider using the `apex__MyClassName.getMyMethodName` or `apex__MyNamespace.MyClassName` format. Let's say that `NamespaceA.ClassName` is `public`. If your view definition is in `NamespaceB`, it cannot reference `NamespaceA.ClassName`. ## See Also - [App Metadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/app-definition.md) - [View Definitions](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/views.md) # Authorize an App The following are Apex classes for the Slack `auth` [API methods](https://api.slack.com/methods?filter=auth). ## AuthRevokeRequest Class Sends a request to revoke a token. ### AuthRevokeRequest Methods The following are methods for `AuthRevokeRequest`. ```java builder() ``` Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.AuthRevokeRequest.Builder builder() ``` **Return Value** Type: Slack.AuthRevokeRequest.Builder --- ## AuthRevokeRequest.Builder Class Contains methods to build an instance of the `Slack.AuthRevokeRequest` class. A Builder object is obtained by invoking one of the `AuthRevokeRequest.Builder` methods defined by the `AuthRevokeRequest` class. ### AuthRevokeRequest.Builder Methods The following are methods for `AuthRevokeRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Builds an instance of the `Slack.AuthRevokeRequest` class. **Signature** ```java public Slack.AuthRevokeRequest build() ``` **Return Value** Type: Slack.AuthRevokeRequest #### test(test) **Signature** ```java public Slack.AuthRevokeRequest.Builder test(Boolean test) ``` **Parameters** _test_ Type: Boolean **Return Value** Type: Slack.AuthRevokeRequest.Builder --- ## AuthRevokeResponse Class Revokes a token. ### AuthRevokeResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `AuthRevokeResponse`. #### isRevoked() **Signature** ```java public Boolean isRevoked() ``` **Return Value** Type: Boolean #### setRevoked(revoked) **Signature** ```java public void setRevoked(Boolean revoked) ``` **Parameters** _revoked_ Type: Boolean **Return Value** Type: void --- ## AuthTeamsListRequest Class Sends a request to list the workspaces a token can access. ### AuthTeamsListRequest Methods The following are methods for `AuthTeamsListRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.AuthTeamsListRequest.Builder builder() ``` **Return Value** Type: Slack.AuthTeamsListRequest.Builder --- ## AuthTeamsListRequest.Builder Class Contains methods to build an instance of the `Slack.AuthTeamsListRequest` class. A Builder object is obtained by invoking one of the `AuthTeamsListRequest.Builder` methods defined by the `AuthTeamsListRequest` class. ### AuthTeamsListRequest.Builder Methods The following are methods for `AuthTeamsListRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Builds an instance of the `Slack.AuthTeamsListRequest` class. **Signature** ```java public Slack.AuthTeamsListRequest build() ``` **Return Value** Type: Slack.AuthTeamsListRequest #### cursor(cursor) **Signature** ```java public Slack.AuthTeamsListRequest.Builder cursor(String cursor) ``` **Parameters** _cursor_ Type: String **Return Value** Type: Slack.AuthTeamsListRequest.Builder #### includeIcon(includeIcon) **Signature** ```java public Slack.AuthTeamsListRequest.Builder includeIcon(Boolean includeIcon) ``` **Parameters** _includeIcon_ Type: Boolean **Return Value** Type: [Slack.AuthTeamsListRequest.Builder](#authteamslistrequestbuilder-class) **Signature** ```java public Slack.AuthTeamsListRequest.Builder cursor(String cursor) ``` **Parameters** _cursor_ Type: String **Return Value** Type: Slack.AuthTeamsListRequest.Builder #### limitValue(limitValue) **Signature** ```java public Slack.AuthTeamsListRequest.Builder limitValue(Integer limitValue) ``` **Parameters** _limitValue_ Type: Integer **Return Value** Type: Slack.AuthTeamsListRequest.Builder --- ## AuthTeamsListResponse Class Lists the workspaces a token can access. ### AuthTeamsListResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `AuthTeamsListResponse`. #### getResponseMetadata() Gets the response metadata. **Signature** ```java public Slack.ResponseMetadata getResponseMetadata() ``` **Return Value** Type: [Slack.ResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#responsemetadata-class) #### getTeams() **Signature** ```java public List getTeams() ``` **Return Value** Type: List #### setResponseMetadata(responseMetadata) Sets the response metadata. **Signature** ```java public void setResponseMetadata(Slack.ResponseMetadata responseMetadata) ``` **Parameters** _responseMetadata_ Type: [Slack.ResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#responsemetadata-class) **Return Value** Type: void #### setTeams(teams) **Signature** ```java public void setTeams(List teams) ``` **Parameters** _teams_ Type: List **Return Value** Type: void --- ## AuthTeamsListResponse.Team Class Contains methods to build an instance of the `Slack.AuthTeamsListResponse` class. A Team object is obtained by invoking one of the `AuthTeamsListResponse.Team` methods defined by the `AuthTeamsListResponse` class. ### AuthTeamsListResponse.Team Methods The following are methods for `AuthTeamsListResponse.Team`. #### getId() Gets the ID of the workspace. **Signature** ```java public String getId() ``` **Return Value** Type: String #### getName() Gets the name of the workspace. **Signature** ```java public String getName() ``` **Return Value** Type: String #### setId(id) Sets the ID of the workspace. **Signature** ```java public void setId(String id) ``` **Parameters** _id_ Type: String **Return Value** Type: void #### setName(name) Sets the name of the workspace. **Signature** ```java public void setName(String name) ``` **Parameters** _name_ Type: String --- ## AuthTestRequest Class Sends a request to check the authentication and identity. ### AuthTestRequest Methods The following are methods for `AuthTestRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.AuthTestRequest.Builder builder() ``` **Return Value** Type: Slack.AuthTestRequest.Builder --- ## AuthTestRequest.Builder Class Contains methods to build an instance of the `Slack.AuthTestRequest` class. A Builder object is obtained by invoking one of the `AuthTestRequest.Builder` methods defined by the `AuthTestRequest` class. ### AuthTestRequest.Builder Methods The following are methods for `AuthTestRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Builds an instance of the `Slack.AuthTestRequest` class. **Signature** ```java public Slack.AuthTestRequest build() ``` **Return Value** Type: Slack.AuthTestRequest --- ## AuthTestResponse Class Checks the authentication and identity. ### AuthTestResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `AuthTestResponse`. #### getAppId() Returns the app ID, for example, `A161CLERW`. **Signature** ```java public String getAppId() ``` **Return Value** Type: String #### getAppName() **Signature** ```java public String getAppName() ``` **Return Value** Type: String #### getBotId() Returns the bot ID, for example, `B061F7JD2`. **Signature** ```java public String getBotId() ``` **Return Value** Type: String #### getEnterpriseId() **Signature** ```java public String getEnterpriseId() ``` **Return Value** Type: String #### getTeam() **Signature** ```java public String getTeam() ``` **Return Value** Type: String #### getTeamId() Gets the ID of the workspace. **Signature** ```java public String getTeamId() ``` **Return Value** Type: String #### getUrl() Gets the workspace URL, for example, `myteam.slack.com`. **Signature** ```java public String getUrl() ``` **Return Value** Type: String #### getUser() Gets the username. **Signature** ```java public String getUser() ``` **Return Value** Type: String #### getUserId() Gets the ID of the user. **Signature** ```java public String getUserId() ``` **Return Value** Type: String #### isEnterpriseInstall() **Signature** ```java public Boolean isEnterpriseInstall() ``` **Return Value** Type: Boolean #### setAppId(appId) Sets the ID of the app. **Signature** ```java public void setAppId(String appId) ``` **Parameters** _appId_ Type: String **Return Value** Type: void #### setAppName(appName) Sets the name of the app. **Signature** ```java public void setAppName(String appName) ``` **Parameters** _appName_ Type: String **Return Value** Type: void #### setBotId(botId) Sets the ID of the bot. **Signature** ```java public void setBotId(String botId) ``` **Parameters** _appId_ Type: String **Return Value** Type: void #### setEnterpriseId(enterpriseId) Sets the ID of the enterprise. **Signature** ```java public void setEnterpriseId(String enterpriseId) ``` **Parameters** _enterpriseId_ Type: String **Return Value** Type: void #### setEnterpriseInstall(isEnterpriseInstall) Specifies whether the installation is part of an Enterprise Grid. **Signature** ```java public void setEnterpriseInstall(Boolean isEnterpriseInstall) ``` **Parameters** _enterpriseId_ Type: Boolean **Return Value** Type: void #### setTeam(team) **Signature** ```java public void setTeam(String team) ``` **Parameters** _team_ Type: String **Return Value** Type: void #### setTeamId(teamId) Sets the ID of the workspace. **Signature** ```java public void setTeamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: void #### setUrl(url) Sets the URL of the workspace. **Signature** ```java public void setUrl(String url) ``` **Parameters** _url_ Type: String **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void #### setUserId(userId) **Signature** ```java public void setUserId(String userId) ``` **Parameters** _userId_ Type: String **Return Value** Type: void # Build Slack Apps Apex SDK for Slack enables you to build Slack apps that translate into blocks via [Block Kit](https://api.slack.com/block-kit). ![Build Slack apps](https://developer.salesforce.com/media/devoverview.png) Before you create your Slack app bundle, make sure you have [set up your SFDX project](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/run-sfdx.md). Define your app using the [SlackApp metadata type](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/app-definition.md). In your SFDX project, create the app definition in the `slackapps` folder. Compose components into [views](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/views.md) to guide users through your app’s capabilities. A view is a root component that displays in a Slack surface: a home tab, message, or modal. To pull data into a view, bind the view to a [data provider](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/data-providers.md). To reference the data throughout a view, use an [expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/expressions.md). Write handlers to respond to [Slack actions](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/actions.md): global and message shortcuts, buttons, slash commands, and events. When a user makes a request in Slack, an Apex handler contains the logic that responds to the request. # Components A view consists of components, which are rendered in Slack as [blocks](https://api.slack.com/block-kit/building). Define components using in a [view](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/views_create.md). There are several types of components. # Composition Objects Some components accept complex property values that must take a certain shape. ## Confirm A dialog that provides a confirmation step. This dialog asks the user to confirm their action via confirm and deny buttons. ![Confirm Example](https://developer.salesforce.com/media/confirm_standard.png) **Example** ```yaml confirm: title: "Confirm desired selection" text: "Please confirm your selection" confirm: "Confirm" deny: "Cancel" style: "primary" ``` | Key | Type | Required | Description | | ----------------- | -------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `confirm` | Object | Yes | An object describing a dialog that provides a confirmation step. | | `confirm.title` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md), [Plain Text](#plain-text) | Yes | The title of the confirmation dialog. | | `confirm.text` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md), [Plain Text](#plain-text) | Yes | Explanatory text to display to the user in the confirmation dialog. | | `confirm.confirm` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md), [Plain Text](#plain-text) | Yes | The text of the confirm button. | | `confirm.deny` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md), [Plain Text](#plain-text) | Yes | The text of the cancel button. | | `confirm.style` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | Defines the color scheme applied to the confirm button. The value `danger` displays the button with a red background on desktop, or red text on mobile. The value `primary` displays the button with a green background on desktop, or blue text on mobile. The default value is `primary`. | ## Datasource Identifies the data provider for an [external select](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/elements.md#external-select) component. **Example** ```yaml datasource: definition: "example__dataprovider" properties: objectApiName: "Opportunity" ``` | Key | Type | Required | Description | | ----------------------- | ----------------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `datasource` | String, Object, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | Yes | A valid data provider identifier string or object containing an identifier and properties to be passed into a data provider. | | `datasource.definition` | String, Object, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | Yes | A valid data provider identifier is required to be present within the `datasource` if the `datasource` takes the form of an Object. Use the format `namespace__dataproviderName`. | | `datasource.properties` | Object, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | Contains any parameters to be passed into the option data provider. | ## Filter Used in the [conversations select](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/elements.md#conversations-select) component to filter which conversations are shown in the picker. **Example** ```yaml filter: include: [ "public", "private", "im", "mpim" ], excludeExternalShared: true, excludeBotUsers: true ``` | Key | Type | Required | Description | | ------------------------------ | ------------------------------------------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `filter` | Object | Yes | Used in the [conversations select](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/elements.md#conversations-select) component to filter which conversations are shown in the picker. | | `filter.include` | Array | Yes | List of conversation types to include. Possible values: `public`—public channels, `private`—private channels, `im`—direct messages, `mpim`—multi-party direct messages. | | `filter.excludeExternalShared` | Boolean, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | Exclude external shared channels from the conversation list. The default value is `false`. | | `filter.excludeBotUsers` | Boolean, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | Exclude bot users from the conversation list. The default value is `false`. | ## Options Available in: [Checkbox Group](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/elements.md#checkbox-group) | [Overflow](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/elements.md#overflow) | [Radio Group](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/elements.md#radio-group) | [Select](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/elements.md#select) An object that represents a single selectable item. **Example** ```yaml options: - identifier: "option_1" label: "Option 1" value: true description: "This is option 1" - identifier: "option_2" label: "Option 2" value: false ``` | Key | Type | Required | Description | | --------------------- | --------------------------------------------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | | `options` | Array, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | Yes | A list of options. | | `options.identifier` | String | Yes | A string used to identify the option. | | `options.label` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md), [Plain Text](#plain-text), [Mrkdwn](#mrkdwn) | Yes | A label for the option on a [checkbox group](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/elements.md#checkbox-group) or [radio group](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/elements.md#radio-group) | | | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md), [Plain Text](#plain-text) | Yes | A label for the option on [overflow](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/elements.md#overflow) or [select](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/elements.md#select). | | `options.value` | Boolean | No | The value of the option. **The `value` key is only available in [checkbox groups](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/elements.md#checkbox-group).** | | `options.description` | String, [Plain Text](#plain-text), [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | The description of the option. | | `options.url` | String | No | A URL to load in the user's browser when the option is selected. **The `url` key is available only in [overflow menus](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/elements.md#overflow).** | ## Option Groups Available in: [Select](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/elements.md#select) Provides a way to group options in a [select](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/elements.md#select) component. **Example** ```yaml optionGroups: - label: "Option Group 1" options: - identifier: "option_1" label: "Option 1" description: "This is option 1" - identifier: "option_2" label: "Option 2" description: "This is option 2" - label: "Option Group 2" options: - identifier: "option_3" label: "Option 3" description: "This is option 3" - identifier: "option_3" label: "Option 4" description: "This is option 4" ``` | Key | Type | Required | Description | | ---------------------- | -------------------------------------------------------------------------- | -------- | -------------------------------------- | | `optionGroups` | Array, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | Yes | A list of option groups. | | `optionGroups.label` | String, [Plain Text](#plain-text), [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | Yes | A label for the group. | | `optionGroups.options` | Array of [Options](#options) | Yes | Selectable items in the options group. | ## Text Object Many properties accept a string, mrkdwn, or plain text. For these properties, if the value is a string, the component renders plain text. If the value is an object it must be a [Mrkdwn](#mrkdwn) or [Plain Text](#plain-text) object. - [Mrkdwn](#mrkdwn) - [Plain Text](#plain-text) ### Mrkdwn Slack's implementation of markdown is called **mrkdwn**. For more details on formatting with mrkdwn, see [Slack's formatting documentation](https://api.slack.com/reference/surfaces/formatting#basics). **Examples** This example creates mrkdwn text with simple formatting and an emoji. ```yaml text: type: "mrkdwn" text: "This label contains *bold text* and an emoji :smile:." ``` By default, control characters in markdown are encoded, including the `<`, `>`, and `&` characters. To use control characters in `mrkdwn` to tag users or denote links, set the `disableEncoding` property to `true`. This example creates mrkdwn text with a link and an emoji. If `disableEncoding` is `false` (default), the angular brackets are rendered as they are. ```yaml label: type: "mrkdwn" text: "This label contains a link and an emoji :smile:." disableEncoding: true ``` This example renders the text `http://salesforce.com` with a link. The link is automatically parsed because `verbatim` is set to `false`. If `verbatim` is `true` (default), the text renders without a link. ```yaml components: - definition: section properties: text: type: "mrkdwn" text: "http://salesforce.com " verbatim: false ``` This example creates mrkdwn text in a [section](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#section) and [field](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/uisf.md#field) component. ```yaml description: "Markdown Support Example" schema: properties: boolean_true: # provided as a view property to pass a boolean value instead of a string into the component type: boolean defaultValue: true boolean_false: # provided as a view property to pass a boolean value instead of a string into the component type: boolean defaultValue: false components: - definition: modal properties: title: text: "Markdown Example :smile:" emoji: true submitLabel: text: "My Submit" emoji: false closeLabel: text: "My Close :x:" emoji: true components: - definition: header properties: text: "This is a plain_text header." - definition: section properties: text: text: "This is a plain_text section block without emoji support :smile:." emoji: false - definition: section properties: text: text: "This is a plain_text section block with emoji support :smile:." emoji: true - definition: section properties: text: type: "mrkdwn" text: "This is a mrkdwn section block with a link https://salesforce.com and an emoji :smile:. The link is automatically parsed because verbatim is set to false." verbatim: false - definition: section properties: text: type: "mrkdwn" text: "This is a mrkdwn section block with a link https://salesforce.com that will not be automatically parsed because verbatim defaults to true." - definition: section properties: text: text: "*Record:* This field value contains a link https://salesforce.com" type: mrkdwn - definition: section properties: text: text: "*Record:* This field value contains a " type: mrkdwn disableEncoding: true - definition: section properties: text: text: "*Record:* This field value contains a link with encoded control characters: " type: mrkdwn - definition: section properties: text: text: "*A true boolean is rendered as:* {!view.properties.boolean_true}" type: mrkdwn - definition: section properties: text: text: "*A false boolean is rendered as:* {!view.properties.boolean_false}" type: mrkdwn ``` **Keys** | Key | Type | Required | Description | | ----------------- | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `text` | Object | Yes | A text object. | | `type` | String | Yes | The value must be `mrkdwn`. | | `text` | String | Yes | The text. | | `verbatim` | Boolean | No | When set to `false`, Slack detects and parses certain values like links in markdown. The default value is `true`. To turn on automatic parsing, set this key to `false`. For more information, see [Slack's text object documentation](https://api.slack.com/reference/block-kit/composition-objects#text). | | `disableEncoding` | Boolean | No | By default (`false`), control characters are encoded within markdown. To turn off automatic encoding, set this key to `true`. | ### Plain Text Renders a plain text value with optional support for emojis. **Example** ```yaml text: text: "This label can include emojis :smile:." emoji: true ``` **Keys** | Key | Type | Required | Description | | ------- | ------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `text` | Object | Yes | A text object. | | `type` | String | No | The default value is `plain_text`. | | `text` | String | Yes | The text. | | `emoji` | Boolean | No | Slack doesn't support emojis in plain text. To turn on emoji support, set this key to `true`. For more information, see [Slack's text object documentation](https://api.slack.com/reference/block-kit/composition-objects). | # Considerations and Limitations Apex SDK for Slack (Beta) was introduced in Winter '22 and has a number of limitations. These features aren't supported. - Admin client access - API Only users can't access the Salesforce UI - The Slack integration requires access to the UI in order to connect your Salesforce account. As a result, API only users can't connect to Slack. - Enterprise installs - Events for workflows - Events for Real Time Messaging (RTM) API - Field-level validation (only validation via input type is supported) - Localization (see [localization limitations](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/localization.md)) - Private metadata on views - Rich text fields (not formatted in Slack) - Scope limitations during installation (see [scope limitations](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/scopes.md)) - System-provided actions or data providers - Web API methods (only methods discussed in [Apex](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref.md) are supported) - `chat.unfurl` - `admin.*` - `files.remote.*` - `workflows.*` We welcome your feedback and comments at the [Apex SDK for Slack (Beta) Trailblazer Community Group](https://trailhead.salesforce.com/trailblazer-community/groups/0F94S000000kGtASAU?tab=discussion). # Create an Apex Handler You can create an Apex class either via the [Developer Console](https://help.salesforce.com/s/articleView?id=platform.code_dev_console_opening.htm&type=5) in your org or by creating these files in the `force-app/main/default/classes` directory in your SFDX project. - `YourClassName.cls`: The Apex class - `YourClassName.cls-meta.xml`: Apex class metadata For more information, see [Create an Apex Class](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_develop_create_apex.htm). Extend the dispatcher based on the type of operation that you're handling. ```java // Action public class MyActionDispatcher extends Slack.ActionDispatcher {} // Event public class MyEventDispatcher extends Slack.EventDispatcher {} // Shortcut public class MyShortcutDispatcher extends Slack.ShortcutDispatcher {} // Slash commands public class MySlashCommandDispatcher extends Slack.SlashCommandDispatcher {} ``` ## Override the `invoke()` Method 1. Pass in your Slack parameters and context and return a `Slack.ActionHandler` instance. ```java public override Slack.ActionHandler invoke(Slack.SlashCommandParameters parameters, Slack.RequestContext context) { return Slack.ActionHandler.modal(new Handler(parameters, context)); } ``` [`Slack.ActionHandler`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_dispatchers.md#actionhandler-class) has methods to help you structure your handler and enable you to work with modals. 2. Create a handler that is passed as an argument to `Slack.ActionHandler` by using the [`ModalHandler` interface](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_modal.md). **tip:** Handlers can implement [`Slack.ModalHandler`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_modal.md) or [`Slack.RunnableHandler`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_runnablehandler.md). ```java public class Handler implements Slack.ModalHandler { public Handler (Slack.SlashCommandParameters parameters, Slack.RequestContext context){ } } ``` 1. Implement the required methods for the interface by using `call()`. ```java public Slack.ModalView call() { Slack.ModalView modalView = new Slack.ModalView.builder().build(); return modalView; } ``` ## Examples Use these examples to implement your Apex handlers. ### Basic Slash Command This example creates a handler for a slash command, returns the `ack()` method to avoid the 3-second timeout, and runs a callback method. ```java public class MySlashCommandDispatcher extends Slack.SlashCommandDispatcher { public override Slack.ActionHandler invoke(Slack.SlashCommandParameters parameters, Slack.RequestContext context) { return Slack.ActionHandler.ack(new Handler()); } public class Handler implements Slack.RunnableHandler { public void run () { System.debug('Ack Callback'); } } } ``` ### Slash Command Returning a Modal View This example handles a slash command and returns a view definition that contains a modal. ```java public class MySlashCommandDispatcher extends Slack.SlashCommandDispatcher { public override Slack.ActionHandler invoke(Slack.SlashCommandParameters parameters, Slack.RequestContext context) { return Slack.ActionHandler.modal(new Handler(parameters, context), 'my custom modal title'); } public class Handler implements Slack.ModalHandler { Slack.SlashCommandParameters parameters; Slack.RequestContext context; public Handler (Slack.SlashCommandParameters parameters, Slack.RequestContext context){ this.parameters = parameters; this.context = context; } public Slack.ModalView call () { Slack.ViewReference viewReference = Slack.View.example_view.get(); viewReference.setParameter('title', 'Apex Modal!'); viewReference.setParameter('message', context.getAppId() + ' ' + parameters.getText()); Slack.ModalView modalView = new Slack.ModalView.builder() .viewReference(viewReference) .build(); return modalView; } } } ``` ### Global Shortcut Acknowledging Request This example handles a global shortcut by acknowledging the request. ```java public class ExampleShortcutDispatcher extends Slack.ShortcutDispatcher { public override Slack.ActionHandler invoke(Slack.ShortcutParameters parameters, Slack.RequestContext context) { return Slack.ActionHandler.ack(new Handler(parameters, context)); } public class Handler implements Slack.RunnableHandler { Slack.ShortcutParameters parameters; Slack.RequestContext context; public Handler (Slack.ShortcutParameters parameters, Slack.RequestContext context){ this.parameters = parameters; this.context = context; } public void run () { System.debug('Ack Callback'); } } } ``` ### Shortcut Returning a Modal View ```java public class CreateRecordShortcutDispatcher extends Slack.ShortcutDispatcher { public override Slack.ActionHandler invoke(Slack.ShortcutParameters parameters, Slack.RequestContext context) { return Slack.ActionHandler.modal(new Handler(parameters, context), 'Create Record'); } public class Handler implements Slack.ModalHandler { Slack.ShortcutParameters parameters; Slack.RequestContext context; public Handler (Slack.ShortcutParameters parameters, Slack.RequestContext context){ this.parameters = parameters; this.context = context; } public Slack.ModalView call () { Slack.ViewReference viewReference = Slack.View.create_record.get(); Slack.ModalView modalView = new Slack.ModalView.builder() .viewReference(viewReference) .build(); return modalView; } } } ``` # Create Apex Handlers for Slack Apps Use these Apex classes to create handlers for Slack actions, commands, shortcuts, and events. ## ActionDispatcher Class The `Slack.ActionDispatcher` class enables you to invoke an action handler such as in response to a form submission. **Usage** Extend the `ActionDispatcher` class and override the `invoke()` method. ```java public class MyActionDispatcher extends Slack.ActionDispatcher { public override Slack.ActionHandler invoke(Map parameters, Slack.RequestContext context) { return Slack.ActionHandler.modal(new Handler(context)); } } ``` **Examples** This example uses `ActionDispatcher` to handle a form submission. ```java public class ExampleFormSubmissionDispatcher extends Slack.ActionDispatcher { public override Slack.ActionHandler invoke(Map parameters, Slack.RequestContext context) { return Slack.ActionHandler.modal(new Handler(context)); } public class Handler implements Slack.ModalHandler { Slack.RequestContext context; public Handler (Slack.RequestContext context){ this.context = context; } public Slack.ModalView call () { Map formData = context.getFormData(); Slack.ViewReference viewReference = Slack.View.message_modal.get(); viewReference.setParameter('title', 'Form Field Value'); viewReference.setParameter('message', (String) formData.get('FormFieldName')); Slack.ModalView modalView = new Slack.ModalView.builder() .viewReference(viewReference) .build(); return modalView; } } } ``` This example uses `ActionDispatcher` to display a view. ```java public class createOpportunity extends Slack.ActionDispatcher { public override Slack.ActionHandler invoke(Map parameters, Slack.RequestContext context) { return Slack.ActionHandler.modal(new Handler(parameters, context)); } public class Handler implements Slack.ModalHandler { Map parameters; Slack.RequestContext context; public Handler (Map parameters, Slack.RequestContext context){ this.parameters = parameters; this.context = context; } public Slack.ModalView call () { Slack.ViewReference viewReference = Slack.View.create_opportunity.get(); viewReference.setParameter('title', 'Record Created'); viewReference.setParameter('message', 'Your opportunity was created'); Slack.ModalView modalView = new Slack.ModalView.builder() .viewReference(viewReference) .build(); return modalView; } } ``` You can close the modal and optionally clear the view stack by using `clearModal()`. To close the modal _without_ clearing the view stack, use [`ack(handler)`](#actionhandler-methods) instead. ```java public class ExampleViewSubmissionDispatcher extends Slack.ActionDispatcher { public override Slack.ActionHandler invoke(Map parameters, Slack.RequestContext context) { // Tell the framework how to respond first // Close the modal and clear the whole stack return Slack.ActionHandler.clearModal(new Handler(parameters, context)); } public class Handler implements Slack.ModalHandler { Map parameters; Slack.RequestContext context; public Handler (Map parameters, Slack.RequestContext context) { this.parameters = parameters; this.context = context; } public void run () { // Process the request (e.g. context.getFormData()) } } } ``` **tip:** For an example of invoking an action handler on the App Home page, such as with `SlashCommandDispatcher`, see [ChatPostMessageRequest](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_chat.md#chatpostmessagerequest-class). ### ActionDispatcher Methods These methods are for `ActionDispatcher`. #### allowUnauthenticatedUsers() **Signature** ```java public Boolean allowUnauthenticatedUsers() ``` **Return Value** Type: Boolean #### invoke(parameters, context) Invokes the action handler. **Signature** ```java public Slack.ActionHandler invoke( Map parameters, Slack.RequestContext context ); ``` **Parameters** _parameters_ Type: Map<String, Object> The action parameters or other parameters of `EventParameters`, `ShortcutParameters`, or `SlashCommandParameters` type. _context_ Type: Slack.RequestContext Describes the context in which a Slack action is invoked. **Return Value** Type: Slack.ActionHandler **Usage** To access the Slack context, use the `invoke()` method. This method is passed in by an instance of `RequestContext`. It exposes information about the source of the action in Slack, performs custom logic, and obtains the correct Slack client to respond to Slack based on the request. Each action type receives different information in its `RequestContext`. --- ## ActionHandler Class The `Slack.ActionHandler` class provides methods that control how Slack actions are handled. The handler processes a single request. **Usage** With the `ActionHandler` methods, you can [work with modals](https://api.slack.com/surfaces/modals/using). By responding to Slack actions with a modal you can display dynamic and interactive information. Before opening a modal, compose a view object to define the layout of the initial view. A modal can hold up to three views simultaneously in a view stack. Only one view is visible each time. But the view stack can retain previous views and return to them with their prior state in place. An app can push new views onto a modal's view stack or update an existing view within that stack, including the currently visible view. To use this Apex class, specify the `Slack` namespace when creating an instance of this class. Override the `invoke()` method returning a `Slack.ActionHandler`. **Examples** This example pushes a modal onto the modal view stack. ```java public class createRecord extends Slack.ActionDispatcher { public override Slack.ActionHandler invoke(Map parameters, Slack.RequestContext context) { // the slack action handler is returned immediately return Slack.ActionHandler.pushModal(new Handler(parameters, context)); } public class Handler implements Slack.ModalHandler { Map parameters; Slack.RequestContext context; public Handler (Map parameters, Slack.RequestContext context) { this.parameters = parameters; this.context = context; } public Slack.ModalView call () { Slack.ViewReference viewReference = Slack.View.message_modal.get(); viewReference.setParameter('title', 'Title'); viewReference.setParameter('message', 'Message'); Slack.ModalView modalView = new Slack.ModalView.builder() .viewReference(viewReference) .build(); return modalView; } } } ``` The `message_modal.view` file looks like this. ```yaml description: "This is a simple component that displays a message in a modal" schema: properties: title: type: string required: true message: type: string required: true components: - definition: modal properties: title: "{!view.properties.title}" components: - definition: section properties: text: "{!view.properties.message}" ``` ### ActionHandler Methods The following are methods for `ActionHandler`. #### ack(handler) Acknowledge the payload back to Slack to avoid the 3-second timeout. After running this method, you can perform Slack Client API calls such as to post messages and publish to app home. For example, you can listen to the `app_home_opened` event and publish a new view to the user’s Home tab. `ack()` takes care of responding back to Slack immediately to avoid the 3-second timeout. We don’t recommend using `ack()` for displaying modals subject to the `trigger_id` timeouts because doing so can cause your code to fail intermittently, depending on the environment. To create, update, or push a modal view, use `pushModal()`, `modal()`, or `updateModal()` instead. These methods ack back to Slack within 3 seconds so that the `trigger_id` from Slack doesn't expire using a staging modal. Using these methods, your `Handler` must return a `ModalView` for Slack to display. See [Create an Apex Handler](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/actions_handlers_apex.md). **Signature** ```java public static Slack.ActionHandler ack(Slack.RunnableHandler handler) ``` **Parameters** _handler_ Type: Slack.RunnableHandler The handler that clears the modal from the view stack. **Return Value** Type: Slack.ActionHandler #### clearModal(handler) Clears the full stack of modals. By default, Slack pops one modal off the top of the stack. **Signature** ```java public static Slack.ActionHandler clearModal(RunnableHandler handler) ``` **Parameters** _handler_ Type: RunnableHandler The handler that clears the modal from the view stack. **Return Value** Type: Slack.ActionHandler #### modal(handler) Displays a **Loading** modal with automatic staging to satisfy the 3-second timeout rule. **Signature** ```java public static Slack.ActionHandler modal(Slack.ModalHandler handler) ``` **Parameters** _handler_ Type: Slack.ModalHandler The handler for the modal. **Return Value** Type: Slack.ActionHandler #### Window(handler, stagedModalTitle) Displays a **Loading** modal with a title. The modal has automatic staging to satisfy the 3-second timeout rule. **Signature** ```java public static Slack.ActionHandler modal( Slack.ModalHandler handler, String stagedModalTitle ) ``` **Parameters** _handler_ Type: Slack.ModalHandler The handler for the modal. _stagedModalTitle_ Type: String The title to display on the modal in Slack. **Return Value** Type: Slack.ActionHandler #### pushModal(handler) Pushes another modal to the view stack with automatic staging to satisfy the 3-second timeout. **Signature** ```java public static Slack.ActionHandler pushModal(Slack.ModalHandler handler) ``` **Parameters** _handler_ Type: Slack.ModalHandler The handler that pushes the modal to the view stack. **Return Value** Type: Slack.ActionHandler #### pushModal(handler, stagedModalTitle) Push another modal to the view stack with a different title. **Signature** ```java public static Slack.ActionHandler pushModal( Slack.ModalHandler handler, String stagedModalTitle ) ``` **Parameters** _handler_ Type: Slack.ModalHandler The handler that pushes the modal to the view stack. _stagedModalTitle_ Type: String The title to display on the modal in Slack. **Return Value** Type: Slack.ActionHandler #### updateModal(handler) Updates a modal. This update can happen if the view is visible within the modals's view stack. **Signature** ```java public static Slack.ActionHandler updateModal(Slack.ModalHandler handler) ``` **Parameters** _handler_ Type: Slack.ModalHandler The handler that updates the modals. **Return Value** Type: Slack.ActionHandler #### updateModal(handler, stagedModalTitle) Updates a modals with a different title. This update can happen whether the view is visible within the modal's view stack. **Signature** ```java public static Slack.ActionHandler updateModal( Slack.ModalHandler handler, String stagedModalTitle ) ``` **Parameters** _handler_ Type: Slack.ModalHandler The handler that updates the modal. `stagedModalTitle` Type: String The title to display on the modal in Slack. **Return Value** Type: Slack.ActionHandler --- ## ActionPayload Class Contains the name and values associated with the block element that triggered the action. **Usage** Use the `ActionPayload` class to register an event, such as an `onchange` or `onclick` event, and associate the event to an action. You can retrieve the value from the payload to display it in the view or use the value to perform a query and so on. Specify your action payload in the `run()` callback method. ```java // Set the context using Slack.RequestContext Slack.ActionPayload actionPayload = context.getActionPayload(); if (actionPayload != null) { String name = actionPayload.getName(); // do something with the payload } ``` See [ChatPostMessageRequest](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_chat.md#chatpostmessagerequest-class) for an example that retrieves the value of the payload and publish it to a view. ### ActionPayload Methods The following are methods for `ActionPayload`. #### getName() Returns the name of the block element. **Signature** ```java public String getName() ``` **Return Value** Type: String #### getType() Returns the type of the block element. **Signature** ```java public String getType() ``` **Return Value** Type: String #### getValue() Returns the value of the block element. **Signature** ```java public Object getValue() ``` **Return Value** Type: Object --- ## ActionPayload.Builder Class Contains methods to build an instance of the `Slack.ActionPayload` class. A Builder object is obtained by invoking one of the `ActionPayload.Builder` methods defined by the `ActionPayload` class. ### ActionPayload.Builder Methods The following are methods for `ActionPayload.Builder`. #### build() Returns an instance of the `Slack.ActionPayload` object. **Signature** ```java public Slack.ActionPayload build() ``` **Return Value** Type: Slack.ActionPayload #### name(name) **Signature** ```java public Slack.ActionPayload.Builder name(String name) ``` **Parameters** _type_ Type: String **Return Value** Type: Slack.ActionPayload.Builder #### type(type) **Signature** ```java public Slack.ActionPayload.Builder type(String type) ``` **Parameters** _type_ Type: String **Return Value** Type: Slack.ActionPayload.Builder #### value(value) **Signature** ```java public Slack.ActionPayload.Builder value(Object value) ``` **Parameters** _value_ Type: Object **Return Value** Type: Slack.ActionPayload.Builder # Define a View A view is composed of components that display in a [Slack surface](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/surface.md): a home tab, message, or modal. Define a view in a `.view` file, which is YAML that describes the components that make up the view. In a Slack runtime environment, a view translates to blocks. In your SFDX project, a view lives in the `force-app/main/default/viewdefinitions` folder. For more information, see the [ViewDefinition](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/api_tooling/tooling_api_objects_viewdefinition.md) Tooling API object. Components in a view can handle events such as a button click. See [Interactive Components](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/actions_handlers_write.md). You can also bind data to a view using [expressions](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/expressions.md) and [data providers](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/data-providers.md). **note:** Views are not cached. If your view fails to render, check your view definition and YAML indentation. ## View Definition Keys | Key | Type | Description | | -------------------------------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `description` | String | A description of this view. Not used in code. | | `schema` | Object | The input properties for this view. | | `schema.properties` | Object | A map of property names to their schema. | | `schema.properties.type` | String | The type of the property value. One of these values: `string`, `boolean`, `number`, `list`, `map`, or `null`. | | `schema.properties.required` | Boolean | Specifies whether the property is required. If true, defaultValue is ignored. | | `schema.properties.defaultValue` | String | The default value to use if one isn't provided and required is false. Must be a literal value. | | `dataproviders` | Object | The data sources for this view. A map of data provider keys to data providers. | | `dataproviders.definition` | String | Required. The name of the data provider in the format `apex__MyClassName.getMyMethodName` or `apex__MyNamespace.MyClassName.getMyMethodName`. | | `dataproviders.properties` | Object | The input properties for this data provider. A map of property names to either literal values or string expressions. | | `components` | Array | Required. The components that make up this view. | | `components.definition` | String | Required. The name of the component definition. | | `components.name` | String, Expression | The name to uniquely identify the component within the view. | | `components.visibility` | Boolean, Expression | Indicates whether the component is shown or hidden. If this property isn't present or it evaluates to true, the component is shown. Otherwise, the component is hidden. | | `components.properties` | Object | The properties of this component. A map of property names to literal values or expressions. | | `components.components` | Array | The child components of this component. | | `regions` | Array | The regions for this view component. Not currently supported. | **tip:** Some components can handle an event like `onclick` or `onchange`, which is also configured in the view definition. See the [Component Reference](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/reference.md). ## Examples Use these examples to build your own views. ### Display a Message in a Modal This view definition displays a message in a [modal](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/surface.md#modal). The modal component contains a [section](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/layout.md#section) component. The view has a title and message property, which is bound to the modal's title and section's text property each. ```yml description: "Display a message in a modal" schema: properties: title: type: string required: true message: type: string required: true components: - definition: modal properties: title: "{!view.properties.title}" components: - definition: section properties: text: "{!view.properties.message}" ``` ### Create a Record This view definition displays a [modal](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/surface.md#modal) for creating a record. The modal contains a [section](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/layout.md#section) component with an [actions](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/layout.md#actions) component, which has a `button` to create the record. When clicked, the button calls the `createOpportunity` Apex class. ```yml description: "Trigger an Apex block action." components: - definition: modal properties: title: "Create Record" components: - definition: section properties: text: "Which object do you want to create a record for?" - definition: actions name: "apex_actions" components: - definition: button properties: label: "Create Opportunity" style: "primary" name: "apex_action" events: onclick: #createOpportunity must exist in the consumer org as an apex class that implements Slack.Action definition: "apex__action__createOpportunity" properties: objectApiName: "Opportunity" ``` ### Submit a Record This view definition creates an opportunity record when the submit button is clicked. When clicked, the button calls the `submitOpportunity` Apex class. The modal contains input fields with placeholders, including a [select](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/elements.md#select) component with a list of options. ```yml description: "Creates an opportunity record by triggering an Apex action on submission." components: - definition: modal properties: title: "Create Opportunity" submitLabel: "Create" events: onsubmit: #submitOpportunity must exist in the consumer org as an Apex class that implements Slack.ActionDispatcher definition: "apex__action__submitOpportunity" components: - definition: input properties: label: "Name" # label is the field label required: true components: - definition: textInput properties: name: "Name" # name should be FieldApiName placeholder: "Name" value: "{!view.properties.name}" - definition: input properties: label: "Amount" required: true components: - definition: textInput properties: name: "Amount" placeholder: "175000" - definition: input properties: label: "Stage" required: true components: - definition: select properties: name: "StageName" value: "" placeholder: "Select a stage." options: - identifier: "Prospecting" label: "Prospecting" - identifier: "Qualification" label: "Qualification" - identifier: "Needs Analysis" label: "Needs Analysis" - identifier: "Value Proposition" label: "Value Proposition" - identifier: "Id. Decision Makers" label: "Id. Decision Makers" - identifier: "Perception Analysis" label: "Perception Analysis" - identifier: "Proposal/Price Quote" label: "Proposal/Price Quote" - identifier: "Negotiation/Review" label: "Negotiation/Review" - identifier: "Closed Won" label: "Closed Won" - identifier: "Closed Lost" label: "Closed Lost" - definition: input properties: label: "Close Date" required: true components: - definition: datepicker properties: name: "CloseDate" placeholder: "YYYY-MM-DD" ``` # Define an App Define your app using the [SlackApp metadata type](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/api_meta/meta_slackapp.md). In your SFDX project, create the app definition in the `slackapps` folder. ```txt |_ slackapps/ |_ MySlackApp.slackapp |_ MySlackApp.slackapp-meta.xml ``` An app definition includes: - `.slackapp`: The configuration file that contains the app handlers for slash commands, shortcuts, and event handlers in YAML format - `.slackapp-meta.xml`: The metadata file that contains connection settings to communicate with Slack ## Define App Metadata Bind an action to handle each command, shortcut, and event in your app. An action executes when a Slack request is received. Actions are assigned to hooks in app metadata and events in a view. This example app configuration binds actions to several commands, a global shortcut, a message shortcut, and an event. ```yaml description: Example Apex SDK for Slack App commands: /apex-create-record: action: definition: apex__action__CreateRecordCommandDispatcher title: Create Record Command description: Create a record using a slack command. /apex-view-record: action: definition: apex__action__ViewRecordCommandDispatcher title: View Record Command description: View record details by objectApiName and recordId. globalShortcuts: apex-create-record-global: action: definition: apex__action__CreateRecordShortcutDispatcher title: Create Record Global Shortcut description: Create a record using a slack global shortcut. messageShortcuts: apex-create-record-message: action: definition: apex__action__CreateRecordShortcutDispatcher title: Create Record Message Shortcut description: Create a record using a slack message shortcut. events: app_home_opened: action: definition: apex__action__AppHomeOpened title: Example event handler for app_home_opened description: event fires when a user opens the home tab. ``` ## App Configuration Keys The app configuration includes the following keys. | Key | Type | Required | Description | | ------------------ | ------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `description` | String | No | A description of the app. Not used in code. | | `commands` | Object | No | A map of slash command keys to [action bindings](#action-binding) that handle the slash commands. Define a key for each slash command that you defined in your Slack app at [api.slack.com/apps](http://api.slack.com/apps). A slash command must start with `/`. | | `globalShortcuts` | Object | No | A map of global shortcut callback ID keys to [action bindings](#action-binding) that handle the global shortcuts. Define a key for each global shortcut that you defined in your Slack app at [api.slack.com/apps](http://api.slack.com/apps). | | `messageShortcuts` | Object | No | A map of message shortcut callback ID keys to [action bindings](#action-binding) that handle the message shortcuts. Define a key for every message shortcut that you defined in your Slack app at [api.slack.com/apps](http://api.slack.com/apps). | | `events` | Object | No | A map of event keys to [action bindings](#action-binding) that handle the events. Define a key for each [event](https://api.slack.com/events) that your Slack app subscribes to at [api.slack.com/apps](http://api.slack.com/apps). | ### Action Binding An action binding is an object that represents a command, global shortcut, message shortcut, or event. ```yaml /apex-create-record: action: definition: apex__action__CreateRecordCommandDispatcher title: Create Record Command description: Create a record using a slack command. ``` The action binding is specified by the following keys. **Keys** | Key | Type | Required | Description | | ------------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | | `action` | String | Yes | The address to an Apex class in the format `apex__action__ClassName` or `apex__action__Namespace.ClassName` bound to the command, shortcut, or event. | | `title` | String | No | Reserved for future use. | | `description` | String | No | A description of the action binding. Not used in code. | ## Configure the App Connection Configure your Apex SDK for Slack app to communicate with the Slack app. In the `slackapps` folder, create a file called `.slackapp-meta.xml`, where `` matches the `.slackapp` file. For field information, see [SlackApp metadata type](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/api_meta/meta_slackapp.md). # Deploy a Slack App After you [set up your development environment](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/setup-your-env.md) and [configure your SFDX project](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/run-sfdx.md), you can create and deploy a Slack app by following these steps. ## Prerequisites To deploy a Slack app, you must have a Slack account. If you don't have a Slack account, see [slack.com/get-started#/create](https://slack.com/get-started#/create). ## Create a Slack App 1. Navigate to https://api.slack.com/apps and click **Create New App**. 2. Select **From an app manifest**, and choose the workspace you want to develop your app in. 3. Use this app manifest to create your Say Hello app. Update `` with a unique name to differentiate your app. Ignore the `` placeholder for now as you're updating this information later. ```yaml _metadata: major_version: 1 minor_version: 1 display_information: name: Say Hello App description: Say Hello Example App features: app_home: home_tab_enabled: true messages_tab_enabled: false messages_tab_read_only_enabled: false bot_user: display_name: Say Hello always_online: false slash_commands: - command: /apex-hello url: https://slack-apps.salesforce.com:9443/a/ description: Say Hello should_escape: false oauth_config: redirect_urls: - https://auth.slack-apps.salesforce.com/slack_oauth_callback/ scopes: user: - reactions:read - chat:write bot: - channels:read - chat:write - commands - groups:read - reactions:read - users:read settings: event_subscriptions: request_url: https://slack-apps.salesforce.com:9443/a/ bot_events: - app_home_opened - app_uninstalled - grid_migration_finished - grid_migration_started - team_access_granted - team_access_revoked - tokens_revoked interactivity: is_enabled: true request_url: https://slack-apps.salesforce.com:9443/a/ message_menu_options_url: https://slack-apps.salesforce.com:9443/a/ org_deploy_enabled: false socket_mode_enabled: false token_rotation_enabled: false ``` **note:** An app manifest enables you to create, configure, and copy your Slack apps easily. If you see an error while saving the manifest, check your indentation. For the manifest schema, see [Create and configure apps with manifests](https://api.slack.com/reference/manifests). 4. Click **Next**. Verify your app summary and click **Create**. 5. After you create the app, click **Install to Workspace**. 6. From the **Basic Information** page, copy the App ID value. 7. On the **Basic Information** page, scroll down to the **App-Level Tokens** section and generate a token. To enable routing on your app's interactions and event payloads over WebSockets, add the `connections:write` scope. **tip:** Note of the App ID, App Token, and secrets on this page. We're using them shortly for the SlackApp metadata file. 8. Navigate to these pages and update the URLs. Replace `` in the app manifest file. - **Interactivity & Shortcuts** > Interactivity Update the Request URL, and save your changes. - **Interactivity & Shortcuts** > Select Menus Update the Options Load URL, and save your changes. - **Slash Commands** > Edit Command Update the Request URL, and save your changes. Repeat this step for each command you have. - **OAuth & Permissions** Update the Redirect URLs, click **Done**, and click **Save URLs**. - **Event Subscriptions** Update the Request URL. Save your changes. **tip:** If any of the request URL is missing from the fields, copy and paste it from another Request URL field. The request URL follows the format `https:///a/`. 9. View the app manifest file in Slack and confirm that the URLs are updated. ## Create and Deploy a View Definition A [view definition](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/build/views.md) is translated to blocks at runtime. 1. Using VS Code for your scratch org, create a folder `viewdefinitions` in `force-app/main/default`. 2. Create a file called `hello.view`, inside the `viewdefinitions` folder. Include this YAML syntax. ```yaml description: "Say Hello Example" schema: properties: name: type: string required: true components: - definition: modal properties: title: "Hello {!view.properties.name}" components: - definition: section properties: text: "You did it!" ``` 3. Add the `hello.view-meta.xml` metadata file in the same directory. ```xml 54.0 false Hello World Example slack ``` 4. Deploy your view definition. ```bash sf project deploy start ``` If you see an error when deploying, run `sf update stable` to update to the latest version. Run `sf autocomplete --refresh-cache` after you update Salesforce CLI to ensure that autocomplete works correctly on any new commands. **tip:** If you've been using Salesforce CLI for a long time, and have previously set up Toolbelt with SFDX, uninstall the old unused plugins using `sf plugins uninstall salesforce-alm` and `sf plugins uninstall salesforcedx`. ## Create and Deploy a SlackApp Definition The [SlackApp metadata type](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/api_meta/meta_slackapp.md) contains configuration information such as the app's commands and shortcut handlers, and the app's token and secrets. To create the metadata definition: 1. Create a folder `slackapps` inside `force-app/main/default`. 2. Create a file called **HelloSlackApp.slackapp**, inside the `slackapps` folder. `SlackApp` files use YAML syntax. The Slash command defined as follows must match your Slack App configuration on `api.slack.com`. ```yaml description: Hello World Example App commands: /apex-hello: action: definition: apex__action__SayHello title: Say Hello description: A command to say Hello ``` 3. In the `force-app/main/default/slackapps` directory, create a **HelloSlackApp.slackapp-meta.xml** file. Replace the `*` placeholders in the example with the values for your Slack app. ```xml * * chat:write,chat:write.public,incoming-webhook,channels:history,groups:history,channels:read,reactions:read,commands * * false Hello Slack App * im:read,im:write,channels:read,channels:write,chat:write,groups:read,mpim:read,mpim:write,users:read,groups:write ``` **tip:** The `appKey` and `clientKey` fields correspond to App ID and Client ID on `api.slack.com`. The `appToken` starts with `xapp-1-`. To locate the app token, see the **App-Level Tokens** section on the **Basic Information** page. 4. Deploy your Slack app definition. ```bash sf project deploy start ``` ## Create and Deploy a Slack Action Let's add some interactivity for the `/apex-hello` slash command you introduced in the app manifest, using a slash command dispatcher. 1. In the `classes` directory, open the **SayHello.cls** class. 2. Paste in the following code and save the file. ```java public class SayHello extends Slack.SlashCommandDispatcher { public override Slack.ActionHandler invoke(Slack.SlashCommandParameters parameters, Slack.RequestContext context) { return Slack.ActionHandler.modal(new Handler(parameters, context), 'Say Hello'); } public class Handler implements Slack.ModalHandler { Slack.SlashCommandParameters parameters; Slack.RequestContext context; public Handler(Slack.SlashCommandParameters parameters, Slack.RequestContext context){ this.parameters = parameters; this.context = context; } public Slack.ModalView call() { String name = parameters.getText(); Slack.ViewReference viewReference = Slack.View.hello.get(); viewReference.setParameter('name', name); Slack.ModalView modalView = new Slack.ModalView.builder() .viewReference(viewReference) .build(); return modalView; } } } ``` 3. Deploy your Slack action. ```bash sf project deploy start ``` ## Run Your Slack App Let's see your Slack app in action. 1. From the Slack Desktop client, go to a public channel and enter the following slash command: `/apex-hello`. **tip:** If the slash command isn't available, make sure you've clicked the **Install to Workspace** button as described in [Create a Slack App](#create-a-slack-app). 2. When prompted to connect your app, click the **Connect** button in Slack. To connect your Slack app and scratch org: 1. Accept the OAuth screen from Slack. 2. When you get to the Salesforce login page, select the **Would you rather connect to a sandbox?** link, if you’re not already on `test.salesforce.com`. **tip:** If your scratch org uses a custom domain, for example, `connect-efficiency-1197-dev-ed.cs91.my.salesforce.com`, click **Use Custom Domain**, enter your custom domain `connect-efficiency-1197-dev-ed`, and click **Continue**. 3. Sign in with your scratch org username and password. When prompted to select which channel you want to allow your app to post to, select the channel and press **Allow**. 4. When you're connected successfully, a success message is displayed in the browser. 5. You can now close the window and return to Slack. 6. Execute the slash command again: `/apex-hello World` and observe that the modal appears. **tip:** If you see an error that a channel is not found when running a slash command, it usually means the bot doesn't have access to post a message to the channel. Try adding the bot to the channel by typing `@` and then following the onscreen instructions. # Distribute Slack Apps As an ISV or Salesforce partner, you can package Slack apps and distribute them to other Salesforce users and orgs on AppExchange. We recommend using second-generation packaging (2GP) to distribute Slack apps. A Dev Hub org can own multiple packages and they can use the same namespace. See [Second-Generation Managed Packages](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_dev2gp.htm). **important:** Packaging is available in beta. Distribution of Slack Apps is available only after the beta phase is complete. Users operating under the beta agreement can't distribute Slack apps using the Apex SDK. # Documentation Changelog This changelog lists documentation changes made to the Apex SDK for Slack (Beta) Developer Guide. ## July 3, 2023 This documentation changes are new for July 3, 2023. - The [`UserMapping`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guides/apex_ref/apex_ref_usermapping_service.md) class is new for the `Slack` namespace. - Added a note that four [Slack.App](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guides/apex_ref/apex_ref_client_access.md) class methods have been deprecated and includes an alternative recommendation. ## May 11, 2023 These documentation changes are new for May 11, 2023. - Added new documentation for [Slack Multi-Org Management](/content/en-us/apex-slack-sdk/guides/orgs-mass-user.md) feature. ## April 17, 2023 These documentation changes are new for April 17, 2023. - Added new documentation for [Slack Mass User Provisioning](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/orgs-mass-user.md). - Added new documentation to support [Moving Orgs & Sandbox Refreshes](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/packaging/packaging_refresh.md). ## February 23, 2023 These documentation changes are new for February 23, 2023. - The [`SLACKPACKAGING` feature](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/run-sfdx.md) isn't required when packaging Slack apps. ## February 7, 2023 These documentation changes are new for February 7, 2023. - Added new flow functionality by [using Slack buttons to trigger Flows](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/build/actions_interact.md). 🆕 ## January 23, 2023 These documentation changes are new for January 11, 2023. - Dependent fields, picklists, and packaging are now available. ## January 11, 2023 These documentation changes are new for January 11, 2023. - Added new [slash command functionality](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/build/actions_interact.md) to trigger flows. - Added `allowUnauthenticatedUsers` method in [ActionDispatcher](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_dispatchers.md). ### Apex These classes are new for the `Slack` namespace. - [`SharedChannelInviteAcceptedEvent`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_shared.md#sharedchannelinviteacceptedevent) - [`SharedChannelInviteApprovedEvent`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_shared.md#sharedchannelinviteapprovedevent) - [`SharedChannelInviteDeclinedEvent`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_shared.md#sharedchannelinvitedeclinedevent) - [`SharedChannelInviteReceivedEvent`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_shared.md#sharedchannelinvitereceivedevent) ## December 13, 2022 These documentation changes are new for December 13, 2022. - Added a limitation about API users in [Considerations and Limitations](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/build/known_issues.md). ## November 04, 2022 These documentation changes are new for November 04, 2022. - Updated reference documentation for [TestHarness.User() and TestHarness.Team](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_testharness.md). - Add a section clarifying [test client overrides](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/test/test_override.md) an example. - Added test example to [overwrite the botclient using the TestHarness](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guides/test/test_examples.md) - New class added for the `Slack` namespace.[`TestHarness.File`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_testharness.md) These classes are new for the `Slack` namespace. - [`CallableHandler`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_callable_handler.md). - [`ActionResult`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_action_result.md). ## October 20, 2022 These documentation changes are new for October 20, 2022. - Salesforce SDK for Slack now available in Beta. ## September 29, 2022 The following documentation changes are new for September 29, 2022. - Updated the select component example in an [Actions component](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/components/layout.md). ## September 15, 2022 These documentation changes are new for September 15, 2022. - Updated the [`File`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_files.md#file-class) class. ## August 23, 2022 The following documentation changes are new for August 23, 2022. - Removed Slack Components Date Time Picker warning. [Now supports multiple time zones](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/components/uisf.md). ## July 13, 2022 These documentation changes are new for July 13, 2022. - Added a section clarifying [user client usage](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_client_user.md). ## July 5, 2022 These documentation changes are new for July 5, 2022. - Updated the allowed components in an [Actions component](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/components/layout.md). ## May 6, 2022 The following documentation changes are new for May 6, 2022. - Added a section about [enabling channel localization](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/localization.md#enable-channel-localization). 🆕 - Updated the [Slack and Salesforce User Locales](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/localization.md) section. - Clarified that [expressions are case-sensitive](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/build/expressions.md). - Added a section about [deprecated events](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/build/events_mapping.md#deprecated-events). - Added a section about [register a message event handler using the channel types and subtypes](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/build/events_handling.md). - Removed `getBotClientForEnterprise()` and `getUserClientForEnterprise()` methods as Enterprise Grid isn’t yet supported. ## April 29, 2022 These documentation changes are new for April 29, 2022. - Added a limitation about scopes in [Considerations and Limitations](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/build/known_issues.md). - Added a section about [Scope Limitations](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/build/scopes.md). ## April 25, 2022 The following documentation changes are new for April 25, 2022. - Clarified and added examples for the [Select](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/components/elements.md#select) and [External Select](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/components/elements.md#external-select) components. - Added data provider examples for [Slack.Option](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_options.md#option-class) and [Slack.OptionGroup](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_options.md#optiongroup-class). ## April 7, 2022 The following documentation changes are new for April 7, 2022. - Added information about [enabling the Slack for Salesforce Beta](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/enable-beta.md). - Added an updated version of the [sample app](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/setup-install-app.md). - Added information about [event subscriptions](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/build/events_mapping.md). - Added [event examples](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/build/events_examples.md). - Added reference documentation for [TestHarness.executeEvent()](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_testharness.md) and [`File.Headers` class](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_files.md). - Added a section for [creating permissions for a Slack app](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/orgs-users.md). - Added new methods like `getHttpResponseHeaders()` and `setHttpResponseHeaders()` to many of the `*Response` and `*Request` classes. ## March 28, 2022 The following documentation changes are new for March 28, 2022. - Added a section about [localization limitations](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/localization.md#considerations-and-limitations). - Added a note about Slack's block limit for [surface components](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/components/surface.md). - Updated the Apex SDK for Slack [considerations and limitations](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/build/known_issues.md). - Updated the character limits for [modals and homepage views](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/build/actions_handlers_write.md#action-signing). ## March 25, 2022 The following documentation changes are new for March 25, 2022. - Added a section about Slack's [rate limit](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/build/events.md#rate-limits). - Added information on `.Builder` classes to call out required methods. - Updated the `properties.text` description for the [section](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/components/layout.md#section) layout component to call out `mrkdwn` usage. - Fixed a minor error to include a url for all `slash_commands` entries in the [manifest example](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/setup-install-app.md) for the sample app. - Fixed the `properties.confirm` description for the [select](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/components/elements.md#select) component. ## March 18, 2022 The following documentation changes are new for March 18, 2022. - Added a note about localization support for Slack's `(optional)` [input field label](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/components/layout.md). - Added an updated version of the [sample app](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/setup-install-app.md). ## March 14, 2022 The following documentation changes are new for March 14, 2022. - Salesforce Slack SDK is now **Apex SDK for Slack**. The dev guide has been updated to reflect the product name change. - The [TestHarness.Field](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_testharness.md) class has been removed to follow the deprecation of the field component. ## March 10, 2022 The following documentation changes are new for March 10, 2022. - Added a note about limited time zone support for the [date picker](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/components/elements.md#date-picker), [time picker](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/components/elements.md#time-picker), and [date time picker](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/components/uisf.md#date-time-picker) components. ## March 8, 2022 The following documentation changes are new for March 8, 2022. - Added documentation for the [test harness framework](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/test/test.md) and the [Apex `TestHarness` class](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_testharness.md). - Added an updated version of the [sample app](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/setup-install-app.md). - Added the [`datasource` composition object](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/components/composition.md#datasource) for data providers. - Added a note about limited support for [expressions](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/build/expressions.md). - Updated [Use Custom Labels](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/localization.md#use-custom-labels) to denote support for the `{!label.key}` expression. ## Mar 2, 2022 These documentation changes are new for Mar 2, 2022. - Added a section about [action signing](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/build/actions_handlers_write.md#action-signing). ## Feb 24, 2022 These documentation changes are new for Feb 24, 2022. - Added a note that the [field component](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/components/uisf.md#field) has been deprecated and recommend an alternative way to render field values. ## Feb 9, 2022 These documentation changes are new for Feb 9, 2022. - Added [localization information](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/localization.md). - Added [input validation](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/build/validation.md). - Fixed trailing space errors in XML code blocks. The extra space resulted in errors when pushing with SFDX. ## Feb 3, 2022 These documentation changes are new for Feb 3, 2022. - Foyer is now Salesforce Slack SDK. The dev guide has been updated to reflect the product name change. - Added a section [Delete a User Mapping](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/orgs-multi.md). ## Feb 1, 2022 The following documentation changes are new for Feb 1, 2022. ### Apex These classes are new for the `Slack` namespace. - [`BillableInfo`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_teams.md#billableinfo-class) - [`BotIcons`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_bot.md#boticons-class) - [`BotProfile`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_bot.md#botprofile-class) - [`BotProfile.Icons`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_bot.md#botprofile.icons-class) - [`Call`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_calls.md#call-class) - [`CallParticipant`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_calls.md#callparticipant-class) - [`Channel`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_channels.md#channel-class) - [`Conversation`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_conversations.md#conversation-class) - [`ErrorResponseMetadata`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_response_metadata.md#errorresponsemetadata-class) - [`Field`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_fields.md) - [`File`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_files.md#file-class) - [`File.Address`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_files.md#file.address-class) - [`File.PinnedInfo`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_files.md#file.pinnedinfo-class) - [`File.ShareDetail`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_files.md#file.sharedetail-class) - [`File.Shares`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_files.md#file.shares-class) - [`FileComment`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_files.md#filecomment-class) - [`IntegrationLog`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_teams.md#integrationlogs-class) - [`Latest`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_latest.md) - [`Latest.Edited`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_latest.md#latest.edited-class) - [`Login`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_teams.md#login-class) - [`MatchedItem`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_search.md#matcheditem-class) - [`MatchedItem.Address`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_search.md#matcheditem.address-class) - [`MatchedItem.OtherItem`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_search.md#matcheditem.otheritem-class) - [`Message`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_messages.md#message-class) - [`Message.Edited`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_messages.md#message.edited-class) - [`Message.Icons`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_messages.md#message.icons-class) - [`Message.MessageItem`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_messages.md#message.messageitem-class) - [`Message.MessageRoot`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_messages.md#message.messageroot-class) - [`Message.MessageRootReply`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_messages.md#message.messagerootreply-class) - [`Paging`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_paging.md#paging-class) - [`Purpose`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_purpose.md#purpose-class) - [`Reaction`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_reactions.md#reaction-class) - [`ReactionsListRequest`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_reactions.md#reactionslistrequest-class) - [`ReactionsListResponse`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_reactions.md#reactionslistresponse-class) - [`ReactionsListResponse.Icons`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_reactions.md#reactionslistresponse.icons-class) - [`ReactionsListResponse.Item`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_reactions.md#reactionslistresponse.item-class) - [`ReactionsListResponse.Message`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_reactions.md#reactionslistresponse.message-class) - [`ReactionsListResponse.MessageRootReply`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_reactions.md#reactionslistresponse.messagerootreply-class) - [`ReactionsListResponse.UserProfile`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_reactions.md#reactionslistresponse.userprofile-class) - [`Reminder`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_reminders.md#reminder-class) - [`ResponseMetadata`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_response_metadata.md#responsemetadata-class) - [`SearchResult`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_search.md#searchresult-class) - [`SearchResult.Pagination`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_search.md#searchresult.pagination) - [`StarsListRequest`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_stars.md#starslistrequest-class) - [`StarsListResponse`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_stars.md#starslistresponse-class) - [`StarsListResponse.Comment`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_stars.md#starslistresponse.comment-class) - [`StarsListResponse.Edited`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_stars.md#starslistresponse.edited-class) - [`StarsListResponse.Item`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_stars.md#starslistresponse.item-class) - [`StarsListResponse.Message`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_stars.md#starslistresponse.message-class) - [`StarsListResponse.MessageRootReply`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_stars.md#starslistresponse.messagerootreply-class) - [`Team`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_teams.md#team-class) - [`Team.Profile`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_teams.md#team.profile-class) - [`Team.ProfileOptions`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_teams.md#team.profileoptions-class) - [`TeamIcon`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_teams.md#teamicon-class) - [`Topic`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_topics.md#topic-class) - [`User`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_users.md#users-class) - [`User.EnterpriseUser`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_users.md#user.enterpriseuser-class) - [`User.Field`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_users.md#user.field-class) - [`User.Profile`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_users.md#user.profile-class) - [`Usergroup`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_usergroups.md) - [`WarningResponseMetadata`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_response_metadata.md#warningresponsemetadata-class) - [`WorkflowStepInput`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_workflows.md#workflowstepinput-class) - [`WorkflowStepOutput`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_workflows.md#workflowstepoutput-class) These classes were deleted. - `FilesUploadResponse` - `FilesUploadRequest` - `UsersSetPhotoRequest` - `UsersSetPhotoResponse` These classes have changes. `AppsEventAuthorizationsListRequest.Builder` has changed. - The `maxLimit(maxLimit)` method has been renamed to `limitValue(limitValue)`. `AppsEventAuthorizationsListResponse` has new methods. - `getAuthorizations()` - `setAuthorizations(authorizations)` `AuthTeamsListRequest` has changed. - The `maxLimit(maxLimit)` method has been renamed to `limitValue(limitValue)`. `AuthTeamsListResponse` has new methods. - `getTeams()` - `getResponseMetadata()` - `setTeams(teams)` - `setResponseMetadata(responseMetadata)` `BotClient` has changed. - `reactionsList(req)` has been added. - `filesUpload(req)` has been removed. `BotsInfoResponse` has new methods. - `getIcons()` - `setIcons(icons)` `CallsAddRequest.Builder` has a new method. - `users(users)` `CallsAddResponse` has new methods. - `getCall()` - `getReponseMetadata()` - `setCall(call)` - `setResponseMetadata(responseMetadata)` `CallsEndResponse` has new methods. - `getCall()` - `getResponseMetadata()` - `setCall(call)` - `setResponseMetadata(responseMetadata)` `CallsInfoResponse` has new methods. - `getCall()` - `getResponseMetadata()` - `setCall(call)` - `setResponseMetadata(responseMetadata)` `CallsParticipantsAddRequest.Builder` has a new method. - `users(users)` `CallsParticipantsAddResponse` has new methods. - `getCall()` - `getResponseMetadata()` - `setCall(call)` - `setResponseMetadata(responseMetadata)` `CallsParticipantsRemoveRequest.Builder` has a new method. - `users(users)` `CallsParticipantsRemoveResponse` has new methods. - `getCall()` - `getResponseMetadata()` - `setCall(call)` - `setResponseMetadata(responseMetadata)` `CallsUpdateResponse` has new methods. - `getCall()` - `getResponseMetadata()` - `setCall(call)` - `setResponseMetadata(responseMetadata)` `ChatPostMessageReponse` has new methods. - `getResponseMetadata()` - `getMessage()` - `setResponseMetadata(responseMetadata)` - `setMessage(message)` `ChatScheduleMessageResponse.ScheduledMessage` has new methods. - `getBotProfile()` - `setBotProfile(botProfile)` `ChatScheduledMessagesListRequest` has changed. - The `maxLimit(maxLimit)` method has been renamed to `limitValue(limitValue)`. `ChatScheduledMessagesListResponse` has new methods. - `getScheduledMessages()` - `getResponseMetadata()` - `setScheduledMessages(scheduledMessages)` - `setResponseMetadata(responseMetadata)` `ChatUpdateResponse` has new methods. - `getMessage()` - `setMessage(message)` `ConversationsCreateResponse` has new methods. - `getChannel()` - `setChannel(channel)` `ConversationsHistoryRequest.Builder` has changed. - The `maxLimit(maxLimit)` method has been renamed to `limitValue(limitValue)`. `ConversationsHistoryResponse` has new methods. - `getMessages()` - `getResponseMetadata()` - `setMessages(messages)` - `setResponseMetadata(responseMetadata)` `ConversationsInfoResponse` has new methods. - `getChannel()` - `setChannel(channel)` `ConversationsInviteResponse` has new methods. - `getChannel()` - `getErrors()` - `setChannel(channel)` - `setErrors(errors)` `ConversationsJoinResponse` has new methods. - `getChannel()` - `getResponseMetadata()` - `setChannel()` - `setResponseMetadata(responseMetadata)` `ConversationsListRequest` has changed. - The `maxLimit(maxLimit)` method has been renamed to `limitValue(limitValue)`. `ConversationsListRequest.Builder` has a new method. - `types(types)` `ConversationsListResponse` has new methods. - `getChannels()` - `getResponseMetadata()` - `setChannels()` - `setResponseMetadata(responseMetadata)` `ConversationsMarkResponse` has new methods. - `getResponseMetadata()` - `setResponseMetadata(responseMetadata)` `ConversationsMembersRequest` has changed. - The `maxLimit(maxLimit)` method has been renamed to `limitValue(limitValue)`. `ConversationsMembersResponse` has new methods. - `getResponseMetadata()` - `setResponseMetadata(responseMetadata)` `ConversationsOpenResponse` has new methods. - `getChannel()` - `setChannel(channel)` `ConversationsRenameResponse` has new methods. - `getChannel()` - `setChannel(channel)` `ConversationsRepliesRequest` has changed. - The `maxLimit(maxLimit)` method has been renamed to `limitValue(limitValue)`. `ConversationsRepliesResponse` has new methods. - `getMessages()` - `getResponseMetadata()` - `setMessages(messages)` - `setResponseMetadata(responseMetadata)` `ConversationsSetPurposeResponse` has new methods. - `getChannel()` - `setChannel(channel)` `ConversationsSetTopicResponse` has new methods. - `getChannel()` - `setChannel(channel)` `DndTeamInfoResponse` has new methods. - `getUsers()` - `setUsers(users)` `FilesInfoResponse` has new methods. - `getFile()` - `setFile(file)` `FilesListReponse` has new methods. - `getFiles()` - `getPaging()` - `setFiles(files)` - `setPaging(paging)` `FilesRemoteAddResponse` has new methods. - `getFile()` - `setFile(file)` `FilesRemoteInfoResponse` has new methods. - `getFile()` - `setFile(file)` `FilesRemoteListRequest` has changed. - The `maxLimit(maxLimit)` method has been renamed to `limitValue(limitValue)`. `FilesRemoteListResponse` has new methods. - `getFiles()` - `getResponseMetadata()` - `setFiles(files)` - `setResponseMetadata(metadata)` `FilesRemoteShareResponse` has new methods. - `getFile()` - `setFile(file)` `FilesRemoteUpdateResponse` has new methods. - `getFile()` - `setFile(file)` `FilesRevokePublicURLResponse` has new methods. - `getFile()` - `setFile(file)` `FilesSharedPublicURLResponse` has new methods. - `getFile()` - `setFile(file)` `PinsAddResponse` has new methods. - `getResponseMetadata()` - `setResponseMetadata(responseMetadata)` `PinsListReponse` has new methods. - `getItems()` - `setItems(items)` `PinsListResponse.MessageItem` has new methods. - `getComment()` - `getFile()` - `getMessage()` - `setComment(comment)` - `setFile(file)` - `setMessage(message)` `ReactionsGetResponse.Message` has new methods. - `getBotProfile()` - `getReactions()` - `setBotProfile(botProfile)` - `setReactions(reactions)` `RemindersAddRequest` has changed. - The `atTime(atTime)` method has been renamed to `timeValue(timeValue)`. `RemindersAddResponse` has new methods. - `getReminder()` - `setReminder(reminder)` `RemindersInfoResponse` has new methods. - `getReminder()` - `setReminder(reminder)` `RemindersListResponse` has new methods. - `getReminders()` - `setReminders(reminders)` `SearchAllRequest` has changed. - The `sortType(sortType)` method has been renamed to `sortValue(sortValue)`. `SearchAllResponse` has new methods. - `getMessages()` - `getFiles()` - `setMessages(messages)` - `setFiles(files)` `SearchFilesRequest` has changed. - The `sortType(sortType)` method has been renamed to `sortValue(sortValue)`. `SearchFilesResponse` has new methods. - `getFiles()` - `setFiles(files)` `SearchMessagesRequest` has changed. - The `sortType(sortType)` method has been renamed to `sortValue(sortValue)`. `SearchMessagesResponse` has new methods. - `getMessages()` - `setMessages(messages)` `TeamAccessLogsResponse` has new methods. - `getLogins()` - `getPaging()` - `setLogins(logins)` - `setPaging(paging)` `TeamBillableInfoResponse` has new methods. - `getBillableInfo()` - `setBillableInfo(billableInfo)` `TeamInfoResponse` has new methods. - `getTeam()` - `setTeam()` `TeamIntegrationLogsResponse` has new methods. - `getLogs()` - `getPaging()` - `setLogs(logs)` - `setPaging(paging)` `UserClient` has new methods. - `reactionsList(req)` - `starsList(req)` `UsergroupsCreateResponse` has new methods. - `getUsergroup()` - `setUsergroup(usergroup)` `UsergroupsDisableResponse` has new methods. - `getUsergroup()` - `setUsergroup(usergroup)` `UsergroupsEnableResponse` has new methods. - `getUsergroup()` - `setUsergroup(usergroup)` `UsergroupsListResponse` has new methods. - `getUsergroups()` - `setUsergroups(usergroups)` `UsergroupsUpdateResponse` has new methods. - `getUsergroup()` - `setUsergroup(usergroup)` `UsergroupsUsersUpdateResponse` has new methods. - `getUsergroup()` - `setUsergroup(usergroup)` `UsersConversationsRequest` has changed. - The `maxLimit(maxLimit)` method has been renamed to `limitValue(limitValue)`. `UsersConversationsRequest.Builder` has a new method. - `types(types)` `UsersConversationsResponse` has new methods. - `getChannels()` - `getResponseMetadata()` - `setChannels(channels)` - `setResponseMetadata(responseMetadata)` `UsersInfoResponse` has new methods. - `getUser()` - `setUser(user)` `UsersListRequest` has changed. - The `maxLimit(maxLimit)` method has been renamed to `limitValue(limitValue)`. `UsersListResponse` has new methods. - `getMembers()` - `getResponseMetadata()` - `setMembers(members)` - `setResponseMetadata(responseMetadata)` `UsersLookupByEmailResponse` has new methods. - `getUser()` - `setUser(user)` `ViewsOpenResponse` has new methods. - `getResponseMetadata()` - `setResponseMetadata(responseMetadata)` `ViewsPublishResponse` has new methods. - `getResponseMetadata()` - `setResponseMetadata(responseMetadata)` `ViewsPushResponse` has new methods. - `getResponseMetadata()` - `setResponseMetadata(responseMetadata)` `ViewsUpdateResponse` has new methods. - `getResponseMetadata()` - `setResponseMetadata(responseMetadata)` `WorkflowsUpdateStepRequest` has new methods. - `inputs(inputs)` - `outputs(outputs)` ## January 24, 2022 These documentation changes are new for January 24, 2022. - Updated [Data Providers](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/build/data-providers.md) to add support for the Select component to use `List` and `List`. - Renamed the Implement the External Select Component doc and updated the URL to [Work with Options](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_options.md). ## January 14, 2022 These documentation changes are new for January 14, 2022. - Removed the `label` property from the [checkbox group](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/components/elements.md#checkbox-group) and [radio group](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/components/elements.md#radio-group) examples. - Added an updated version of the [sample app](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/setup-install-app.md). - Added [User Permissions and Roles](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/orgs-users.md) to provide an overview on user mapping between Slack and Salesforce. - Updated [Org Connections](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/orgs-multi.md) to include steps for user-mapping removal and a list of connection errors. - Updated the `request_url` and `redirect_url` values in the example manifests on these pages. - [Deploy a Slack App](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/run-deploy.md) - [Sample Apex SDK for Slack App](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/setup-install-app.md) ## December 20, 2021 (Spring '22 Preview) These documentation changes are new for December 20, 2021. ### Asset Checks Added [Asset Access](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/build/assets.md) to explain how Apex SDK for Slack validates access to an asset across namespaces. ### Apex Added examples to: - [ActionPayload](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_dispatchers.md#actionpayload-class) - [ChatPostMessageRequest](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_chat.md#chatpostmessagerequest-class) - [HomeView](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_views.md#homeview-class) ### Events Added information about [events](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/build/events.md), and added an example of how to respond to the `app_home_opened` event. ### Expressions Added information about [label expressions and formula expressions](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/build/expressions.md). ### Packaging Added information and basic guidelines about [packaging Slack apps](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/packaging/packaging.md). ### Permission Scopes Added information about [scopes](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/build/scopes.md) and how to determine which scopes to use for an app. ### View Definitions - Added [Onboarding with App Home](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/build/views_onboarding.md) to include examples of how to onboard users using the `app_home_opened` event. - Added a note that [views aren’t cached](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/build/views_create.md). # Elements Visual components like text or for user input, such as a button or checkbox. Elements represent the smallest pieces of a view. Elements must be rendered within [layout components](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md). When working with events from the App Home page, put your [elements](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/elements.md) in an `actions` block. ## Button Available in: [Section](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#section) | [Actions](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#actions) An interactive button. The button can be a trigger for anything from opening a simple link to starting a complex workflow. ![Button Example](https://developer.salesforce.com/media/button_standard.png) **Examples** Render a button within an `actions` block. ```yaml - definition: actions name: "apex_actions" components: - definition: button properties: label: "Confirm" style: "primary" name: "confirm_button" ``` ```yaml components: - definition: button properties: name: "my_button" label: "Delete" value: "delete_record" style: "danger" events: onclick: definition: "apex__action__ViewRecord" properties: recordId: "006R0000003FpnoIAC" objectApiName: "Opportunity" ``` **Keys** | Key | Type | Required | Description | | --------------------------- | ---------------------------------------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------- | | `definition` | String | Yes | The value must be `button`. | | `properties` | Object | Yes | The component's properties. | | `properties.label` | String, [Plain Text](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#plain-text), [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | The button label. | | `properties.name` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | Yes | The name applied to the button element. The name is used to retrieve the value on submission. | | `properties.value` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | The value to send along with the interaction payload. | | `properties.style` | String. Possible values, `primary`, `danger`, `null` | No | The button style. The default value is `null`. | | `properties.url` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | A URL that's opened on button click. URLs must use a valid protocol scheme such as `http://` or `https://`. | | `properties.confirm` | [Confirm](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#confirm) | No | A confirmation dialog to display after a button click. | | `events` | Object | No | Events that trigger an [action](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/actions_handlers_write.md). | | `events.onclick` | Object | No | Fires when a user clicks the button. | | `events.onclick.definition` | String | No | The identifier of the [action](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/actions_handlers_write.md) that executes when the event fires. | | `events.onclick.properties` | Object | No | Properties to pass to the action. | ## Checkbox Available in: [Section](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#section) | [Actions](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#actions) | [Input](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#input) A checkbox that allows a user to specify a single boolean value. ![Checkbox Example](https://developer.salesforce.com/media/checkbox_standard.png) **Examples** This example shows a checkbox that defaults to selected. ```yaml components: - definition: checkbox properties: label: "Select single boolean value" name: "checkbox" value: true ``` This example shows checkboxes that render as selected or unselected, a checkbox with a label, and a required checkbox. ```yaml description: "Example usage of the checkbox component" components: - definition: modal properties: title: "Checkbox Example" submitLabel: "Submit" closeLabel: "Cancel" components: - definition: input name: "default_selected_checkbox" properties: label: "Checkbox Default Selected" components: - definition: checkbox properties: name: "checkbox1" value: true - definition: input name: "default_unselected_checkbox" properties: label: "Checkbox Default Unselected" components: - definition: checkbox properties: name: "checkbox2" value: false - definition: input name: "checkbox_with_description" properties: label: "Checkbox with Label and Description" components: - definition: checkbox properties: name: "checkbox3" label: Checkbox Label description: Checkbox Description - definition: input name: "required_checkbox" properties: label: "Required Checkbox" required: true components: - definition: checkbox properties: name: "checkbox4" ``` **Keys** | Key | Type | Required | Description | | ---------------------------- | -------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------ | | `definition` | String | Yes | The value must be `checkbox`. | | `properties` | Object | Yes | The component's properties. | | `properties.name` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | Yes | The name applied to the checkbox input. The name is used to retrieve the value on submission. | | `properties.value` | Boolean, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | The initial value applied to the checkbox input. Defaults to `false`. | | `properties.label` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | The label for the checkbox input. | | `properties.description` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | The description for the checkbox input. | | `properties.confirm` | [Confirm](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#confirm), [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | A confirmation dialog to display after a checkbox is selected. | | `events` | Object | No | Events that trigger an [action](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/actions_handlers_write.md). | | `events.onchange` | Object | No | Fires when a checkbox is ticked or unticked. | | `events.onchange.definition` | String | No | The identifier of the [action](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/actions_handlers_write.md) that executes when the event fires. | | `events.onchange.properties` | Object | No | Properties to pass to the action. | ## Checkbox Group Available in: [Section](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#section) | [Actions](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#actions) | [Input](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#input) A checkbox group that allows a user to choose multiple items from a list of possible options. ![Checkbox Group Example](https://developer.salesforce.com/media/checkbox_group_standard.png) **Example** On an initial render, Option 1 is selected and Option 2 isn't selected by default. ```yaml components: - definition: checkboxGroup properties: name: "options_checkbox" options: - identifier: "option_1" label: "Option 1" value: true description: "This is option 1" - identifier: "option_2" label: "Option 2" value: false ``` **Keys** | Key | Type | Required | Description | | ---------------------------- | -------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------ | | `definition` | String | Yes | The value must be `checkboxGroup`. | | `properties` | Object | Yes | The component's properties. | | `properties.name` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | Yes | The name applied to the checkbox inputs. The name is used to retrieve the values on submission. | | `properties.options` | [Options](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#options) | Yes | A list of checkbox items. | | `properties.confirm` | [Confirm](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#confirm), [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | A confirmation dialog to display after a checkbox is selected. | | `events` | Object | No | Events that trigger an [action](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/actions_handlers_write.md). | | `events.onchange` | Object | No | Fires when a checkbox is ticked or unticked. | | `events.onchange.definition` | String | No | The identifier of the [action](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/actions_handlers_write.md) that executes when the event fires. | | `events.onchange.properties` | Object | No | Properties to pass to the action. | ## Conversations Select Available in: [Section](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#section) | [Actions](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#actions) | [Input](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#input) This multi-select menu populates its options with a list of public and private channels, DMs, and multi-party DMs that are visible to the current user in the active workspace. ![Conversations Select Example](https://developer.salesforce.com/media/conversations-select.png) **Example** This example selects a single conversation. ```yaml components: - definition: input name: "conversationsSelectId" properties: label: "Select a conversation" components: - definition: conversationsSelect properties: name: "conversationsSelectName" value: "C012AB3CD" defaultCurrent: true ``` This example allows multiple selections. ```yaml components: - definition: input name: "conversationsSelectMultiId" properties: label: "Select multiple conversations" components: - definition: conversationsSelect properties: name: "conversationsSelectMultiName" multiselect: true value: - "C012AB3CD" - "C345XY6AB" ``` This example filters to include only public and private channels. ```yaml components: - definition: input name: "conversationsSelectFilterChannelId" properties: label: "Select a channel" components: - definition: conversationsSelect properties: name: "conversationsSelectName" filter: include: - "public" - "private" excludeExternalShared: false ``` This example filters to include direct messages and exclude bots. ```yaml components: - definition: input name: "conversationsSelectFilterDmId" properties: label: "Select a DM" components: - definition: conversationsSelect properties: name: "conversationsSelectName" filter: include: - "im" - "mpim" excludeBotUsers: true ``` This example shows a comprehensive usage of the `conversationsSelect` component. ```yaml description: "Example usage of the conversationsSelect component" components: - definition: modal properties: title: "Conversations Select Example" submitLabel: "Submit" closeLabel: "Cancel" components: - definition: section properties: text: "Single conversation select with required properties only" - definition: input name: "conversationsSelectId" properties: label: "Select a conversation" components: - definition: conversationsSelect properties: name: "conversationsSelectName" - definition: divider - definition: section properties: text: "Single conversation select with placeholder" - definition: input name: "conversationsSelectPlaceholderId" properties: label: "Select a conversation" components: - definition: conversationsSelect properties: name: "conversationsSelectPlaceholderName" placeholder: "Choose a conversation" - definition: divider - definition: section properties: text: "Single conversation select with default channel selected" - definition: input name: "conversationsSelectDefaultCurrentId" properties: label: "Select a conversation" components: - definition: conversationsSelect properties: name: "conversationsSelectDefaultCurrentName" defaultCurrent: true - definition: divider - definition: section properties: text: "Single conversation select as required input" - definition: input name: "conversationsSelectRequiredId" properties: label: "Select a conversation" required: true components: - definition: conversationsSelect properties: name: "conversationsSelectRequiredName" - definition: divider - definition: section properties: text: "Single conversation select filtered to only channels" - definition: input name: "conversationsSelectFilterChannelId" properties: label: "Select a conversation" components: - definition: conversationsSelect properties: name: "conversationsSelectFilterChannelName" filter: include: - "public" - "private" excludeExternalShared: false - definition: divider - definition: section properties: text: "Single conversation select filtered to only direct messages excluding bots" - definition: input name: "conversationsSelectFilterDmId" properties: label: "Select a conversation" components: - definition: conversationsSelect properties: name: "conversationsSelectFilterDmName" filter: include: - "im" - "mpim" excludeBotUsers: true - definition: divider - definition: section properties: text: "Single conversation select with confirm dialog" - definition: input name: "conversationsSelectConfirmId" properties: label: "Select a conversation" components: - definition: conversationsSelect properties: name: "conversationsSelectConfirmName" confirm: title: "Confirm conversation selection" text: "Please confirm the conversation selection" confirm: "Confirm" deny: "Cancel" style: "primary" - definition: divider - definition: section properties: text: "Multi conversation select with required properties only" - definition: input name: "conversationsMultiSelectId" properties: label: "Select conversations" components: - definition: conversationsSelect properties: name: "conversationsMultiSelectName" multiselect: true - definition: divider - definition: section properties: text: "Multi conversation select with default channel selected" - definition: input name: "conversationsMultiSelectDefaultCurrentId" properties: label: "Select conversations" components: - definition: conversationsSelect properties: name: "conversationsMultiSelectDefaultCurrentName" multiselect: true defaultCurrent: true - definition: divider - definition: section properties: text: "Multi conversation select with max selection" - definition: input name: "conversationsMultiSelectMaxSelectionId" properties: label: "Select conversations" components: - definition: conversationsSelect properties: name: "conversationsMultiSelectMaxSelectionName" multiselect: true maxSelection: 2 - definition: divider - definition: section properties: text: "Multi conversation select filtered to only channels" - definition: input name: "conversationsMultiSelectFilterChannelId" properties: label: "Select conversations" components: - definition: conversationsSelect properties: name: "conversationsMultiSelectFilterChannelName" multiselect: true filter: include: - "public" - "private" excludeExternalShared: false - definition: divider - definition: section properties: text: "Multi conversation select filtered to only direct messages excluding bots" - definition: input name: "conversationsMultiSelectFilterDmId" properties: label: "Select a conversation" components: - definition: conversationsSelect properties: name: "conversationsMultiSelectFilterDmName" multiselect: true filter: include: - "im" - "mpim" excludeBotUsers: true ``` **Keys** | Key | Type | Required | Description | | ---------------------------- | ---------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `definition` | String | Yes | The value must be `conversationsSelect`. | | `properties` | Object | Yes | The component's properties. | | `properties.name` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | Yes | The name applied to the conversations select component. The name is used to retrieve the value on submission. | | `properties.placeholder` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md), [Plain Text](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#plain-text) | No | A placeholder value to display when nothing is selected. | | `properties.multiselect` | Boolean, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | Indicates whether the component supports multiple selections. The default value is `false`. | | `properties.maxSelection` | Number, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | If `multiselect` is `true`, you can optionally specify `maxSelection`. The maximum number of conversations that can be selected. The minimum value is `1`. | | `properties.defaultCurrent` | Boolean, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | Pre-populates the select with the conversation the user was viewing when they opened the modal. The default value is `false`. | | `properties.filter` | [Filter](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#input), [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | Filter the list of available conversations. | | `properties.confirm` | [Confirm](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#confirm), [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | A confirmation dialog to display after a conversation is selected. | | `events` | Object | No | Events that trigger an [action](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/actions_handlers_write.md). | | `properties.value` | String, Array, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | Indicates the conversation, or conversations if `multiselect` is `true`, selected on an initial render. Must match the ID of a conversation in Slack. If the value is an array, it's an array of strings. If `defaultCurrent` is also supplied, `value` takes precedence. | | `events.onchange` | Object | No | Fires when a conversation is selected, or the multi-select menu is confirmed. | | `events.onchange.definition` | String | No | The identifier of the [action](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/actions_handlers_write.md) that executes when the event fires. | | `events.onchange.properties` | Object | No | Properties to pass to the action. | ## Date Picker Available in: [Section](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#section) | [Actions](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#actions) | [Input](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#input) An element that lets users select a date from a calendar. ![Date Picker Example](https://developer.salesforce.com/media/datepicker_standard.png) **warning:** The date picker doesn't currently support multiple time zones, which can lead to issues when editing and submitting values. For example, if the field value is stored as 11:00 pm PST on 3/9/2022, the date picker displays the date incorrectly as 3/9/2022 for users in EST. The date picker does not display the time zone or convert the date to the local time zone. **Examples** This example shows a date picker that displays a confirmation dialog after a date is selected. ```yaml components: - definition: input name: "exampleDatepicker" properties: label: "Example datepicker" components: - definition: datepicker properties: value: "2021-04-01" placeholder: "Choose a date" name: "exampleDatepicker" confirm: "{!view.properties.confirm}" title: "Confirm date selection" text: "Please confirm the date selection" confirm: "Confirm" deny: "Cancel" style: "primary" ``` This example shows various ways to use a date picker. ```yaml components: - definition: modal properties: title: "Datepicker Example" submitLabel: "Submit" closeLabel: "Cancel" components: - definition: section properties: text: "Datepicker with required properties only" - definition: input name: "exampleDatepickerId" properties: label: "Pick a date" components: - definition: datepicker properties: name: "exampleDatepickerName" - definition: divider - definition: section properties: text: "Datepicker with placeholder" - definition: input name: "exampleDatepickerPlaceholderId" properties: label: "Pick a date" components: - definition: datepicker properties: placeholder: "Choose a date" name: "exampleDatepickerPlaceholderName" - definition: divider - definition: section properties: text: "Datepicker with initial date" - definition: input name: "exampleDatepickerInitialDateId" properties: label: "Pick a date" components: - definition: datepicker properties: value: "2021-04-01" name: "exampleDatepickerInitialDateName" - definition: divider - definition: section properties: text: "Datepicker as required input" required: true - definition: input name: "exampleDatepickerRequiredId" properties: label: "Pick a date" components: - definition: datepicker properties: name: "exampleDatepickerRequiredName" ``` **Keys** | Key | Type | Required | Description | | ---------------------------- | ---------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------ | | `definition` | String | Yes | The value must be `datepicker`. | | `properties` | Object | Yes | The component's properties. | | `properties.value` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | The initial date that's selected when the date picker is loaded in the format `YYYY-MM-DD`. | | `properties.placeholder` | String, [Plain Text](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#plain-text), [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | Text used as a placeholder when the value is empty. | | `properties.name` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | Yes | A name applied to the date picker. The name is used to retrieve the values on submission. | | `properties.confirm` | [Confirm](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#confirm), [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | A confirmation dialog to display after a date is selected. | | `events` | Object | No | Events that trigger an [action](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/actions_handlers_write.md). | | `events.onchange` | Object | No | Fires when a date is chosen and the date picker closes. | | `events.onchange.definition` | String | No | The identifier of the [action](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/actions_handlers_write.md) that executes when the event fires. | | `events.onchange.properties` | Object | No | Properties to pass to the action. | ## External Select This component is a lookup that fetches options from a data source when a user enters text into the field. Use `List` or `List` to create your data source and return it as a [Slack.OptionDataResponse](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/data-providers.md#external-select) object. Available in: [Section](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#section) | [Actions](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#actions) | [Input](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#input) ![Multiple Select External Select Input](https://developer.salesforce.com/media/external_select.png) **Example** This example displays a list of accounts by name in an external select component. ```yaml components: - definition: actions name: "external_select_accounts" components: - definition: externalSelect properties: placeholder: "Look up an account by name" name: "account_lookup" datasource: definition: "apex__DataProviderAccountLookup.getAccountsByName" ``` Return data to the External Select component using `Slack.OptionDataResponse`. **tip:** This example is from `view_opportunity_by_account.view` in the [sample app](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/setup-install-app.md). ```java public class DataProviderAccountLookup { public static Slack.OptionDataResponse getAccountsByName(String value) { List accounts; if (String.isNotBlank(value)) { String name = '%' + value + '%'; accounts = [SELECT Id, Name FROM Account WHERE Name LIKE :name WITH SECURITY_ENFORCED LIMIT 10]; } List accountOptions = new List(); if (accounts != null) { for (Account account : accounts) { Slack.Option option = new Slack.Option(account.Name, account.Id); accountOptions.add(option); } } return new Slack.OptionDataResponse(accountOptions); } } ``` ### Multiple Selection To allow multiple selections, set the `multiselect` property to `true`. ```yaml components: - definition: externalSelect properties: multiselect: true placeholder: "Select one or more opportunities" name: "external_select_multi" datasource: definition: "apex__MyDataProvider.getOpportunities" properties: objectApiName: "Opportunity" ``` ### Pre-selected Option Pre-selecting renders the select component with a selected value. To pre-select a value, use one of these methods. 1. Bind an expression directly into the `value` property. This expression must point to a dataProvider that provides preselected values (see [Implement a Data Provider](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/data-providers.md)). 2. Add an array of pre-selected options in the `value` property, or a single [`Slack.OptionDataResponse`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_options.md#optiondataresponse-class) object. **Pre-selected Option Expression Example** ```yaml components: - definition: externalSelect properties: multiselect: true placeholder: "Select one or more opportunities" name: "external_select" value: "{!recordsLookup}" datasource: definition: "apex__MyDataProvider.getOpportunities" properties: objectApiName: "Opportunity" ``` **Pre-selected Option Inline Array Example** ```yaml components: - definition: externalSelect properties: multiselect: true placeholder: "Select one or more opportunities" name: "external_select" value: - text: "Option 1" value: "value1" - text: "Option 2" value: "value2" datasource: definition: "apex__MyDataProvider.getOpportunities" properties: objectApiName: "Opportunity" ``` **Keys** | Key | Type | Required | Description | | ---------------------------------- | ---------------------------------------------------------------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `definition` | String | Yes | The value must be `externalSelect`. | | `properties` | Object | Yes | The component's properties. | | `properties.name` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | Yes | The name applied to the external select items. The name is used to retrieve the value on submission. | | `properties.placeholder` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md), [Plain Text](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#plain-text) | No | A placeholder value for the `externalSelect` menu to display when nothing is selected. The default placeholder value is "Select option(s)". | | `properties.value` | Object, Array of objects, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | Provide a single option object or array of `options` to set as pre-selected. | | `properties.value.text` | String, [Plain Text](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#plain-text), [Mrkdwn](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#mrkdwn) | Yes | A label for the selected item. | | `properties.value.value` | String, [Plain Text](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#plain-text) | No | The value of the selected item. | | `properties.multiselect` | Boolean, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | Indicates whether the external select component supports multiple selections. The default value is `false`. | | `properties.maxSelection` | Number, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | If `multiselect` is `true`, you can optionally specify `maxSelection`. The maximum number of options that can be selected. The minimum value is `1`. | | `properties.minQueryLength` | Number, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | The minimum number of characters that a user must enter into the external select input before results are queried and updated in available selections. The minimum value is `1`. | | `properties.confirm` | [Confirm](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#confirm), [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | A confirmation dialog to display after a radio button is selected. | | `properties.datasource` | String, Object, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | Yes | A valid data provider identifier string or object containing an identifier and properties to be passed into a data provider. | | `properties.datasource.definition` | String, Object, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | Yes | A valid data provider identifier is required to be present within the `datasource` if the `datasource` takes the form of an Object. | | `properties.datasource.properties` | Object, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | Contains any parameters to be passed into the option data provider. | ## Inline Image Available in: [Section](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#section) | [Context](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#context) Display an image alongside additional content, such as text. ![Inline Image example](https://developer.salesforce.com/media/image_element.png) **tip:** For a component that holds only an image, see [image](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#image). Both image components use `- definition: image`. However, they're available in different containing components, and the layout image has a `title` property. **Example** This example is an image within a context component. ```yaml components: - definition: context components: - definition: image properties: url: "https://via.placeholder.com/150" altText: "Placeholder image" - definition: text properties: text: "Check out my image" ``` **Keys** | Key | Type | Required | Description | | -------------------- | ----------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------- | | `definition` | String | Yes | The value must be `image`. | | `properties` | Object | Yes | The component's properties. | | `properties.url` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | Yes | The URL of the image to display. URLs must use a valid protocol scheme such as `http://` or `https://`. | | `properties.altText` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | Yes | A plain text description of the image. | ## Overflow Available in: [Section](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#section) | [Actions](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#actions) An overflow menu in a section or actions component. ![Overflow example](https://developer.salesforce.com/media/overflow_standard.png) **Examples** This example creates an overflow menu with 3 options. ```yaml components: - definition: overflow properties: name: "overflow_example" options: - identifier: "option_1" label: "Option 1" - identifier: "option_2" label: "Option 2" - identifier: "option_3" label: "Option 3" url: "https://www.example.com" ``` This example creates an overflow menu in an actions block. ```yaml components: - definition: modal properties: title: "Overflow Example" submitLabel: "Submit" closeLabel: "Cancel" components: - definition: actions name: "actions_block" components: - definition: overflow properties: name: "overflow_in_section" options: - identifier: "option_1" label: "Option 1" - identifier: "option_2" label: "Option 2" - identifier: "option_3" label: "Option 3" url: "https://www.example.com" confirm: title: "Confirm selection" text: "Please confirm the selection" confirm: "Confirm" deny: "Cancel" style: "primary" ``` **Keys** | Key | Type | Required | Description | | --------------------------- | -------------------------------------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------- | | `definition` | String | Yes | The value must be `overflow`. | | `properties` | Object | Yes | The component's properties. | | `properties.name` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | Yes | A name applied to the overflow element, used to retrieve the value when a menu option is selected. | | `properties.options` | [Options](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#options) | Yes | A list of options to display in the overflow menu. A minimum of 2 options is required and a maximum of 5 options is allowed. | | `properties.confirm` | [Confirm](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#confirm), [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | A confirmation dialog to display after a checkbox is selected. | | `events` | Object | No | Events that trigger an [action](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/actions_handlers_write.md). | | `events.onclick` | Object | No | Fires when an item from the overflow menu is clicked. | | `events.onclick.definition` | String | No | The identifier of the [action](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/actions_handlers_write.md) that executes when the event fires. | | `events.onclick.properties` | Object | No | Properties to pass to the action. | ## Radio Group Available in: [Section](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#section) | [Actions](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#actions) | [Input](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#input) A radio button group that allows a user to choose one item from a list of possible options. ![Radio Button Example](https://developer.salesforce.com/media/radio_standard.png) **Example** On an initial render, Option 1 is selected. ```yaml components: - definition: radioGroup properties: name: "radio_button_group_options" value: "option_1" options: - identifier: "option_1" label: "Option 1" description: "This is a radio button" - identifier: "option_2" label: "Option 2" ``` **Keys** | Key | Type | Required | Description | | ---------------------------- | -------------------------------------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | | `definition` | String | Yes | The value must be `radioGroup`. | | `properties` | Object | Yes | The component's properties. | | `properties.name` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | Yes | The name applied to the radio button inputs. The name is used to retrieve the values on submission. | | `properties.value` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | Optionally indicates the value to select on an initial render. Must match the identifier of one of the items passed in to the `options` field. | | `properties.options` | [Options](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#options) | Yes | A list of radio button items. | | `properties.confirm` | [Confirm](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#confirm), [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | A confirmation dialog to display after a radio button is selected. | | `events` | Object | No | Events that trigger an [action](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/actions_handlers_write.md). | | `events.onchange` | Object | No | Fires when the selected radio in a group of radio buttons is changed. | | `events.onchange.definition` | String | No | The identifier of the [action](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/actions_handlers_write.md) that executes when the event fires. | | `events.onchange.properties` | Object | No | Properties to pass to the action. | ## Select Available in: [Section](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#section) | [Actions](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#actions) | [Input](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#input) A select menu, like a standard HTML `` tag, creates a field where a user can enter freeform data. It can appear as a single-line field or a larger textarea using the multiline flag. Text input fields don't currently support the `onchange` event. You can trigger an interaction payload only by pressing the submit button on your modal. ![Text Input Example](https://developer.salesforce.com/media/textinput_standard.png) **Example** ```yaml components: - definition: input name: "input_block" properties: label: "Name" components: - definition: textInput properties: name: "text_input" placeholder: "Enter Name" value: "Global Media - 400 Widgets" minLength: 2 ``` **Keys** | Key | Type | Required | Description | | ------------------------ | ---------------------------------------------------------------------------------------- | -------- | --------------------------------------------------------------------------------- | | `definition` | String | Yes | The value must be `textInput`. | | `properties` | Object | Yes | The component's properties. | | `properties.name` | String [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | An identifier used to retrieve the value on submission. | | `properties.placeholder` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md), [Plain Text](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#plain-text) | No | A placeholder value for the select menu to display when nothing is selected. | | `properties.value` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | The initial value for the input field. | | `properties.minLength` | Integer, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | The minimum number of characters allowed on form submission. | | `properties.maxLength` | Integer, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | The maximum number of characters allowed on form submission. | | `properties.multiline` | Boolean, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | If `true`, the input field supports multiple lines. The default value is `false`. | ## Time Picker Available in: [Section](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#section) | [Actions](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#actions) | [Input](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#input) Select a time of day to a 15-minute increment. ![Time Picker Example](https://developer.salesforce.com/media/timepicker_standard.png) The time picker renders as a select element. Slack's time picker element is in beta and isn't used by Apex SDK for Slack. **warning:** The time picker doesn't currently support multiple time zones, which can lead to issues when editing and submitting values. For example, if the field value is stored as 11:00 pm PST on 3/9/2022, the time picker displays the time incorrectly as 11:00 pm for users in EST. The time picker does not display the time zone or convert the date to the local time zone. **Example** ```yaml components: - definition: input name: "exampleTimepicker" properties: label: "Example timepicker" hint: "Format: HH:mm" components: - definition: timepicker properties: value: "09:00" placeholder: "Provide a time" name: "exampleTimepicker" ``` **Keys** | Key | Type | Required | Description | | ---------------------------- | ---------------------------------------------------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `definition` | String | Yes | The value must be `timepicker`. | | `properties` | Object | Yes | The component's properties. | | `properties.value` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | The initial time that's selected when the time picker is loaded. The format is `HH:mm` where `HH` is 24-hour format of an hour (00 to 23) and `mm` is minutes with leading zeros (00 to 59). The time zone is local to the Slack user client. | | `properties.placeholder` | String, [Plain Text](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#plain-text), [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | Text used as a placeholder when the `value` is empty. | | `properties.name` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | Yes | A name applied to the time picker. The name is used to retrieve the value on submission. | | `properties.confirm` | [Confirm](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#confirm), [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | A confirmation dialog to display after a time is selected. | | `events` | Object | No | Events that trigger an [action](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/actions_handlers_write.md). | | `events.onchange` | Object | No | Fires when a time is chosen in the time picker. | | `events.onchange.definition` | String | No | The identifier of the [action](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/actions_handlers_write.md) that executes when the event fires. | | `events.onchange.properties` | Object | No | Properties to pass to the action. | ## Users Select Available in: [Section](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#section) | [Actions](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#actions) | [Input](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#input) This multi-select menu populates its options with a list of Slack users visible to the current user in the active workspace. ![Users Select Example](https://developer.salesforce.com/media/usersselect_standard.png) **Example** This example allows a single selection. ```yaml components: - definition: input name: "usersSelectId" properties: label: "Select a user" components: - definition: usersSelect properties: name: "usersSelectName" value: "U01KHPH4A6T" ``` This example allows multiple selections. ```yaml components: - definition: input name: "usersSelectMultiId" properties: label: "Select multiple users" components: - definition: usersSelect properties: name: "usersSelectMultiName" multiselect: true value: - "U01KHPH4A6T" - "WAWUZ49PT" ``` This example shows a comprehensive usage of the `usersSelect` component. ```yaml description: "Example usage of the usersSelect component" components: - definition: modal properties: title: "Users Select Example" submitLabel: "Submit" closeLabel: "Cancel" components: - definition: section properties: text: "Single user select with required properties only" - definition: input name: "usersSelectId" properties: label: "Select a user" components: - definition: usersSelect properties: name: "usersSelectName" - definition: divider - definition: section properties: text: "Single user select with placeholder" - definition: input name: "usersSelectPlaceholderId" properties: label: "Select a user" components: - definition: usersSelect properties: name: "usersSelectPlaceholderName" placeholder: "Choose a user" - definition: divider - definition: section properties: text: "Single user select with initial user" - definition: input name: "usersSelectInitialUserId" properties: label: "Select a user" components: - definition: usersSelect properties: name: "usersSelectInitialUserName" value: "USLACKBOT" - definition: divider - definition: section properties: text: "Single user select as required input" - definition: input name: "usersSelectRequiredId" properties: label: "Select a user" required: true components: - definition: usersSelect properties: name: "usersSelectRequiredName" - definition: divider - definition: section properties: text: "Single user select with confirm dialog" - definition: input name: "usersSelectConfirmId" properties: label: "Select a user" components: - definition: usersSelect properties: name: "usersSelectConfirmName" confirm: title: "Confirm user selection" text: "Please confirm the user selection" confirm: "Confirm" deny: "Cancel" style: "primary" - definition: divider - definition: section properties: text: "Multi user select with required properties only" - definition: input name: "usersMultiSelectId" properties: label: "Select users" components: - definition: usersSelect properties: name: "usersMultiSelectName" multiselect: true - definition: divider - definition: section properties: text: "Multi user select with initial users" - definition: input name: "usersMultiSelectInitialUsersId" properties: label: "Select users" components: - definition: usersSelect properties: name: "usersMultiSelectInitialUsersName" multiselect: true value: - "USLACKBOT" - "U01KZHYT6RY" # Slack Developer Tools user; depending on the workspace used this user may not exist - definition: divider - definition: section properties: text: "Multi user select with max selection" - definition: input name: "usersMultiSelectMaxSelectionId" properties: label: "Select users" components: - definition: usersSelect properties: name: "usersMultiSelectMaxSelectionName" multiselect: true maxSelection: 2 ``` **Keys** | Key | Type | Required | Description | | ---------------------------- | ---------------------------------------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `definition` | String | Yes | The value must be `usersSelect`. | | `properties` | Object | Yes | The component's properties. | | `properties.name` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | An identifier used to retrieve the value on submission. | | `properties.placeholder` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md), [Plain Text](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#plain-text) | No | A placeholder value to display when nothing is selected. | | `properties.value` | String, Array, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | Indicates the user, or users if `multiselect`, selected on an initial render. Must match the ID of a user in Slack. If the value is an array, it's an array of strings. | | `properties.confirm` | [Confirm](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#confirm), [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | A confirmation dialog to display after a radio button is selected. | | `properties.multiselect` | Boolean, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | Indicates whether the select component supports multiple selections. The default value is `false`. | | `properties.maxSelection` | Number, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | If `multiselect` is `true`, you can optionally specify `maxSelection`. The maximum number of options that can be selected. The minimum value is `1`. | | `events` | Object | No | Events that trigger an [action](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/actions_handlers_write.md). | | `events.onchange` | Object | No | Fires when a user is selected, or the multi-select menu is confirmed. | | `events.onchange.definition` | String | No | The identifier of the [action](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/actions_handlers_write.md) that executes when the event fires. | | `events.onchange.properties` | Object | No | Properties to pass to the action. | # Enable Slack for Salesforce Beta Accept the Beta Terms of Service so your org gets uninterrupted access to Slack connectivity. Enabling Slack for Salesforce also makes a collection of Salesforce apps for Slack available to your org. To enable Slack for Salesforce: 1. From Setup, in the Quick Find box, enter _Slack_, and then select **Initial Slack Setup**. 2. Review the Terms and Conditions for enabling the beta service. 3. Click to accept the terms. **See Also** - [Salesforce Apps for Slack Release Notes](https://help.salesforce.com/s/articleView?id=slack.salesforce_apps_for_slack_rns.htm&type=5) - [Salesforce Apps for Slack](https://help.salesforce.com/s/articleView?id=slack.slack_apps.htm&type=5) # Event Examples Customize your app's behavior in response to activities in Slack. Here are a few event handling examples to help you get started. Before you can handle an event, [subscribe to the event in your app manifest and register the event handler](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/events_handling.md). **tip:** Most of these examples are available in the [sample Apex SDK for Slack app](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/setup-install-app.md). ## app_home_opened This example displays a message in the App Home. ```yaml # ApexSlackApp.slackapp # Other app configuration here # Register event handlers events: app_home_opened: action: definition: apex__action__EventDispatcherAppHomeOpened title: Example event handler for app_home_opened description: The event fires when a user opens the home tab. ``` The `app_home` view is published using [`Slack.ViewsPublishRequest`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_views.md#viewspublishrequest-class) and [`Slack.ViewsPublishResponse`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_views.md#viewspublishresponse-class). ```yaml # app_home.view description: "This is a simple app home" schema: properties: bodyText: type: string required: true headerText: type: string defaultValue: "Welcome Home" components: - definition: home components: - definition: header properties: text: "{!view.properties.headerText}" - definition: section properties: text: type: "mrkdwn" text: "{!view.properties.bodyText}" - definition: divider ``` Set the expression values in the event handler using the [`Slack.ViewReference`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_dispatchers.md#viewreference-class) class. ```java public class EventDispatcherAppHomeOpened extends Slack.EventDispatcher { public override Slack.ActionHandler invoke(Slack.EventParameters parameters, Slack.RequestContext context) { return Slack.ActionHandler.ack(new Handler(parameters, context)); } public class Handler implements Slack.RunnableHandler { Slack.EventParameters parameters; Slack.RequestContext context; public Handler(Slack.EventParameters parameters, Slack.RequestContext context) { this.parameters = parameters; this.context = context; } public void run() { // Name must match the DeveloperName of your SlackApp. Slack.App app = Slack.App.ApexSlackApp.get(); Slack.BotClient botClient = app.getBotClientForTeam(context.getTeamId()); Slack.AppHomeOpenedEvent appHomeOpened = (Slack.AppHomeOpenedEvent) parameters.getEvent(); String userId = appHomeOpened.getUser(); Slack.ViewReference viewReference = Slack.View.app_home.get(); viewReference.setParameter('headerText', 'Welcome to the Apex Slack App Example.'); viewReference.setParameter('bodyText', 'To see how this custom home view was created, see the EventDispatcherAppHomeOpened apex class.'); Slack.HomeView homeView = new Slack.HomeView.builder().viewReference(viewReference).build(); Slack.ViewsPublishRequest req = new Slack.ViewsPublishRequest.builder().userId(userId).view(homeView).build(); Slack.ViewsPublishResponse response = botClient.viewsPublish(req); if (response.getError() != null) { System.debug(response.getResponseMetadata().getMessages()); } } } } ``` ## channel_rename and group_rename This example responds to a channel (public or private) rename by posting a message. ```yaml # ApexSlackApp.slackapp # Other app configuration here # Register event handlers events: channel_rename: action: definition: apex__action__RenameEventExample title: Example channel rename event description: example event that fires when a user renames a channel. group_rename: action: definition: apex__action__RenameEventExample title: Example channel rename event description: example event that fires when a user renames a channel. ``` Get the event parameters using the [`Slack.Event` class](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#event-class) and check if the event is an instance of the [`Slack.ChannelRenameEvent`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#channelrenameevent-class) or [`Slack.GroupRenameEvent`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#grouprenameevent-class) class. ```java public class RenameEventExample extends Slack.EventDispatcher { public override Slack.ActionHandler invoke(Slack.EventParameters parameters, Slack.RequestContext context) { return Slack.ActionHandler.ack(new Handler(parameters, context)); } public class Handler implements Slack.RunnableHandler { Slack.EventParameters parameters; Slack.RequestContext context; public Handler(Slack.EventParameters parameters, Slack.RequestContext context) { this.parameters = parameters; this.context = context; } public void run() { // Name must match the DeveloperName of your SlackApp. Slack.App app = Slack.App.ApexSlackApp.get(); Slack.BotClient botClient = app.getBotClientForTeam(this.context.getTeamId()); Slack.Event event = this.parameters.getEvent(); String channelId = ''; String channelName = ''; if (event instanceof Slack.GroupRenameEvent) { Slack.GroupRenameEvent groupRenameEvent = (Slack.GroupRenameEvent) event; channelId = groupRenameEvent.getChannel().getId(); channelName = groupRenameEvent.getChannel().getName(); } else if (event instanceof Slack.ChannelRenameEvent) { // Group rename will only work if the app is added as an integration to the private channel. Slack.ChannelRenameEvent channelRenameEvent = (Slack.ChannelRenameEvent) event; channelId = channelRenameEvent.getChannel().getId(); channelName = channelRenameEvent.getChannel().getName(); } Slack.ChatPostMessageResponse response = botClient.chatPostMessage( Slack.ChatPostMessageRequest.builder().channel(channelId).text('The channel was renamed to ' + channelName).build() ); if (response.getError() != null) { System.debug(response.getResponseMetadata().getMessages()); } } } } ``` ## reaction_added and reaction_removed This example responds to a user adding and removing an emoji on an item. ```yaml # ApexSlackApp.slackapp # Other app configuration here # Register event handlers events: reaction_added: action: definition: apex__action__ReactionEventExample title: Example reaction added event description: example reaction added to message. reaction_removed: action: definition: apex__action__ReactionEventExample title: Example reaction removed event description: example reaction removed from message. ``` Get the event parameters using the [`Slack.Event` class](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#event-class) and check if the event is an instance of the [`Slack.ReactionAddedEvent`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#reactionaddedevent-class) or [`Slack.ReactionRemovedEvent`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#reactionremovedevent-class) class. ```java public class ReactionEventExample extends Slack.EventDispatcher { public override Slack.ActionHandler invoke(Slack.EventParameters parameters, Slack.RequestContext context) { return Slack.ActionHandler.ack(new Handler(parameters, context)); } public class Handler implements Slack.RunnableHandler { Slack.EventParameters parameters; Slack.RequestContext context; public Handler(Slack.EventParameters parameters, Slack.RequestContext context) { this.parameters = parameters; this.context = context; } public void run() { // Name must match the DeveloperName of your SlackApp. Slack.App app = Slack.App.ApexSlackApp.get(); Slack.BotClient botClient = app.getBotClientForTeam(this.context.getTeamId()); Slack.Event event = this.parameters.getEvent(); String channelId = ''; String channelName = ''; String text = getBaseText(event); if (event instanceof Slack.ReactionAddedEvent) { Slack.ReactionAddedEvent reactionAddedEvent = (Slack.ReactionAddedEvent) event; channelId = reactionAddedEvent.getItem().getChannel(); text += reactionAddedEvent.getReaction(); } else if (event instanceof Slack.ReactionRemovedEvent) { Slack.ReactionRemovedEvent reactionRemovedEvent = (Slack.ReactionRemovedEvent) event; channelId = reactionRemovedEvent.getItem().getChannel(); text += reactionRemovedEvent.getReaction(); } Slack.ChatPostMessageResponse response = botClient.chatPostMessage( Slack.ChatPostMessageRequest.builder().channel(channelId).text(text).build() ); if (response.getError() != null) { System.debug(response.getResponseMetadata().getMessages()); } } private String getBaseText(Slack.Event event) { if (event instanceof Slack.ReactionAddedEvent) { return 'Reaction added is: '; } else if (event instanceof Slack.ReactionRemovedEvent) { return 'Reaction removed is: '; } else { return ''; } } } } ``` ## message This example creates a channel based on a user's message post containing the string "create channel [channel name]" where [channel name] is the name of the channel that will be joined by dashes. For example, "create channel demo channel" creates a channel called #demo-channel. You can also automatically add the user who issued the message to the new channel. ```yaml # ApexSlackApp.slackapp # Other app configuration here # Register event handlers events: message: action: definition: apex__action__MessageEventExample title: Message sent description: A message was sent to me ``` Create the specified channel using the [`Slack.ConversationsCreateResponse`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_conversations.md#conversationscreateresponse-class) and [`Slack.ConversationsCreateRequest`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_conversations.md#conversationscreaterequest-class). Next, invite the user who issued the command to the new channel using [`Slack.ConversationsInviteResponse`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_conversations.md#conversationsinviteresponse-class) and [`Slack.ConversationsInviteRequest`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_conversations.md#conversationsinviterequest-class). ```java public class MessageEventExample extends Slack.EventDispatcher { public override Slack.ActionHandler invoke(Slack.EventParameters parameters, Slack.RequestContext context) { return Slack.ActionHandler.ack(new Handler(parameters, context)); } public class Handler implements Slack.RunnableHandler { Slack.EventParameters parameters; Slack.RequestContext context; String CREATE_CHANNEL_TOKEN = 'create channel'; public Handler(Slack.EventParameters parameters, Slack.RequestContext context) { this.parameters = parameters; this.context = context; } public void run() { // Name must match the DeveloperName of your SlackApp. Slack.App app = Slack.App.ApexSlackApp.get(); Slack.BotClient botClient = app.getBotClientForTeam(this.context.getTeamId()); Slack.Event event = this.parameters.getEvent(); if (event instanceof Slack.MessageEvent){ handleMessageEvent(app, botClient, event); } } private void handleMessageEvent(Slack.App app, Slack.BotClient botClient, Slack.Event event){ Slack.MessageEvent messageEvent = (Slack.MessageEvent)event; String channelId = messageEvent.getChannel(); String message = messageEvent.getText(); // User sent the message if (messageEvent.getBotId() == null){ System.debug(message); if (message.toLowerCase().startsWith(CREATE_CHANNEL_TOKEN)){ if (message.trim().length() == CREATE_CHANNEL_TOKEN.length()){ sendChatMessage(app, botClient, channelId, 'You need to specify a channel name'); } else { String channelToCreate = message.substring(CREATE_CHANNEL_TOKEN.length() + 1); // Remove any spaces channelToCreate = channelToCreate.replaceAll(' ', '-'); // Create the channel Slack.ConversationsCreateResponse convCreateResponse = botClient.conversationsCreate( Slack.ConversationsCreateRequest.builder().name(channelToCreate).isprivate(false).build() ); if (convCreateResponse.getError() == null) { // Get channel Id & user who just issued this command String newChannelId = convCreateResponse.getChannel().getId(); List users = new List(); users.add(messageEvent.getUser()); // Add them to the newly created channel Slack.ConversationsInviteResponse convInviteResponse = botClient.conversationsInvite( Slack.ConversationsInviteRequest.builder().channel(newChannelId).users(users).build() ); if (convInviteResponse.getError() == null){ sendChatMessage(app, botClient, channelId, ':tada: Channel #' + channelToCreate + ' was created and you were added to it, enjoy! :tada:'); } else { sendChatMessage(app, botClient, channelId, 'Successfully created the channel, but trying to add you I sadly I got an error: ' + convInviteResponse.getError()); } } else { // Handle error sendChatMessage(app, botClient, channelId, 'Sadly I got an error: ' + convCreateResponse.getError()); } } } else { sendChatMessage(app, botClient, channelId, 'Ask me to "Create Channel "'); } } } private void sendChatMessage(Slack.App app, Slack.BotClient botClient, String channelId, String message){ Slack.ChatPostMessageResponse response = botClient.chatPostMessage( Slack.ChatPostMessageRequest.builder().channel(channelId).text(message).build() ); if (response.getError() != null) { System.debug(response.getResponseMetadata().getMessages()); } } } } ``` # Event Subscriptions Your app can subscribe to and handle Slack events based on the [Events API](https://api.slack.com/events?filter=Events). The `app_uninstalled` and `tokens_revoked` events are required if you expect to disconnect your Slack app from an org and reconnect to a different org. See [Org Connections](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/orgs-multi.md). **note:** `message_metadata_*` and `workflow_*` events are not supported. ## Slack Events The Slack events correspond to the following Apex classes. **tip:** To ensure that your app handles Slack events correctly, include the required scopes listed on the Slack event documentation in your app manifest and `MySlackAppName.slackapp-meta.xml` file. | Slack Event Name | Description | Apex Class | | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [app_home_opened](https://api.slack.com/events/app_home_opened) | User clicked into your App Home | [Slack.AppHomeOpenedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#apphomeopenedevent-class) | | [app_mention](https://api.slack.com/events/app_mention) | Subscribe to only the message events that mention your app or bot | [Slack.AppMentionEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#appmentionevent-class) | | [app_rate_limited](https://api.slack.com/events/app_rate_limited) | Your app's event subscriptions are being rate limited | [Slack.AppRateLimitedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#appratelimitedevent-class) | | [app_requested](https://api.slack.com/events/app_requested) | User requested an app | [Slack.AppRequestedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#apprequestedevent-class) | | [app_uninstalled](https://api.slack.com/events/app_uninstalled) | Your Slack app was uninstalled | [Slack.AppUninstalledEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#appuninstalledevent-class) | | [call_rejected](https://api.slack.com/events/call_rejected) | A call was rejected | [Slack.CallRejectedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#callrejectedevent-class) | | [channel_archive](https://api.slack.com/events/channel_archive) | A channel was archived | [Slack.ChannelArchiveEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#channelarchiveevent-class) | | [channel_created](https://api.slack.com/events/channel_created) | A channel was created | [Slack.ChannelCreatedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#channelcreatedevent-class) | | [channel_deleted](https://api.slack.com/events/channel_deleted) | A channel was deleted | [Slack.ChannelDeletedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#channeldeletedevent-class) | | [channel_history_changed](https://api.slack.com/events/channel_history_changed) | Bulk updates were made to a channel's history | [Slack.ChannelHistoryChangedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#channelhistorychangedevent.class) | | [channel_id_changed](https://api.slack.com/events/channel_id_changed) | A channel ID was changed | [Slack.ChannelIdChangedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#channelidchangedevent-class) | | [channel_left](https://api.slack.com/events/channel_left) | You left a channel | [Slack.ChannelLeftEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#channelleftevent-class) | | [channel_rename](https://api.slack.com/events/channel_rename) | A channel was renamed | [Slack.ChannelRenameEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#channelrenameevent-class) | | [channel_shared](https://api.slack.com/events/channel_shared) | A channel has been shared with an external workspace | [Slack.ChannelSharedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#channelsharedevent-class) | | [channel_unarchive](https://api.slack.com/events/channel_unarchive) | A channel was unarchived | [Slack.ChannelUnarchiveEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#channelunarchiveevent-class) | | [channel_unshared](https://api.slack.com/events/channel_unshared) | A channel has been unshared with an external workspace | [Slack.ChannelUnsharedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#channelunsharedevent-class) | | [dnd_updated](https://api.slack.com/events/dnd_updated) | Do not Disturb settings changed for the current user | [Slack.DndUpdatedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#dndupdatedevent-class) | | [dnd_updated_user](https://api.slack.com/events/dnd_updated_user) | Do not Disturb settings changed for a member | [Slack.DndUpdatedUserEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#dndupdateduserevent-class) | | [email_domain_changed](https://api.slack.com/events/email_domain_changed) | The workspace email domain has changed | [Slack.EmailDomainChangedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#emaildomainchangedevent-class) | | [ekm_access_denied](https://api.slack.com/events/message/ekm_access_denied) | A piece of content was redacted by an admin | [Slack.MessageEkmAccessDeniedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#messageekmaccessdeniedevent-class) | | [emoji_changed](https://api.slack.com/events/emoji_changed) | A custom emoji has been added or changed | [Slack.EmojiChangedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#emojichangedevent-class) | | [file_change](https://api.slack.com/events/file_change) | A file was changed | [Slack.FileChangeEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#filechangeevent-class) | | [file_created](https://api.slack.com/events/file_created) | A file was created | [Slack.FileCreatedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#filecreatedevent-class) | | [file_deleted](https://api.slack.com/events/file_deleted) | A file was deleted | [Slack.FileDeletedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#filedeletedevent-class) | | [file_public](https://api.slack.com/events/file_change) | A file was made public | [Slack.FilePublicEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#filepublicevent-class) | | [file_shared](https://api.slack.com/events/file_shared) | A file was shared | [Slack.FileSharedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#filesharedevent-class) | | [file_unshared](https://api.slack.com/events/file_change) | A file was unshared | [Slack.FileUnsharedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#fileunsharedevent-class) | | [grid_migration_finished](https://api.slack.com/events/grid_migration_finished) | An enterprise grid migration has finished on this workspace. | [Slack.GridMigrationFinishedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#gridmigrationfinishedevent-class) | | [grid_migration_started](https://api.slack.com/events/grid_migration_started) | An enterprise grid migration has started on this workspace. | [Slack.GridMigrationStartedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#gridmigrationstartedevent-class) | | [group_archive](https://api.slack.com/events/group_archive) | A private channel was archived | [Slack.GroupArchiveEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#grouparchiveevent-class) | | [group_close](https://api.slack.com/events/group_close) | You closed a private channel | [Slack.GroupCloseEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#groupcloseevent-class) | | [group_deleted](https://api.slack.com/events/group_deleted) | A private channel was deleted | [Slack.GroupDeletedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#groupdeletedevent-class) | | [group_history_changed](https://api.slack.com/events/group_history_changed) | Bulk updates were made to a private channel's history | [Slack.GroupHistoryChangedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#grouphistorychangedevent-class) | | [group_left](https://api.slack.com/events/group_left) | You left a private channel | [Slack.GroupLeftEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#groupleftevent-class) | | [group_open](https://api.slack.com/events/group_open) | You created a group DM | [Slack.GroupOpenEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#groupopenevent-class) | | [group_rename](https://api.slack.com/events/group_rename) | A private channel was renamed | [Slack.GroupRenameEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#grouprenameevent-class) | | [group_unarchive](https://api.slack.com/events/group_unarchive) | A private channel was unarchived | [Slack.GroupUnarchiveEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#groupunarchiveevent-class) | | [im_close](https://api.slack.com/events/im_close) | You closed a DM | [Slack.ImCloseEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#imcloseevent-class) | | [im_created](https://api.slack.com/events/im_created) | A DM was created | [Slack.ImCreatedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#imcreatedevent-class) | | [im_history_changed](https://api.slack.com/events/im_history_changed) | Bulk updates were made to a DM's history | [Slack.ImHistoryChangedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#imhistorychangedevent-class) | | [im_open](https://api.slack.com/events/im_open) | You opened a DM | [Slack.ImOpenEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#imopenevent-class) | | [invite_requested](https://api.slack.com/events/invite_requested) | User requested an invite | [Slack.InviteRequestedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#inviterequestedevent-class) | | [link_shared](https://api.slack.com/events/link_shared) | A message was posted containing one or more links relevant to your application | [Slack.LinkSharedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#linksharedevent-class) | | [member_joined_channel](https://api.slack.com/events/member_joined_channel) | A user joined a public or private channel | [Slack.MemberJoinedChannelEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#memberjoinedchannelevent-class) | | [member_left_channel](https://api.slack.com/events/member_left_channel) | A user left a public or private channel | [Slack.MemberLeftChannelEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#memberleftchannelevent-class) | | [message](https://api.slack.com/events/message) | A message was sent to a channel | [Slack.MessageEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#messageevent-class), [Slack.MessageBotEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#messagebotevent-class), [Slack.MessageChangedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#messagechangedevent-class), [Slack.MessageChannelJoinEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#messagechanneljoinevent-class), [Slack.MessageChannelPostingPermissionsEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#messagechannelpostingpermissionsevent-class), [Slack.MessageChannelTopicEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#messagechanneltopicevent-class), [Slack.MessageDeletedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#messagedeletedevent-class), [Slack.MessageFileShareEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#messagefileshareevent-class), [Slack.MessageGroupTopicEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#messagegrouptopicevent-class), [Slack.MessageMeEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#messagemeevent-class), [Slack.MessageRepliedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#messagerepliedevent-class), [Slack.MessageThreadBroadcastEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#messagethreadbroadcastevent-class) | | [message.channels](https://api.slack.com/events/message.channels) | A message was posted to a channel | [Slack.MessageEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#messageevent-class) | | [message.groups](https://api.slack.com/events/message.groups) | A message was posted to a private channel | [Slack.MessageEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#messageevent-class) | | [message.im](https://api.slack.com/events/message.im) | A message was posted in a direct message channel | [Slack.MessageEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#messageevent-class) | | [message.mpim](https://api.slack.com/events/message.mpim) | A message was posted in a multiparty direct message channel | [Slack.MessageEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#messageevent-class) | | [pin_added](https://api.slack.com/events/pin_added) | A pin was added to a channel | [Slack.PinAddedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#pinaddedevent-class) | | [pin_removed](https://api.slack.com/events/pin_removed) | A pin was removed from a channel | [Slack.PinRemovedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#pinremovedevent-class) | | [reaction_added](https://api.slack.com/events/reaction_added) | A member added an emoji reaction to an item | [Slack.ReactionAddedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#reactionaddedevent-class) | | [reaction_removed](https://api.slack.com/events/reaction_removed) | A member removed an emoji reaction | [Slack.ReactionRemovedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#reactionremovedevent-class) | | [scope_denied](https://api.slack.com/events/scope_denied) | [Deprecated](#deprecated-events). OAuth scopes were denied to your app | [Slack.ScopeDeniedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#scopedeniedevent-class) | | [scope_granted](https://api.slack.com/events/scope_granted) | [Deprecated](#deprecated-events). OAuth scopes were granted to your app | [Slack.ScopeGrantedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#scopegrantedevent-class) | | [star_added](https://api.slack.com/events/star_added) | A member has starred an item | [Slack.StarAddedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#staraddedevent-class) | | [star_removed](https://api.slack.com/events/star_removed) | A member removed a star | [Slack.StarRemovedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#starremovedevent-class) | | [subteam_created](https://api.slack.com/events/subteam_created) | A User Group has been added to the workspace | [Slack.SubteamCreatedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#subteamcreatedevent-class) | | [subteam_members_changed](https://api.slack.com/events/subteam_members_changed) | The membership of an existing User Group has changed | [Slack.SubteamMembersChangedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#subteammemberschangedevent-class) | | [subteam_self_added](https://api.slack.com/events/subteam_self_added) | You have been added to a User Group | [Slack.SubteamSelfAddedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#subteamselfaddedevent-class) | | [subteam_self_removed](https://api.slack.com/events/subteam_self_removed) | You have been removed from a User Group | [Slack.SubteamSelfRemovedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#subteamselfremovedevent-class) | | [subteam_updated](https://api.slack.com/events/subteam_updated) | An existing User Group has been updated or its members changed | [Slack.SubteamUpdatedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#subteamupdatedevent-class) | | [team_access_granted](https://api.slack.com/events/team_access_granted) | Access to a set of teams was granted to your app | [Slack.TeamAccessGrantedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#teamaccessgrantedevent-class) | | [team_access_revoked](https://api.slack.com/events/team_access_revoked) | Access to a set of teams was revoked from your app | [Slack.TeamAccessRevokedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#teamaccessrevokedevent-class) | | [team_domain_change](https://api.slack.com/events/team_domain_change) | The workspace domain has changed | [Slack.TeamDomainChangeEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#teamdomainchangedevent-class) | | [team_join](https://api.slack.com/events/team_join) | A new member has joined | [Slack.TeamJoinEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#teamjoinevent-class) | | [team_rename](https://api.slack.com/events/team_rename) | The workspace name has changed | [Slack.TeamRenameEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#teamrenameevent-class) | | [tokens_revoked](https://api.slack.com/events/tokens_revoked) | API tokens for your app were revoked | [Slack.TokensRevokedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#tokensrevokedevent-class) | | [user_change](https://api.slack.com/events/user_change) | A member's data has changed | [Slack.UserChangeEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#userchangedevent-class) | | [user_resource_denied](https://api.slack.com/events/user_resource_denied) | User resource was denied to your app | [Slack.UserResourceDeniedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#userresourcedeniedevent-class) | | [user_resource_granted](https://api.slack.com/events/user_resource_granted) | User resource was granted to your app | [Slack.UserResourceGrantedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#userresourcegrantedevent-class) | | [user_resource_removed](https://api.slack.com/events/user_resource_removed) | User resource was removed from your app | [Slack.UserResourceRemovedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#userresourceremovedevent-class) | ## Synthetic Events Synthetic events are specific to the Apex SDK and don't have a Slack equivalent. The following synthetic event is available. | Event Name | Description | | ------------------------------------------------------------------------------- | --------------------------------------------------------------------------- | | [UisfUserAuthedEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#uisfuserauthedevent-class) | A user successfully authenticated and connected the app to a Salesforce org | **important:** Persisting app home views based on a user's authentication status is currently not supported. ## Deprecated Events Slack [retired legacy workspace apps](https://api.slack.com/changelog/2021-03-workspace-apps-to-retire-in-august-2021#events), which also deprecated the following events. - resources_added - resources_removed - scope_denied - scope_granted scope_denied and scope_granted map to corresponding Apex classes (Slack.ScopeDeniedEvent and Slack.ScopeGrantedEvent) but these Apex classes are no longer supported. # Events Events enable apps and bots to respond to activities in Slack. Your app can subscribe to events such as messages being posted, reactions being emoted, users joining the team, or users adding a reaction, and more. # Expressions Expressions enable you to access property values and other data for dynamic output. Use expressions to reference the data from your data providers and view the definition schema throughout a view. You can also use expressions to calculate, format, or transform data fields. **tip:** You don't need to implement a view data provider to use expressions that reference `views.properties` because Apex SDK for Slack does that for you. There are two types of expressions. - Data provider expressions - Formula expressions Expressions must be enclosed in brackets like `{!expression}`. The `{!}` wrapper tells the framework that the string is an expression that must be resolved. ## Data Provider Expression Syntax To write an expression, use the `key` of the data provider reference. The framework resolves the expression to the value from the corresponding data provider and renders the value in the view. Data provider expressions follow this period-delimited string syntax. ```yml "{!.}" ``` - `` maps the expression to a data provider. - `` are references to properties from the data provider. For example, `{!view.properties.*}` represents an expression that resolves data passed into the view. See [View Expression Syntax](#view-expression-syntax). To determine the valid properties, check the documentation for the data provider you're using. For example, `{!record.data.fields.Name.value}` is from the record data provider backed by [UI API](https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_responses_record.htm). For a data provider that returns a primitive, the expression looks like `{!key}`. For a data provider that returns an object, the expression uses properties specific to the object definition, such as `{!contact.Name}`. You can also reference an expression of any type within a string, which makes it easy to construct variable strings. ```yaml "There are {!view.properties.numResults} results found!" ``` For more information, see [Implement a Data Provider](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/data-providers.md). **important:** All expressions in view definitions are case-sensitive. For example, `{!label.labelName}` works but `{!Label.labelName}` doesn't. ### View Expression Syntax View expressions are special data provider expressions that are resolved from data passed into the [view](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/views.md). View expressions follow this period-delimited string syntax. ```yml "{!view..}" ``` - `` maps to the type of top-level data passed into the view. Currently, only `properties` is supported. - `` are the references to the top-level view data. For example, `{!view.properties.objectApiName}`. Here's an example view that contains several expressions. ```yaml schema: properties: bodyText: type: string required: true headerText: type: string defaultValue: "Welcome Home" components: - definition: home components: - definition: header properties: text: "{!view.properties.headerText}" - definition: section properties: text: type: "mrkdwn" text: "{!view.properties.bodyText}" - definition: divider ``` ### Custom Label Expression Syntax Custom label expressions resolve to custom labels in Salesforce. ```yaml "{!label..}" ``` - `` is the optional namespace. `c` is the default namespace. Include the namespace if your org has a namespace or to access a label in a managed package. - `` is the name of the label. See [Work with Custom Labels](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/localization.md#work-with-custom-labels). ## Formula Expression Syntax Formula expressions help you calculate values dynamically, such as to enforce a validation rule or apply a value on a field when a user creates a record. It’s based on the Salesforce Formula Engine library [[GitHub Repo](https://github.com/salesforce/formula-engine)]. For details of the formula syntax, operators, and functions, see [Formula Operators and Functions](https://help.salesforce.com/s/articleView?id=platform.customize_functions.htm&type=5) in Salesforce Help. Formula expressions follow this general format: ```yaml { !formula_expression } ``` **important:** Apex SDK for Slack currently has limited support for formula expressions. Expressions that include string concatenation by using the `+` operator and functions such as `SUBSTITUTE()` and `LABEL()` aren’t yet supported. Here are a few formula expression examples. - This example uses a data provider expression to resolve to a name value on a record field. For example, `John Smith`. In general, any valid data provider expression can be referenced by a formula field. ```yaml "{!record.data.fields.Name.value}" ``` - This formula expression calls the [`FORMAT` function](https://help.salesforce.com/s/articleView?id=platform.customize_functions_parent.htm&type=5). ```yaml { !FORMAT(label.help.headerTemplate , commandInfo.commandName) } ``` `label.help.headerTemplate` is a label provider expression that resolves to a text template pattern. `commandInfo.commandName` is an iteration data provider expression, where `commandInfo` is the iteration item. If `label.help.headerTemplate` resolves to `"*Command*: {0}"` and `commandInfo.commandName` resolves to `"search"`, then this expression evaluates to a String value of `"*Command*: search"`. **note:** We recommend using the `FORMAT` formula function to handle your string templating use cases. ## Bind Data to a View You can bind your expressions to a view by referencing its schema. Here's a simple view with a default string passed into its `view.properties` schema. ```yaml description: An test page schema: properties: title: type: string defaultValue: "World" dataproviders: label: definition: label properties: lang: en components: - definition: section properties: text: "Test Page" - definition: section properties: text: "Message: {!FORMAT('Hello {0}! This is a {1}', view.properties.title, 'test.')}" ``` Let's look at the expression in the view. ```yaml {!FORMAT('Hello {0}! This is a {1}', view.properties.title, 'test.')} ``` The expression resolves to `Hello World! This is a test.` `{0}` and `{1}` are placeholder tokens that resolve to the second argument and third argument to the FORMAT function respectively. So, `{0}` resolves to `World`, provided by `view.properties.title`. You can also bind a view to a data provider by using the `record` key. This example uses the `record_detail_message.view` view from the [sample app](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/setup-install-app.md). The view has one data provider with the `record` key. The data provider determines the structure of the returned data. This data provider is backed by [UI API](https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_responses_record.htm). ```yaml "{!record.value}" ``` The view has one input property, `recordId`. To use the value of `recordId` in the view, build an expression by using `view.properties`. ```yaml "{!view.properties.recordId}" ``` The view definition looks like this. ```yaml description: "This component displays record details in a message" schema: properties: headerText: type: string defaultValue: "Record Details" recordId: type: string required: true objectApiName: type: string required: true dataproviders: record: definition: "apex__RecordDataProvider.getRecord" properties: recordId: "{!view.properties.recordId}" objectApiName: "{!view.properties.objectApiName}" components: - definition: message components: - definition: header properties: text: "{!view.properties.headerText}" - definition: divider - definition: iteration properties: foreach: "{!record}" foritem: "record" components: - definition: section properties: text: text: "{!record.label}: {!record.value}" type: mrkdwn ``` # Get Started This guide shows you how to build Slack apps using Apex and connect to a Salesforce org. To create and work with a managed package, you need a Developer Edition org to reserve a namespace. If you're working with second-generation packaging (2GP), enable Dev Hub in an org so you can create and manage scratch orgs and 2GPs. To develop and distribute Slack apps for Salesforce, we recommend that you have a working knowledge of these technologies. - [Apex Development](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode) - [Distributing Apps on AppExchange](https://developer.salesforce.com/docs/atlas.en-us.packagingGuide.meta/packagingGuide) - [Salesforce Developer Experience (DX)](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev) To get started with your first Slack app, accept the Beta Terms of Service, set up your development environment, configure your Dev Hub org, and make sure you have a Slack workspace that you can deploy apps to. For general information about developing apps for Slack, see [Slack's documentation](https://api.slack.com/start/overview) and the [Develop apps for Slack trail](https://trailhead.salesforce.com/en/content/learn/trails/develop-slack-apps). # Handle Slack Actions Write handlers to respond to Slack actions, such as those initiated by global and message shortcuts, slash commands, and events. When a user makes a request in Slack, an Apex handler contains the logic that responds to the request. # Implement a Data Provider A data provider is a reference to a source of data. It's implemented as a function within an Apex class. To pull data into a view, bind the view to a data provider. To reference the data throughout a view, use an [expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/expressions.md). ## Apex Data Types You can use these data types for input and output in Apex methods. | Data Type | Description | Examples | | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [Primitive](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_primitives.htm) | Boolean, Date, DateTime, Decimal, Double, Integer, Long, and String | - [Primitive Input and Primitive Output](#primitive-input-and-primitive-output)
- [Primitive Input and List\ Output](#primitive-input-and-primitive-list-output) | | [sObject](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_SObject_types.htm) | A row of data declared using the SOAP API name of the object. Both standard and custom objects are supported. | - [Standard Object Input and List Output](#standard-object-input-and-list-output)
- [Custom Object Output](#custom-object-output)
- [List\ Output](#sobject-list-output)
- [Map with Contact List Output](#map-with-contact-list-output) | | [Apex](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_understanding.htm) | An instance of an Apex class | [Apex Class Output](#apex-class-output) | | [Collection](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_collections.htm) | A list, set, or map | - [Standard Object Input and List Output](#standard-object-input-and-list-output)
-[List\ Output](#sobject-list-output)
- [Primitive Input and List\ Output](#primitive-input-and-primitive-list-output)
- [Map with Contact List Output](#map-with-contact-list-output) | ## Bind Apex Methods to Components To bind a data provider to a component, follow this syntax for the definition value. ```yaml apex__[ApexNamespace].ApexClassName.ApexMethod ``` For example: ```yaml dataproviders: yourData: definition: "apex__MyDataProvider.getYourDataFromApexClass" ``` The arguments passed to the Apex method are specified as properties to the data provider. The property key must match the name of the parameter in the Apex method signature. ## Data Providers for Select and External Select Components The [Select](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/elements.md#select) component uses the `dataproviders` property to bind a data provider to the view. To create a data provider for a Select component, construct a [`List` or `List`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_options.md) for your view definition. The [External Select](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/elements.md#external-select) component uses the `datasource` property to bind a data provider to the view. For the External Select component, your Apex methods must follow certain method signature restrictions. - Must have a String value as the first parameter in addition to any other parameters already present. - Must return [`Slack.OptionDataResponse`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_options.md). Construct `Slack.OptionDataResponse` with `List` or `List`. All items in the same `Slack.OptionDataResponse` must be of the same type. **important:** Constructing a `Slack.OptionDataResponse` with a combination of `Slack.Option` and `Slack.OptionGroup` isn’t supported. The optional `value` parameter provides the input string entered into the select component that's used to perform the lookup. The `value` you provide preselects an option from the `options` identifier or from your data provider. ```yaml components: - definition: select properties: name: "StageName" value: "Prospecting" placeholder: "Select a stage." options: - identifier: "Prospecting" label: "Prospecting" - identifier: "Qualification" label: "Qualification" ``` [See more examples](#external-select). ## Examples These examples show you how to create a data provider with Apex data types. ### Primitive Input and Primitive Output Apex method: ```java public class EchoExample { public static String echo(String echoStr) { return echoStr; } } ``` View: ```yaml description: "This simple view contains an Apex echo data provider" schema: properties: title: type: string defaultValue: "Echo ApexDataProvider" myString: type: string default: "Hello, World!" dataproviders: echoStr: definition: "apex__EchoExample.echo" properties: echoStr: "{!view.properties.myString}" components: - definition: modal properties: title: "{!view.properties.title}" components: - definition: section properties: text: "{!echoStr}" # will render Hello, World! ``` ### Standard Object Input and List Output Apex method: ```java public class ObjectInputListOutputExample { public static List getAccountContacts(Account acct) { List contacts = [ SELECT Id, Name, Title, Phone, Email FROM Contact WHERE AccountId = :acct.Id WITH SECURITY_ENFORCED LIMIT 10 ]; return contacts; } } ``` View: ```yaml description: "This list view contains an Apex Contact list data provider for an Account" schema: properties: title: type: string defaultValue: "Account Contacts ApexDataProvider" accountId: type: string defaultValue: "001xx000003GYQRAA4" dataproviders: contacts: definition: "apex__ObjectInputListOutputExample.getAccountContacts" properties: acct: Id: "{!view.properties.accountId}" components: - definition: modal properties: title: "{!view.properties.title}" components: - definition: header properties: text: "My Contacts" - definition: iteration properties: foreach: "{!contacts}" foritem: "contact" components: - definition: divider - definition: section properties: text: "{!contact.Name}" - definition: section properties: text: text: "*Id:* {!contact.Id}" type: mrkdwn - definition: section properties: text: text: "*Title:* {!contact.Title}" type: mrkdwn - definition: section properties: text: text: "*Phone:* {!contact.Phone}" type: mrkdwn - definition: section properties: text: text: "*Email:* {!contact.Email}" type: mrkdwn ``` ### Apex Class Output Apex method: ```java public class ClassOutputExample { public static TestClass getApexClass() { return new TestClass(); } } // User-defined Apex class public class TestClass { public final String myString = 'Hello from TestClass class!'; } ``` View: ```yaml description: "This simple view contains an Apex user type data provider" schema: properties: title: type: string defaultValue: "UserType ApexDataProvider" dataproviders: apexClass: definition: "apex__ClassOutputExample.getApexClass" components: - definition: modal properties: title: "{!view.properties.title}" components: - definition: section properties: text: "{!apexClass.myString}" ``` ### Custom Object Output Apex method: ```java public class CutomObjectOutputExample { public static MyCustomObject__c getCustomObject(Id objectId) { MyCustomObject__c customObject = [ SELECT Id, Name, CustomTextField__c, CustomDateField__c, CustomNumberField__c FROM MyCustomObject__c WHERE Id = :objectId WITH SECURITY_ENFORCED ]; return customObject; } } ``` View: ```yaml description: "This simple view contains an Apex single custom object data provider" schema: properties: title: type: string defaultValue: "CustomObject ApexDataProvider" objectId: type: string defaultValue: "a00xx000000boMTAAY" dataproviders: customobject: definition: "apex__CutomObjectOutputExample.getCustomObject" properties: objectId: "{!view.properties.objectId}" components: - definition: modal properties: title: "{!view.properties.title}" components: - definition: header properties: text: "CustomObject: {!view.properties.objectId}" - definition: section properties: text: "{!customobject.Name}" - definition: section properties: text: text: "*Id:* {!customobject.Id}" type: mrkdwn - definition: section properties: text: text: "*Custom Text Field:* {!customobject.CustomTextField__c}" type: mrkdwn - definition: section properties: text: text: "*Custom Date Field:* {!customobject.CustomDateField__c}" type: mrkdwn - definition: section properties: text: text: "*Custom Number Field:* {!customobject.CustomNumberField__c}" type: mrkdwn ``` ### sObject List Output Apex method: ```java public class ListOutputExample { public static List getContactList() { List contacts = [ SELECT Id, Name, Title, Phone, Email FROM Contact WITH SECURITY_ENFORCED LIMIT 10 ]; return contacts; } } ``` View: ```yaml description: "This is a simple list view containing an Apex contact list data provider" schema: properties: title: type: string defaultValue: "Contacts ApexDataProvider" dataproviders: contacts: definition: "apex__ListOutputExample.getContactList" components: - definition: modal properties: title: "{!view.properties.title}" components: - definition: header properties: text: "My Contacts" - definition: iteration properties: foreach: "{!contacts}" foritem: "contact" components: - definition: divider - definition: section properties: text: "{!contact.Name}" - definition: section properties: text: text: "*Id:* {!contact.Id}" type: mrkdwn - definition: section properties: text: text: "*Title:* {!contact.Title}" type: mrkdwn - definition: section properties: text: text: "*Phone:* {!contact.Phone}" type: mrkdwn - definition: section properties: text: text: "*Email:* {!contact.Email}" type: mrkdwn ``` ### Primitive Input and Primitive List Output Apex method: ```java public class StringListExample { public static String[] echoMultiple(String string1, String string2, String string3) { List myList = new List(); myList.add(string1); myList.add(string2); myList.add(string3); return myList; } } ``` View: ```yaml description: "This is a simple list view containing an Apex echo list data provider" schema: properties: title: type: string defaultValue: "EchoMultiple ApexDataProvider" string1: type: string required: true string2: type: string required: true string3: type: string required: true dataproviders: echoStrings: definition: "apex__StringListExample.echoMultiple" properties: string1: "{!view.properties.string1}" string2: "{!view.properties.string2}" string3: "{!view.properties.string3}" components: - definition: modal properties: title: "{!view.properties.title}" components: - definition: iteration # iterate through list of strings properties: foreach: "{!echoStrings}" foritem: "echoStr" components: - definition: section properties: text: "{!echoStr}" ``` ### Map with Contact List Output Apex method: ```java public class MapContactListExample { publicstatic Map> getAccountContactMap() { List contacts = [ SELECT Id, Name, Title, Phone, Email, AccountId FROM Contact WITH SECURITY_ENFORCED LIMIT 10 ]; Map> contactMap = new Map>(); for (Contact contact : contacts) { Id acctId = contact.AccountId; if (!contactMap.containsKey(acctId)) { contactMap.put(acctId, new List()); } contactMap.get(acctId).add(contact); } return contactMap; } } ``` View: ```yaml description: "This is a simple list view containing an Apex account contact map data provider" schema: properties: title: type: string defaultValue: "Account Contacts ApexDataProvider" dataproviders: contacts: definition: "apex__MapContactListExample.getAccountContactMap" components: - definition: modal properties: title: "{!view.properties.title}" components: - definition: header properties: text: "My Contacts for 001xx000003GYQRAA4" - definition: iteration properties: foreach: "{!contacts.001xx000003GYQRAA4}" foritem: "contact" components: - definition: divider - definition: section properties: text: "{!contact.Name}" - definition: section properties: text: text: "*Id:* {!contact.Id}" type: mrkdwn - definition: section properties: text: text: "*Title:* {!contact.Title}" type: mrkdwn - definition: section properties: text: text: "*Phone:* {!contact.Phone}" type: mrkdwn - definition: section properties: text: text: "*Email:* {!contact.Email}" type: mrkdwn ``` **tip:** This example is from `view_contact.view` in the [sample app](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/setup-install-app.md). ### External Select Apex data provider using `List` and returning `Slack.OptionDataResponse`: ```java global class AccountDataProvider { global static Slack.OptionDataResponse getAccountsByName(String value) { String name = '%'+ value + '%'; List accounts = [ SELECT Id, Name FROM Account WHERE Name LIKE :name WITH SECURITY_ENFORCED LIMIT 10 ]; System.debug('retrieved accounts'); List accountOptions = new List(); for(Account account: accounts) { Slack.Option option = new Slack.Option(account.Name, account.Id); System.debug(option.getText()); accountOptions.add(option); } return new Slack.OptionDataResponse(accountOptions); } } ``` Apex data provider using `List` and returning `Slack.OptionDataResponse`: ```java global class ContactDataProvider { global static Slack.OptionDataResponse getContactGroupsByName(String value) { String name = '%'+ value + '%'; List contacts = [ SELECT Name, Id, AccountId, Account.name FROM Contact WHERE Name LIKE :name LIMIT 10 ]; Map> contactsByAccount = new Map>(); Map accountNames = new Map(); for(Contact contact: contacts) { List options = contactsByAccount.get(contact.AccountId); Slack.Option currentOption = new Slack.Option(contact.name, contact.id); if (options == null) { List newList = new List(); newList.add(currentOption); contactsByAccount.put(contact.AccountId, newList); accountNames.put(contact.AccountId, contact.Account.name); } else { options.add(currentOption); } } List contactOptionGroups = new List(); for(Id key : contactsByAccount.keySet()) { String accountName = accountNames.get(key); System.debug(key); Slack.OptionGroup optionGroup = new Slack.OptionGroup(accountName, contactsByAccount.get(key)); System.debug(optionGroup.getLabel()); contactOptionGroups.add(optionGroup); } return new Slack.OptionDataResponse(contactOptionGroups); } } ``` View: ```yaml description: "View with external select examples." components: - definition: modal properties: title: "External Select" components: - definition: section properties: text: "Select an Account" - definition: actions name: "external_select_accounts" components: - definition: externalSelect properties: placeholder: "Look up an account by name" name: "account_lookup" datasource: definition: "apex__AccountDataProvider.getAccountsByName" - definition: section properties: text: "Select a Contact" - definition: actions name: "external_select_contacts" components: - definition: externalSelect properties: placeholder: "Look up a Contact by name" name: "contact_lookup" datasource: definition: "apex__ContactDataProvider.getContactGroupsByName" ``` **tip:** This example is from `create_opportunity.view` in the [sample app](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/setup-install-app.md). # Input Validation Slack [modals](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/surface.md#modal) provide input validation for elements that are contained in [input components](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/layout.md#input). Error messages are displayed when the modal is submitted. While Slack provides some client-side validation in Slack apps, we recommend that you run input validation based on your app's business logic. For example, Slack displays an error message on an empty required field when you try to submit a form. ![Required field displays an error](https://developer.salesforce.com/media/validation_required.png) Apex SDK for Slack's field-level validation enables you to handle additional checks on your user input, displaying any errors on form submission. ## Field-Level Validation Specify the data type for an input component that's used to automatically validate the format of the element value entered by the user. If validation fails, an error message is displayed. To validate the input value, use the `type` property of the containing `input` component. ```yaml description: "Validation Test" components: - definition: modal properties: title: "Create Order" components: - definition: header properties: text: "Quantity" - definition: input name: "number_input" # The optional name for the input type properties: label: "Number" type: "number" # The type used for validation required: true components: - definition: textInput properties: name: "number" placeholder: "Enter a number" ``` If the `textInput` does not contain a valid number, user submission is aborted and an error message appears below the input element. ![Number field displays an error](https://developer.salesforce.com/media/validation_type.png) Apex SDK for Slack offers a set of types that describe the expected format of an input value based on the user locale in the Salesforce org. - currency - email - number - url ### Currency The currency locale in the Salesforce org determines if a currency input is valid. Currencies are valid with or without a currency symbol or ISO currency code. The numeric value supports grouping separators and decimal symbols depending on the locale. For example, `$1,025.7` is valid when the currency locale is English (US) and `£1,025.7` is valid when the currency locale is English (UK). To see your org's currency locale, from Setup, click **Company Information**. On the **Company Information** page, find the **Currency Locale** field. The currency local is global and impacts all users on the org. ### Email A valid email follows the pattern `username@domain.com` or `user.name@domain.com`. Here are a few examples. - Valid: `example@domain.com` or `example+group@domain.com` - Invalid: `example@domain` or `example name@domain.com` ### Number The user locale determines if a number input is valid. For example, `12,345` is valid when the locale is English. But `1.025,7` is valid only if the locale is German or Dutch. Here are a few examples based on the English locale. - Valid: `1.00`, `1,000`, or `1,000.00` - Invalid: `1.2.3` ### URL A valid URL includes a protocol followed by the domain name and optional parameters. Unicode domains are not supported. Supported protocols include `http://`, `https://`, `ftp://`, `ftps://`, and many others like `mailto:` and `news:`. Anchor links are supported. Here are a few examples. - Valid: `http://www.salesforce.com` or `https://example.com?testKey=testValue` - Invalid: `salesforce.com` or `www.salesforce.com` ## Validation Considerations Using Apex code to validate user input is not yet supported. Validation using Apex code is subject to Slack's three seconds acknowledgment response. Otherwise, the user receives a connection error in the modal. Dependent field validation is not currently supported if it involves a call to Salesforce. These field types are not yet supported. - Multicurrency - Geolocation - Phone number - Text # Integration Users An integration user performs system events coming from Slack in Salesforce, such as when a channel is created or deleted. All [Slack events](https://api.slack.com/events), except `app_home_opened`, are system events. ## Specify an Integration User To specify an integration user, you must be assigned the Customize Application and Modify All Data user permissions. When you install and connect a Slack app to a Salesforce org, an integration user entry for the Slack app is added to the **Integration User Setup** page in Salesforce setup, but an integration user is not selected for you. Specifying an integration user enables system events to be performed with the permission of the user. Additionally, it enables you to set up a trace to run debug logs for the integration user. To specify your integration user: 1. From Setup, enter _Slack_ in the Quick Find box, and then select **System Users Setup**. 2. Select your integration users via the dropdown menu next to your Slack app name. **note:** If you're distributing an Apex SDK for Slack app, we recommend including a permission set for the integration user in the managed package. See [User Permissions and Roles](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/orgs-users.md). The admin must create and assign the integration user for the app. # Interactive Components Your app binds service logic to components that are rendered in Slack. When users interact with these components, such as when they click a button, select a value in a picker, or submit a view, your app can run custom logic in response. In your component's [ViewDefinition](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/api_meta/meta_viewdefinition.md) configuration file, associate an action with an event. An action is like an event handler, the code runs when a component event fires. ```yaml components: - definition: button events: onclick: definition: "apex__action__someAction" ``` To create an action associated with `block_actions`, `view_submission`, and `view_closed` requests, create a class that extends [`Slack.ActionDispatcher`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_dispatchers.md#actiondispatcher-class). ## Handle Interaction Payloads When you implement modals, there are several different user interactions that can happen. For example, when a user interacts with an [element](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/elements.md) in your app's modal views, the app receives a `block_actions` payload. For more information, see [Handling interactions in modals](https://api.slack.com/surfaces/modals/using#interactions). ### `block_actions` Payload The `block_actions` payload is returned when a user interacts with an [element](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/elements.md) in your app's modal views. See [Handling block_actions payloads](https://api.slack.com/surfaces/modals/using#components). Actions handlers receive these properties from `RequestContext` when the payload is `block_actions`: - `appId`—The application's unique ID. - `channelId`—The channel where the source message was located. - `enterpriseId`—The organization ID for Enterprise Grid. `null` values are accepted. - `userId`—The Slack user's `user_id` associated with this request. - `teamId`—The Slack workspace ID. - `triggerId`—A temporary ID generated for the interaction in your app. This value can be used to open [modals](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/surface.md#modal). - `View`—The view context for the action or null if the action didn’t originate from a view. - `id`—The ID of the view. - `hash`—A unique value that's optionally accepted in `views.update` and `views.publish` API calls. When provided to those APIs, the hash is validated such that only the most recent view can be updated. This validation ensures the correct view is being updated when updates are happening asynchronously. - `Message`—The message that the user initiated the shortcut from. - `text`—The text of the message. - `ts`—The timestamp of the message. - `userId`—The ID of the user who initiated the action. - `ActionPayload`—Contains the name and values associated with the block element that triggered the action. - `name`—The name of the block element. - `type`—The type of block element. - `value`—The value of the block element. - `formData`—The input fields defined in the view. ### `view_closed` Payload Your app can optionally receive `view_closed` payloads whenever a user clicks the Cancel or x buttons. These buttons are standard in all app modals. See [Handling view_closed payloads](https://api.slack.com/surfaces/modals/using#modal_cancellations). Actions handlers receive these properties from [`RequestContext`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_requestcontext.md) when the payload is `view_closed`: - `appId`—The application's unique ID. - `enterpriseId`—The organization ID for Enterprise Grid. null values are accepted. - `userId`—The Slack user's user_id associated with this request. - `teamId`—The Slack workspace ID. - `triggerId`—A temporary ID generated for the interaction in your app. This value can be used to open [modals](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/surface.md#modal). - `View`—The view context for the action or null if the action didn’t originate from a view. - `id`—The ID of the view. - `hash`—A unique value that's optionally accepted in views.update and views.publish API calls. When provided to those APIs, the hash is validated such that only the most recent view can be updated. This validation ensures the correct view is being updated when updates are happening asynchronously. ### `view_submission` Payload When a modal view is submitted, your app receives a `view_submission` payload. See [Handling view_submission payloads](https://api.slack.com/surfaces/modals/using#handling_submissions). Actions handlers receive these properties from `RequestContext` when the payload is `view_submission`: - `appId`—The application's unique ID. - `enterpriseId`—The organization ID for Enterprise Grid. null values are accepted. - `userId`—The Slack user's user_id associated with this request. - `teamId`—The Slack workspace ID. - `triggerId`—A temporary ID generated for the interaction in your app. This value can be used to open [modals](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/surface.md#modal). - `View`—The view context for the action or null if the action didn’t originate from a view. - `id`—The ID of the view. - `hash`—A unique value that's optionally accepted in `views.update` and `views.publish` API calls. When provided to those APIs, the hash is validated such that only the most recent view can be updated. This validation ensures the correct view is being updated when updates are happening asynchronously. - `formData`—The input fields defined in the view. ## Assign Actions to Events To associate an action with a component event, reference the action from a [`ViewDefinition`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/api_meta/meta_viewdefinition.md) configuration file using this syntax. ```java apex__action__YourClassName ``` **tip:** Component events are not the same as [app-level events](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/events.md). The action name for the component event and the `properties` definition, such as the `objectApiName` value, are encoded and sent back as the `action_id` through Slack. The action name and properties you add for the `action_id` are subject to Slack's 255 character limit. See [Action Signing](#action-signing). ### Handle a Button Click To trigger an action on a button click, specify the action in the view definition. ```yaml components: - definition: button properties: label: "Account" style: "primary" name: "create_account" events: onclick: # definition maps to 'createRecord' apex class implementing Slack.ActionDispatcher definition: "apex__action__createRecord" properties: objectApiName: "Account" ``` In this example, an action runs when the `onclick` event fires. The `definition` runs the `createRecord` Apex class. The `createRecord` Apex class extends `Slack.ActionDispatcher` and responds to the button click event in the previous example. ```java public class createRecord extends Slack.ActionDispatcher { public override Slack.ActionHandler invoke(Map parameters, Slack.RequestContext context) { // the slack action handler should immediately be returned if (parameters.containsKey('pushModal') && (Boolean) parameters.get('pushModal')) { return Slack.ActionHandler.pushModal(new Handler(parameters, context)); } return Slack.ActionHandler.updateModal(new Handler(parameters, context)); } public class Handler implements Slack.ModalHandler { Map parameters; Slack.RequestContext context; public Handler (Map parameters, Slack.RequestContext context) { this.parameters = parameters; this.context = context; } public Slack.ModalView call () { // return the modal view that corresponds to the requested object String objectApiName = (String) parameters.get('objectApiName'); Slack.ViewReference viewReference; if ('Account'.equals(objectApiName)) { viewReference = Slack.View.create_account.get(); } else if ('Contact'.equals(objectApiName)) { viewReference = Slack.View.create_contact.get(); } else if ('Opportunity'.equals(objectApiName)) { viewReference = Slack.View.create_opportunity.get(); } else { viewReference = Slack.View.message_modal.get(); viewReference.setParameter('title', 'Invalid Object'); viewReference.setParameter('message', 'The object api name was not a valid option.'); } Slack.ModalView modalView = new Slack.ModalView.builder() .viewReference(viewReference) .build(); return modalView; } } } ``` To work with other dispatchers to handle an event, shortcut, or slash command, see [Create an Apex Handler](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/actions_handlers_apex.md). ## Action Signing Apex SDK for Slack translates your view definitions into Slack user interfaces using Block Kit. As part of the translation, your actions are returned to Slack as part of [Slack's `action_id` field](https://api.slack.com/reference/block-kit/block-elements). ```json { "type": "button", "action_id": "s://action_name//action_definition?prop1=your_prop_value&prop2=your_prop2_value" //other view definition keys } ``` Action signing prevents malicious alterations to the actions when the users are viewing and interacting with them. To support action signing, 20 characters of the component's `action_id` value is reserved for a unique string. Slack has a [255 character limit for `action_id` fields](https://api.slack.com/reference/block-kit/block-elements). For interactive elements within messages, we recommend that you don't exceed 225 characters for the action name and its properties to allow for delimiters and URL encoding. Modals and homepage views can accommodate for more action properties; however, there’s a limit of approximately 2500 characters. To ensure that you are within the 255 character limit, shorten the action identifier or the name of the action properties. Otherwise, the message doesn't render correctly in Slack. **important:** Action signing is a security enhancement introduced in March 2022. Starting April 9, 2022, actions in messages that were posted before March 9, 2022 display an error icon and no longer work. ## See Also - [Create Apex Handlers for Slack Apps](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_dispatchers.md) - [Sample Apex SDK for Slack App](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/setup-install-app.md) # Layout Components Groups element components together, such as a header or section. Use layout components to position content in a surface. Most layout components can contain other components. The contained components must be [elements](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/elements.md). **note:** Layout components must be rendered within a [surface](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/surface.md) or an [iteration](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/uisf.md#iteration). Layout components have a `visibility` property, which defaults to `true`. Use these layout components to build your views. ## Actions Available in: [Modal](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/surface.md#modal) | [Message](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/surface.md#message) | [Home tab](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/surface.md#home) Use an actions component to group interactive elements together. **Examples** This example shows an action block with a [`select` component](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/elements.md#select). ```yaml components: - definition: actions name: "action_block" components: - definition: select properties: name: "select_options" value: "option_1" placeholder: "Please select an option." options: - identifier: "option_1" label: "Option 1" description: "This is option 1" - identifier: "option_2" label: "Option 2" - definition: button properties: label: "Button" name: "my_button" ``` This example shows an action block with a [`checkboxGroup`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/elements.md#checkbox-group), [`radioGroup`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/elements.md#radio-group), and a [`button`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/elements.md#button) component. ```yaml description: "This view contains an actions block" components: - definition: modal properties: title: "Actions Block Example" components: - definition: actions name: "my_actions_block" components: - definition: checkboxGroup properties: name: "exampleCheckboxGroupName" options: - identifier: "option_1" label: "Option 1" value: true - identifier: "option_2" label: "Option 2" value: true - definition: radioGroup properties: name: "exampleRadioGroupName" options: - identifier: "option_1" label: "Option 1" description: "This is a radio button" - identifier: "option_2" label: "Option 2" - definition: button properties: label: "Action Button Example" name: "actionButton" value: "hello" events: onclick: definition: "apex__action__SelectOption" ``` This example creates an action block with `onchange` events. ```yaml description: "This is a simple view to test block actions via events" components: - definition: modal properties: title: "Events Example" components: - definition: actions name: "actions_block" components: - definition: select properties: placeholder: "Static Select" name: "exampleSelect" options: - identifier: "option_1" label: "Option 1" description: "This item is option 1" - identifier: "option_2" label: "Option 2" events: onchange: definition: "apex__action__SelectOption" properties: actionDescription: "select onchange" - definition: conversationsSelect properties: name: "exampleConversationsSelect" placeholder: "Conversations Select" events: onchange: definition: "apex__action__SelectConversation" properties: actionDescription: "conversationsSelect onchange" - definition: usersSelect properties: name: "exampleUsersSelect" placeholder: "Users Select" events: onchange: definition: "apex__action__SelectUsers" properties: actionDescription: "usersSelect onchange" ``` This example creates an action block with `onchange` and `onclick` events. ```yaml description: "This is a simple view to test block actions via events" components: - definition: modal properties: title: "Events Example" components: - definition: actions name: "checkbox_action_block" components: - definition: checkboxGroup properties: name: "exampleCheckboxGroupName" options: - identifier: "option_1" label: "Option 1" value: true - identifier: "option_2" label: "Option 2" value: true events: onchange: definition: "apex__action__SelectOptions" properties: actionDescription: "checkbox onchange" - definition: radioGroup properties: name: "exampleRadioGroupName" options: - identifier: "option_1" label: "Option 1" description: "This is a radio button" - identifier: "option_2" label: "Option 2" events: onchange: definition: "apex__action__SelectOptionChange" properties: actionDescription: "radioGroup onchange" - definition: button properties: label: "Action Button Example" value: "abc123" events: onclick: definition: "apex__action__ClickButton" properties: actionDescription: "button onclick" - definition: button properties: label: "Action Button With Name and Event" name: "button_with_events" value: "abc123" events: onclick: definition: "apex__action__ClickButton" properties: actionDescription: "button onclick" - definition: overflow properties: name: "exampleOverflow" options: - identifier: "overflow_1" label: "Overflow 1" - identifier: "overflow_2" label: "Overflow 2" events: onclick: definition: "apex__action__ClickOverflow" properties: actionDescription: "overflow onclick" ``` **Keys** | Key | Type | Required | Description | | ------------ | ------------------------------------------------ | -------- | --------------------------------------------------------------------------------------------------- | | `definition` | String | Yes | The value must be `actions`. | | `components` | Array | Yes | A maximum of 25 components to render inside the **actions** component. | | `name` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | The name to uniquely identify this component within the view. | | `visibility` | Boolean, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | Indicates whether the component is shown (`true`) or hidden (`false`). The default value is `true`. | ## Context Available in: [Modal](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/surface.md#modal) | [Message](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/surface.md#message) | [Home tab](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/surface.md#home) Displays message context, which can include images and text. ![Context Example](https://developer.salesforce.com/media/context.png) **Example** This example shows a context component with some text and an image. ```yaml description: "Example usage of the context component" components: - definition: modal properties: title: "Context Example" submitLabel: "Submit" closeLabel: "Cancel" components: - definition: context name: "context_block" components: - definition: text properties: text: text: "*This* is :smile: markdown" type: "mrkdwn" - definition: image properties: url: "https://image.freepik.com/free-photo/red-drawing-pin_1156-445.jpg" altText: "Book cover" - definition: text properties: text: "Author: KA Applegate" ``` **Keys** | Key | Type | Required | Description | | ------------ | ------------------------------------------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------- | | `definition` | String | Yes | The value must be `context`. | | `components` | Array | Yes | A maximum of 10 [text](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/elements.md#text) and [image](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/elements.md#inline-image) components to render inside the context component. | | `name` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | The name to uniquely identify this component within the view. | | `visibility` | Boolean, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | Indicates whether the component is shown (`true`) or hidden (`false`). The default value is `true`. | ## Divider Available in: [Modal](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/surface.md#modal) | [Message](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/surface.md#message) | [Home tab](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/surface.md#home) A content divider, like an `
`, to split up different components inside a message. **Examples** Here's a simple divider. ```yaml components: - definition: divider ``` This divider is added after the header in a message. ```yaml components: - definition: message components: - definition: header properties: text: "{!view.properties.headerText}" - definition: divider ``` **Keys** | Key | Type | Required | Description | | ------------ | ------------------------------------------------ | -------- | --------------------------------------------------------------------------------------------------- | | `definition` | string | Yes | The value must be `divider`. | | `name` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | The name to uniquely identify this component within the view. | | `visibility` | Boolean, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | Indicates whether the component is shown (`true`) or hidden (`false`). The default value is `true`. | ## Header Available in: [Modal](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/surface.md#modal) | [Message](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/surface.md#message) | [Home tab](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/surface.md#home) A header with large, bold text. ![Header Example](https://developer.salesforce.com/media/header_standard.png) **Example** ```yaml components: - definition: header name: "headerId" properties: text: "Header text value" ``` **Keys** | Key | Type | Required | Description | | ----------------- | ---------------------------------------------------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------- | | `definition` | String | Yes | The value must be `header`. | | `properties` | Object | Yes | The component's properties. | | `properties.text` | String, [Plain Text](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#plain-text), [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | Yes | The text for the header component. | | `name` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | The name to uniquely identify this component within the view. | | `visibility` | Boolean, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | Indicates whether the component is shown (`true`) or hidden (`false`). The default value is `true`. | ## Image Available in: [Modal](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/surface.md#modal) | [Message](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/surface.md#message) | [Home tab](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/surface.md#home) A simple image block, designed to make photos pop. ![Image layout component example](https://developer.salesforce.com/media/image_block.png) **tip:** For a component that holds an image and text or other content, see [inline image](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/elements.md#inline-image). Both image components use `- definition: image`. However, they're available in different containing components, and the layout image has a `title` property. **Examples** This example creates a standalone image. ```yaml components: - definition: image name: "standalone_image" properties: url: "https://via.placeholder.com/150" altText: "Placeholder image" title: "Placeholder image title" ``` This example creates several images in a section and context component. ```yaml description: "Example usage of the image component" components: - definition: modal properties: title: "Image Example" components: - definition: image name: "standaloneImage" properties: url: "http://placekitten.com/500/500" altText: "Cat photo" title: "Enjoy this cat photo" - definition: divider - definition: section properties: text: "An inline image in a section block." components: - definition: image properties: url: "http://placekitten.com/500/500" altText: "Cat photo" - definition: divider - definition: context name: "imageInContext" components: - definition: image properties: url: "http://placekitten.com/500/500" altText: "Cat photo" ``` **Keys** | Key | Type | Required | Description | | -------------------- | ---------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------- | | `definition` | String | Yes | The value must be `image`. | | `properties` | Object | Yes | The component's properties. | | `properties.url` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | Yes | The URL of the image to display. URLs must use a valid protocol scheme such as `http://` or `https://`. | | `properties.altText` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | Yes | A plain text description of the image. | | `properties.title` | String, [Plain Text](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#plain-text), [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | The title for the image. This value can be provided only for a standalone image. | | `name` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | The name to uniquely identify this component within the view. | | `visibility` | Boolean, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | Indicates whether the component is shown (`true`) or hidden (`false`). The default value is `true`. | ## Input Available in: [Modal](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/surface.md#modal) | [Message](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/surface.md#message) | [Home tab](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/surface.md#home) A layout component that can contain input elements in a `components` array. **Examples** This example creates an input block with a [text input](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/elements.md#text-input) component. ```yaml components: - definition: input name: "input_block" properties: required: true label: "Input Block" components: - definition: textInput properties: value: "default value" ``` This example creates an input block with a [checkbox](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/elements.md#checkbox) component. ```yaml components: - definition: input name: "checkbox" properties: label: "Checkbox" components: - definition: checkbox properties: name: "single_checkbox" value: true ``` This example creates input blocks with nested elements. ```yaml description: "Input Blocks with nested elements" components: - definition: modal properties: title: "Input Block Example" components: - definition: input name: "my_text_input_block" properties: required: true label: "My text input block" components: - definition: textInput properties: value: "hello world" name: "my_input_element" multiline: false placeholder: "Enter Text Here" minLength: 2 maxLength: 25 - definition: input name: "my_radio_group_input_block" properties: required: true label: "My radioGroup input block" components: - definition: radioGroup properties: name: "simple_radio_buttons" value: "option_1" options: - identifier: "option_1" label: "Option 1" description: "This item is option 1" - identifier: "option_2" label: "Option 2" confirm: title: "Confirm Selection" text: "Please confirm your selected option." confirm: "Confirm" deny: "Cancel" style: "primary" ``` **Keys** | Key | Type | Required | Description | | --------------------------- | ---------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `definition` | String | Yes | The value must be `input`. | | `properties` | Object | Yes | The component's properties. | | `properties.label` | String, [Plain Text](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#plain-text), [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | Yes | The input label | | `properties.hint` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | A hint that can be used to convey format or other input requirements for the input component rendered within the input. | | `properties.required` | Boolean, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | If `true`, the form can't be submitted when a field in the input component is empty. The default value is `false`. | | `properties.dispatchAction` | Boolean, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | If `true`, an element within the input dispatches to an action bound to it. The default value is `false`. | | `components` | Array | Yes | A single component to render inside the input. The component can be a [checkbox group](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/elements.md#checkbox-group), a [conversations-select](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/elements.md#conversations-select), [date picker](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/elements.md#date-picker), [radio group](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/elements.md#radio-group), [select](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/elements.md#select), [text input](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/elements.md#text-input), [time picker](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/elements.md#time-picker), or [users select](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/elements.md#users-select). | | `name` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | The name to uniquely identify this component within the view. | | `visibility` | Boolean, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | Indicates whether the component is shown (`true`) or hidden (`false`). The default value is `true`. | **warning:** When `properties.required` is `false`, Slack appends `(optional)` on the field label. `(optional)` isn't currently localized when your Slack locale and Salesforce locale are different. To ensure labels are localized correctly, update your [Slack locale](https://slack.com/help/articles/215058658-Manage-your-language-preferences) to match your [Salesforce locale](https://help.salesforce.com/s/articleView?id=xcloud.admin_language_locale_currency.htm&type=5). ## Section Available in: [Modal](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/surface.md#modal) | [Message](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/surface.md#message) | [Home tab](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/surface.md#home) Use a section to render [plain text](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#plain-text) or [mrkdwn](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#mrkdwn) and optionally a single component, like an image. **Examples** This example renders plain text. ```yaml components: - definition: section properties: text: "Hello, world!" ``` This example renders markdown. ```yaml components: - definition: section properties: text: text: "This text includes *bold* and _italic_." type: "mrkdwn" ``` Use markdown to render a field value based on a view property. ```yaml schema: properties: fieldName: type: string fieldValue: type: string components: - definition: modal properties: title: "My Field" components: - definition: section properties: text: text: "*{!view.properties.fieldName}:* {!view.properties.fieldValue}" type: "mrkdwn" ``` A section can contain up to 10 text fields. ```yaml components: - definition: section properties: fields: - text: "This the *first* field." type: "mrkdwn" - text: "This the *second* field." type: "mrkdwn" ``` You can include a single component in a section. ```yaml components: - definition: section name: "my_section_block" properties: text: "This is a text field" components: - definition: image properties: url: "https://via.placeholder.com/150" altText: "Placeholder image" ``` This example contains a few sections with text and text fields. ```yaml components: - definition: modal properties: title: "An Example Section" components: - definition: section name: "section_text" properties: text: "Section block with text only" - definition: section name: "section_markdown" properties: fields: - text: "Section block with a section input component" emoji: true - definition: section name: "simple_markdown_section_text_fields" properties: text: "text field" fields: - text: "Field 1 :smile:" emoji: true - text: "Field 2" - text: "Field 3" - text: "Field 4" - text: "Field 5" - text: "Field 6" - text: "Field 7" - text: "Field 8" - text: "Field 9" - text: "Field with link: https://www.salesforce.com/" type: "mrkdwn" verbatim: false components: - definition: select properties: name: "section_select" placeholder: "Section Select Input" options: - identifier: "option_1" label: "Option 1" description: "This is option 1" - identifier: "option_2" label: "Option 2" ``` **Keys** | Key | Type | Required | Description | | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `definition` | String | Yes | The value must be `section`. | | `properties` | Object | Yes | The component's properties. | | `properties.text` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md), [Plain Text](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#plain-text), [Mrkdwn](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#mrkdwn) | No | The text for the component. Required if the `fields` property is empty or absent. If the value is a string, the component renders plain text. To render mrkdwn, use the [mrkdwn object](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#mrkdwn). | | `properties.fields` | Array of items of type String, [Plain Text](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#plain-text), [Mrkdwn](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#mrkdwn), [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | An array of text fields to render within the component. Required if the `text` property is absent. The maximum number of text fields is 10. | | `components` | Array | No | A single component to render inside the input. | | `name` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | The name to uniquely identify this component within the view. | | `visibility` | Boolean, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | Indicates whether the component is shown (`true`) or hidden (`false`). The default value is `true`. | # Localization Salesforce uses custom labels to present text based on a user's language setting. The values on the custom labels can be accessed from your Apex classes and view definitions, enabling you to show localized text in your Slack app. ## Slack and Salesforce User Locales Your Slack app publishes text across channel messages, ephemeral messages, and modals. You can't localize text in actions like in slash commands or shortcuts, although you can localize the response to those actions. Ephemeral messages and modals target a Salesforce user and are personalized with that user's language settings. The Slack user's locale is employed if the user isn’t authenticated as a Salesforce user. Channel messages are shown in English. Starting in Summer '22, you can [enable localization on a channel](#enable-channel-localization). **note:** Using the Slack user locale to show a localized label in your Slack app isn't supported. Currently, your Slack locale must match the Salesforce locale for labels to be localized correctly. A user interacts with the app directly one-on-one via direct conversations on: - The app page - The app's Messages tab In this case, the Slack app posts messages with the Salesforce user's language. Otherwise, the Slack app responds in English. But direct messages between two users and the app also use each user's language instead of a common language. ## Update the User Language Salesforce supports various [end-user languages](https://help.salesforce.com/s/articleView?id=xcloud.faq_getstart_what_languages_does.htm&type=5). To update the user language, from your org's personal settings, go to the **Language & Time Zone** page. See [Edit Your Language and Locale Settings](https://help.salesforce.com/s/articleView?id=xcloud.usersetup_lang_time_zone.htm&type=5). ## Work with Custom Labels Use a custom label to present information in a user's native language. You can access the label from your Apex code or an expression in your view definition. To add a custom label in your org, from Setup, go to the **Custom Labels** page and add your labels. See [Custom Labels](https://help.salesforce.com/s/articleView?id=platform.cl_about.htm&type=5). ### Access the Label In Apex, use this syntax to access your label. ```java System.Label.LabelName ``` If you're using a namespace, use this syntax. ```java System.Label.Namespace.LabelName ``` For string substitution, use `FORMAT`. ```yaml { !FORMAT(label.LabelName , args) } ``` ### Use Custom Labels Localized labels are supported for managed and unmanaged packages. Use `{!label.labelName}` or `{!label.Namespace.labelName}` in [an expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/build/expressions.md) to reference your custom labels in a view definition. **important:** All expressions in view definitions are case-sensitive. For example, `{!label.labelName}` works but `{!Label.labelName}` doesn't. This example uses the `c` namespace and assumes that you created custom labels in your org with the corresponding label names. ```yaml description: "A context block with custom labels" components: - definition: context name: "context_block" components: - definition: image properties: url: "https://via.placeholder.com/150" altText: "{!label.c.AltTextLabel}" - definition: text properties: text: type: "mrkdwn" text: "{!label.c.MarkdownLabel}" - definition: context components: - definition: text properties: text: "{!label.c.TextLabel}" ``` Alternatively, use an Apex data provider or access your label from your Apex code. ```java // Apex data provider String myLabel = Label.LabelName; // Define the custom label Slack.ViewReference viewReference = Slack.View.myviewname.get(); // Get the view viewReference.setParameter('labelValue', myLabel); // Assign the label to the view property ``` In your view, define the property for your custom label. ```yaml schema: properties: labelValue: type: string defaultValue: "Display custom label here" ``` Define an expression that references the custom label. ```yaml - definition: section properties: text: "{!view.properties.labelValue}" ``` ### Format Dates and Time in Slack Slack formats date and time by using a built-in formatter. Your dates and time are dynamically localized to your time zone if you use [Slack's date format syntax](https://api.slack.com/reference/surfaces/formatting#date-formatting) ``. To generate Slack's date format syntax in your expressions, use the `FORMATSLACKDATE` key. ```java {!FORMATSLACKDATE(epochSeconds, string_including_dateFormat)} ``` This example formats a view property by using the `{date_short}` and `{time_secs}` tokens. ```java "{!FORMATSLACKDATE(view.properties.epochSeconds,'{date_short} {time_secs}')}" ``` Similarly, you can add the formatting tokens to a string. ```java "{!FORMATSLACKDATE(view.properties.recordCreateDate, 'Your record was created on {date_long} at {time_secs} in your timezone.')}" ``` **tip:** Slack supports various tokens to handle date and time formatting. For more information, see [Date formatting](https://api.slack.com/reference/surfaces/formatting#date-formatting). In your view definition, use the [`mrkdwn` component](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/components/composition.md#mrkdwn) to support date and time formatting. ```yaml components: - definition: section properties: text: text: "{!FORMATSLACKDATE(view.properties.epochSeconds,label.help.dateTimeToken)}\n Here are the available commands for this app" type: "mrkdwn" disableEncoding: true ``` Dates render in the time zone of the device running the Slack client. We recommend that you use the time zone from your Salesforce org. If you change the time zone of the client device, all timestamps in past messages and in future messages render by using the new time zone. To rerender a current message in the Slack client, scroll away and back again to the message. ## Considerations and Limitations Labels that the Slack language provides always use your Slack language setting. These labels aren't localized if your Slack and Salesforce locales are different. For example, Slack provides these labels, which appear in the Slack language setting. - **(optional)** label on an optional input field - **Press 'enter' to submit** label for the hint text that appears below an input field - **Close** button label on a modal - **Only visible to you** label on an ephemeral message To ensure that your labels are localized correctly, change your Slack language to match the Salesforce language. ### Enable Channel Localization Slack apps translate messages based on a user's language. However, channel messages use English by default. To enable your channel messages to use the Slack channel's language, include these bot token scopes in your app at [api.slack.com](https://api.slack.com/apps) in the **OAuth & Permissions** page. - `users:read` - `channels:read` - `groups:read` - `im:read` - `mpim:read` If your app uses a user token, add the scopes under the user token scopes as well. Similarly, update your [app definition file](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/api_meta/meta_slackapp.md) (`YourSlackAppName.slackapp-meta.xml`) to include the tokens by using the `` or `` field. ## See Also - [Localizing Your Slack apps](https://api.slack.com/start/designing/localizing) - [Translate Custom Labels](https://help.salesforce.com/s/articleView?id=platform.cl_translate_edit.htm&type=5) # Metadata API for the Apex SDK You can manage Slack apps and view definitions with the Metadata API. For more information about Metadata API, see the [Metadata API Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/). # Moving Orgs & Sandbox Refreshes for Slack Apps ## Move a Slack App Connection from One Org to Another To disconnect a Slack app from one org and reconnect it to another org, use the following steps: **note:** Disconnecting a Slack App will delete all user mappings. 1. Uninstall the app from the workspace in Slack. 2. Wait approximately 15 minutes for the connections to be reset. If it is a custom app, make sure you subscribe to the app_uninstalled event. 3. Reinstall the app into the workspace and connect the app to the new org. ## Refresh a Production Sandbox with a Slack App When you refresh your full copy sandbox from production, you’ll notice user mappings from production are preserved. The mappings will not interfere with connecting the same Slack app from a test Slack workspace environment. In order to give you the smoothest experience, follow these steps: 1. Uninstall the Slack app from the test workspace to clean up Slack traffic to the newly refreshed org. **note:** Don’t uninstall production because it will delete your user mappings. 1. Refresh your sandbox. 2. Once the refresh is complete, reinstall and reconnect the Slack app to your new sandbox org. ## Troubleshooting If the any of these problems exist: - Your sandbox was refreshed before uninstalling your Slack app. - The Slack app is behaving weirdly or not working at all. - The app appears installed and working but won’t respond to slash commands. Follow these steps: 1. Uninstall the app and wait 15 minutes. 2. Reinstall the app. 3. Connect to the new sandbox org. # Onboarding with App Home App Home is a private space in Slack that's shared by an app and a user. It's useful for onboarding users, such as showcasing the app's key features and including information and links to popular items. Get users acquainted with your app with these onboarding block ideas. Use the Home tab to describe what the app helps users achieve. Also, use action verbs in button labels, like "Share Record" or "Post to Channel". App Home contains 3 tabs: - Home - Messages - About The Home and About tabs are required in Salesforce apps. ## Introduction Introduce your app with a value proposition. Include 1-2 call to actions to highlight key documentation or tutorials. ![Introduction](https://developer.salesforce.com/media/view_home_intro.png) Here's the view definition. ```yaml # apphome.view description: "Home page" schema: properties: bodyText: type: string required: true headerText: type: string defaultValue: "Welcome Home" components: - definition: home properties: title: "Sample Home" components: - definition: header properties: text: "{!view.properties.headerText}" - definition: section properties: text: "{!view.properties.bodyText}" - definition: actions components: - definition: button properties: name: "my_button" label: "Take a Tour" value: "take_tour" events: onclick: definition: "apex__action__TakeTour" ``` When a user opens App Home, the `app_home_opened` event is triggered. To onboard users on how to use your app, handle the `app_home_opened` event. This Apex class responds to the `app_home_opened` event by publishing `apphome.view`. ```java /* Publish apphome.view using Slack.EventDispatcher */ public class AppHomeOpened extends Slack.EventDispatcher { public override Slack.ActionHandler invoke(Slack.EventParameters parameters, Slack.RequestContext context) { return Slack.ActionHandler.ack(new Handler(parameters, context)); } public class Handler implements Slack.RunnableHandler { Slack.EventParameters parameters; Slack.RequestContext context; public Handler (Slack.EventParameters parameters, Slack.RequestContext context){ this.parameters = parameters; this.context = context; } public void run () { // Gets the IntroSlackApp.slackapp app definition Slack.App app = Slack.App.IntroSlackApp.get(); Slack.BotClient botClient = app.getBotClientForTeam(context.getTeamId()); // Gets the userId String event = String.valueOf(parameters.getEvent()); String userId = event.substringBetween('user=', ','); // Gets the apphome view and publish it Slack.ViewReference viewReference = Slack.View.apphome.get(); viewReference.setParameter('headerText', 'Introduction'); viewReference.setParameter('bodyText', 'Introduce your app with a value proposition. Display 1-2 maximum call to actions that demonstrate key documentation and tutorials. Hands-on walkthroughs and tutorials to get folks using your app right away are preferred.'); Slack.HomeView homeView = new Slack.HomeView.builder() .viewReference(viewReference) .build(); Slack.ViewsPublishRequest req = new Slack.ViewsPublishRequest.builder() .userId(userId) .view(homeView) .build(); Slack.ViewsPublishResponse response = botClient.ViewsPublish(req); if(response.getError() != null) { System.debug(response.getError()); } } } } ``` ## Main Actions List 1-3 common actions for users to perform. ![Main Actions](https://developer.salesforce.com/media/view_home_modal.png) Here's the view definition. ```yaml description: "Common Actions Example" components: - definition: modal properties: title: "Getting Started" components: - definition: header name: "basics" properties: text: "Basics" - definition: section properties: text: "Describe what this slash command does" - definition: section properties: text: type: "mrkdwn" text: "`/slashcommand1`" - definition: header name: "shortcuts" properties: text: "Shortcuts" - definition: actions name: "run_shortcut" components: - definition: button properties: label: "Run Shortcut" style: "primary" name: "run_shortcut_button" events: onclick: definition: "apex__action__DoSomething" ``` ## Help and Feedback Display help, documentation, videos, or tutorials for deeper features that might navigate a user outside of Slack. Provide a feedback link to enable customers to easily send their feedback about the app. ![Help & Feedback](https://developer.salesforce.com/media/view_home_help.png) Here's the view definition. ```yaml description: "Help & Feedback Example for App Home" components: - definition: home properties: title: "Sample Home" components: - definition: header properties: text: "Help & Feedback" - definition: section properties: text: type: "mrkdwn" text: "• \n • " disableEncoding: true ``` See the [markdwn](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/composition.md#mrkdwn) text type. ## Dashboard and Settings Additionally, you can list an overview for common tasks to be done within your app. Define a default view that leans towards showing active or relevant items. List all personal settings for your app including connecting to Salesforce, managing notifications, and other preferences. ![Dashboard and Settings](https://developer.salesforce.com/media/view_home_dashboard.png) ## See Also - [Onboarding experiences](https://api.slack.com/start/designing/onboarding) - [Home is where the tabs are](https://api.slack.com/surfaces/tabs#designing) - [Formatting text for app surfaces](https://api.slack.com/reference/surfaces/formatting#line-breaks) # Org Connections A Slack app in a workspace is allowed to connect to one or more orgs for all Slack users in that workspace. When working with a Slack app, users are granted the power to connect, disconnect, or reconnect to different orgs. For example: - Your org or scratch org expires or is no longer valid. - You [removed the app](https://slack.com/help/articles/360003125231-Remove-apps-and-custom-integrations-from-your-workspace#remove-an-app-1), which uninstalls and disconnects the app from the org. Slack prompts you to log into a new org if your connected org has expired or is no longer valid. ## Connect to an Org When you run your Slack app for the first time a prompt is shown to connect to your Salesforce org. Whether it's through a slash command in a channel or accessing the Home page in the app, Slack prompts you to connect. ![Prompt to connect to an org](https://developer.salesforce.com/docs/media/pleaseConnectMsg.png) Follow the on-screen instructions to connect your Slack workspace to your Salesforce org. After connecting to your Salesforce org, another prompt grants your Slack app permission to access the workspace. If your app includes the `chat:write` scope, you must also select a channel to post to. Finally, you get a prompt to allow Slack to access your Salesforce account. Following this step, you can run your app in the channel you selected. **note:** If you have to connect an org you previously connected to, you must use the same Salesforce user that was used when you initially connected. ## Disconnecting an Org Disconnecting an org includes disassociating the app and workspace from the org, enabling you to target new orgs with a new user. To disconnect your Slack app from an org, make sure you configure your Slack app to subscribe to the corresponding bot events and then invoke the app uninstall. - Subscribe to the `app_uninstalled` and `tokens_revoked` bot events. Adding these events helps your app to know when your Slack app is uninstalled or when the API tokens for your app are revoked. See [Choosing event subscriptions](https://api.slack.com/apis/connections/events-api#the-events-api__subscribing-to-event-types__choosing-event-subscriptions). - Uninstall your app by following the steps at [Remove apps and custom integrations from your workspace](https://slack.com/help/articles/360003125231-Remove-apps-and-custom-integrations-from-your-workspace#remove-an-app-1). ## Connect to Multiple Orgs Connect up to five Salesforce orgs to a single Slack Workspace with the Salesforce for Slack Multi-Org management feature. The Salesforce for Slack app provides Salesforce Admins and standard users the ability to have access to multiple Salesforce orgs in Slack. Standard users can set their Preferred org connection. Users can connect or disconnect their individual user account from any org that they’re connected to. To initially connect a Salesforce org to Slack you must be a Salesforce Admin or have the **Manage Slack App Organization Connections for Slack Apps** permission. 1. Click **Connect New Org**. 2. Sign into the org that you would like to connect to Slack. 3. Click **Allow** to connect your org to Slack. 4. Agree to Slack accessing Salesforce data by clicking the checkbox and then Allow. 5. A confirmation message appears and you can close the browser window. ## View the List of Connected Orgs 1. Open Salesforce for Slack in your Slack workspace. 2. Select the Home tab in the app. 3. Click **Manage Orgs**. The management window appears with an updated list of current connections. ## Manage All Existing Connections The Multi-Org feature allows you to connect multiple Salesforce orgs to one Slack workspace. To access this feature use a button on the Salesforce for Slack Home tab or a slash command. To Manage an Existing Connection: 1. Open Salesforce for Slack in your Slack workspace. 2. Select the Home tab in the app. 3. Click **Manage Orgs**. The management window appears with an updated list of current connections. 4. Select your Salesforce org and click **Manage** to see additional details. As a Standard User you can: - Connect and disconnect your Salesforce user. - Set the selected connection as the preferred. - View the selected preferred Salesforce org. A Salesforce admin can also perform the following tasks: - Disconnect a connection. - Set a selected connection as the default connection. - View the selected default connection. ## Preferred vs. Default Orgs The Preferred and Default labels determine which Salesforce org handles any action based on the user preference. - Preferred: The Preferred org takes the highest precedence. The user sets their own Preferred org. When slash commands or shortcuts are run, the Preferred org is used. - Default: The Default org is set by the Salesforce Admin. If a Preferred org isn’t set, the Default org is used as an alternative. # Package a Slack App You can package a Slack app using first-generation managed packages (1GP) or second-generation packages (2GP). With 2GP, your version control system is the source of truth for the metadata in your package. Contrastingly for 1GP, the packaging org is the source of truth for the metadata in your package. See [Comparison of First- and Second-Generation Managed Packages](https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/sfdx_dev_dev2gp_comparison.htm). We recommend using 2GP to package and distribute Slack apps. The rest of the article discusses how you can use 2GP, which uses a scratch org during the package generation process. Enable Dev Hub in your org so you can create and manage scratch orgs and 2GPs. **important:** Packaging and distribution of Slack Apps is available only after the beta phase is complete. Users operating under the beta agreement can't package and distribute Slack apps using the Apex SDK. Users can package in beta after the Slack and Slack Apex Terms of Service are accepted. To generate a package, use these orgs. - A Dev Hub org with the Slack Packaging org permission enabled - A scratch org (associated with your Dev Hub org), which you use to create the actual package - A Developer Edition org with a namespace, which you link to the Dev Hub org The rest of this article discusses the steps in detail. ## Prerequisites The steps discussed in this article assume that you have [set up your development environment](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/setup-your-env.md). ## Create a Developer Edition Org Creating a Developer Editiong org enables you to reserve a namespace. 1. To set up your second-generation packaging, **create a Developer Edition org and a namespace**. If you don't already have a Developer Edition org, [sign up for a new org](https://developer.salesforce.com/signup). This org is separate from your Dev Hub org. 2. Using the Developer Edition org, [create your namespace](https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/sfdx_dev_dev2gp_create_namespace.htm). We recommend that you use a single namespace for your 2GP packages. **note:** You can't change a namespace or reuse it after you register it. If you're registering a namespace for testing purposes, choose a disposable namespace. Don't choose one that you want to use in the future for a real use case. ## Configure Your Dev Hub Org 1. Before you can package a Slack app, you must [create a dev hub org and enable the user permissions](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/setup-your-env.md). **note:** Contact Salesforce to enable the Slack Packaging org perm in your Dev Hub org. Users operating under the pilot agreement can't currently package a Slack app. 2. In Setup, ensure that Dev Hub and Second-Generation packages are enabled in your org. 3. [Enable Slack for Salesforce](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/enable-beta.md) by accepting the Beta Terms of Service. 4. [Link the namespace](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_reg_namespace.htm) that you created in your Developer Edition org in the previous step to your Dev Hub. **tip:** If you see an invalid client ID error when logging in to the Developer Edition org, wait 15–20 minutes for the new namespace to propagate. ## Create an SFDX Project 1. To create an SFDX project, run this command. ```bash sf project generate --name ``` 2. In a terminal, navigate into the project directory. ```bash cd ``` 3. Open the project in VS Code with `code .`. 4. Update `sfdx-project.json`. ```bash // Use the namespace from the Developer Edition org that you created "namespace": "", "sourceApiVersion": "54.0", // Use the my.salesforce format of the URL, not the lightning format. // For example, https://devhub-dev-ed.my.salesforce.com "sfdcLoginUrl": "https://" ``` 5. Add files to project for packaging. ## Create a Slack App Add Apex classes, view definitions, and a Slack app to your `force-app` folder in your project. See the [project structure](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/project-structure.md). Or copy the files from one of these resources. We recommend that you start from a few basic files and then add more after the package is successfully created. - [Sample Apex SDK for Slack App](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/setup-install-app.md) - [Deploy a Slack App](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/run-deploy.md) ## Create the Package First, run `sf org list` to find the Dev Hub alias you've already authorized SFDX to. You need the alias for this step. Note that the Dev Hub alias is different from your scratch org alias. Using a scratch org alias to create a package returns an error. In this case, the alias to note is `devhub`. ```bash sf org list Type Alias Username Org ID Status Expires ─ ─────── ────────────── ──────────────────────────── ────────────────── ───────────────────── ────────── DevHub devhub user@slack.na128.de 00D3y000001qyUAEAZ Connected 🍁 Scratch scratchorg test-1uro@example.com 00D0t000000M3d6EAX Active 2024-01-17 Legend: 🌳=Default DevHub, 🍁=Default Org Use --all to see expired and deleted scratch orgs ``` To create the package, run this command. ```bash sf package create --name --path force-app --package-type Managed --target-dev-hub ``` **note:** You can’t change the package namespace or package type after you create the package. - `package create` creates a package. See [Help for package create](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_package_commands_unified.htm#cli_reference_package_create_unified). - `--name` sets a name for your package. It must be unique within your namespace. - `--path` refers to the path to the directory that contains the contents of the package. - `--package-type` is the package type for the package. We use `Managed` to enable the package to be distributed on AppExchange. Alternatively, an `Unlocked` package is suitable for internal business apps. - `--target-dev-hub` sets a username or alias for the target Dev Hub org. It overrides the default Dev Hub org. ## Create the Package Version This step [generates a package version](https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/sfdx_dev_dev2gp_create_pkg_ver.htm), which is a fixed snapshot of the package contents and related metadata. The package version enables you to track your changes each time you release or deploy. To create the package version, run this command. ```bash sf package version create --package --installation-key-bypass --target-dev-hub --wait 10 --definition-file config/project-scratch-def.json --codecoverage ``` - `package version create` creates the package version based on the scratch definition file `config/project-scratch-def.json` - `--installation-key-bypass` bypasses the installation key requirement, enabling anyone to install your package. To enforce the installation key requirement, replace `--installation-key-bypass.` with `--installation-key yourkeyhere`. See installation key usage at [Help for package version create](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_package_commands_unified.htm#cli_reference_package_version_create_unified). - `--target-dev-hub` sets a username or alias for the target Dev Hub org. It overrides the default Dev Hub org. - `--wait` sets a wait time in minutes to run the command in non-asynchronous mode. If the package version is created within the time, the `sfdx-project.json` file is automatically updated with the package version information. If not, you must manually edit the project file. See [Generate a Package Version](https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/sfdx_dev_dev2gp_create_pkg_ver.htm). - `--codecoverage` promotes a package version to released. The package must meet the code coverage requirements. After the package is successfully created, you receive an install URL for the new package. **tip:** Creating a package version can be a long-running process, depending on the package size and other variables. View the status and monitor progress using this command: `sf package version create report --package-create-request-id 08cxx00000000YDAAY`. The package create request ID starts with `08c`. ## Install the Package Log in to the org where you want to install the package. You can install it in one of these orgs. - Your Dev Hub org - A new org - A scratch org (with a different SFDX project) ## Update Your Package To modify your package with new or updated files, create a package version. After making the changes you need in your project, rerun the step in [Create the Package Version](#create-the-package-version). ## See Also - [First-Generation Managed Packages](https://developer.salesforce.com/docs/atlas.en-us.pkg1_dev.meta/pkg1_dev/sfdx_dev_build_release.htm) - [Second-Generation Managed Packages](https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/sfdx_dev_dev2gp.htm) # Permission Scopes Permission scopes grant access for your app to perform functionalities in Slack. They define the API methods your app is allowed to call. Although Slack provides a comprehensive [list of permission scopes](https://api.slack.com/scopes), your app most likely only needs a handful of them. When creating your Slack app at [api.slack.com/apps/](https://api.slack.com/apps/), you can add or remove scopes in one of several ways. - In the app manifest on the **App Manifest** page - On the **OAuth & Permissions** page See [Sample Apex SDK for Slack App](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/setup-install-app.md) for an example manifest. ## Determine Your Scopes To determine which scopes your app needs, understand which [events](https://api.slack.com/events) or [methods](https://api.slack.com/methods) your app requires first. For example, if your app checks if a private or public channel exists, it requires the [`conversations.list` method](https://api.slack.com/methods/conversations.list) so you can get the names of private and public channels. You can then determine that your app needs the `channels:read` and `groups:read` scopes. Then, if your app also creates a channel, it requires the [`conversations.create` method](https://api.slack.com/methods/conversations.create), which works with the `channels:manage` scope. Next, work with the Slack Web API methods using the [Apex classes](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref.md). In this case, `conversations.list` corresponds to the [`ConversationsListRequest` and `ConversationsListResponse` Apex classes](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_conversations.md). ## Basic Scopes Here's a list of basic scopes common to Slack apps created with Apex SDK for Slack. | Scope | Token Type | Description | | -------------------------------------------------------------------------- | ---------- | --------------------------------------------------------------------------------------------------------------------- | | [channels\:read](https://api.slack.com/scopes/channels:read) | bot, user | View basic information about public channels in a workspace | | [channels\:history](https://api.slack.com/scopes/channels:history) | bot, user | View messages and other content in public channels that your slack app has been added to | | [chat\:write](https://api.slack.com/scopes/chat:write) | bot, user | Post messages in approved channels and conversations | | [chat\:write.customize](https://api.slack.com/scopes/chat:write.customize) | bot | Send messages as @your_slack_app with a customized username and avatar | | [commands](https://api.slack.com/scopes/commands) | bot, user | Add shortcuts and slash commands that your app users can run | | [groups\:history](https://api.slack.com/scopes/groups:history) | bot, user | View messages and other content in private channels that your slack app has been added to | | [groups\:read](https://api.slack.com/scopes/groups:read) | bot, user | View basic information about private channels that your slack app has been added to | | [im\:history](https://api.slack.com/scopes/im:history) | bot, user | View messages and other content in direct messages that your slack app has been added to | | [reactions\:read](https://api.slack.com/scopes/reactions:read) | bot, user | View emoji reactions and their associated content in channels and conversations that your slack app has been added to | For the complete list of scopes, see [Permission scopes](https://api.slack.com/scopes). ## Bot Token and User Token Scopes Some scopes are unique to a particular token type, for example, bot or user token. - Bot tokens are ideal for most apps. They provide granular permissions to request only the scopes your app needs. - User tokens allow you to work directly on behalf of users. The permission scope to perform a task can often apply to both the bot or user. When picking either a bot or user token for your app to perform tasks, consider your user's experience. It depends on what your bot is allowed to do based on its permissions and what your users are allowed to do in a workspace. **tip:** We recommend that you review the Slack API docs for supported permission scopes and any corresponding restrictions on them. For example, bots are only allowed to post in channels where they are members. Bots can't post to a DM conversation between two users using [`chat.postMessage`](https://api.slack.com/methods/chat.postMessage#channels), which is handled by the Apex [`ChatPostMessageRequest` and `ChatPostMessageResponse` classes](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_chat.md). ![Required scopes in Slack API docs](https://developer.salesforce.com/media/slack_api_docs.png) ### Bot Tokens Bot token strings begin with `xoxb-`. Bot tokens are not tied to a user's identity and will remain installed when an installing user is deactivated. One of the most common scopes your app can use with a bot token is [`chat:write`](https://api.slack.com/scopes/chat:write), which enables your app to post messages in approved channels and conversations. ![Post a message using the bot token](https://developer.salesforce.com/media/bot_token_post.png) Alternatively, set the `chat:write` and `chat:write.customize` scopes on the bot token while setting the `username` and `icon_url` properties. The `chat:write.customize` scope sends messages as `@your_slack_app` with a customized username and avatar. ![Post a message using the chat:write.customize scope on the bot token](https://developer.salesforce.com/media/bot_token_customize_post.png) **important:** Consider using `chat:write.customize` only in response to an inciting user action and inform users that a message will be posted on their behalf. See [Sending messages as other entities](https://api.slack.com/methods/chat.postMessage#authorship). Bot users and bot tokens can be used with a restricted set of Slack Web API methods. For example, [`bots.info`](https://api.slack.com/methods/bots.info) is handled by the Apex [`BotsInfoRequest` and `BotsInfoResponse` classes](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_bot.md). See [API methods available to bots](https://api.slack.com/bot-users#bot_methods). ### User Tokens User token strings begin with `xoxp-`. Use user tokens with care as they take actions on behalf of users. One of the most common scopes your app can use with a user token is [`chat:write`](https://api.slack.com/scopes/chat:write), which enables your app to post messages on the user's behalf. ![Post a message using the user token](https://developer.salesforce.com/media/user_token_post.png) **important:** Consider using `chat:write` scope on the user token only in response to an inciting user action and inform users that a message will be posted on their behalf. See [Sending messages as other entities](https://api.slack.com/methods/chat.postMessage#authorship). ### Considerations and Limitations Updating scopes in Slack or a Slack app can cause installation issues if the scopes become out of sync with the Slack app's core definition. We recommend updating your scopes as follows. 1. Update scopes in your `.slackapp-meta.xml` file. See [SlackApp](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/api_meta/meta_slackapp.md). 2. Deploy your scope update to your org. 3. Update the scopes from http://api.slack.com/ for your app in the Slack app manifest. To find the Slack App manifest: - View your Slack apps at [api.slack.com/apps](https://api.slack.com/apps). - Select the app you want to view from the list. - In the sidebar, select **Features > App Manifest**. **tip:** You must be a collaborator on the app in order to see the app in your list. If you don’t see the app, reach out to the app owner. 4. To update the Slack app in the Slack app directory, get the app re-approved. ## See Also - [Access Tokens](https://api.slack.com/authentication/token-types) - [Understanding OAuth scopes for Bots](https://api.slack.com/tutorials/understanding-oauth-scopes-bot) # Project Structure Before you create your Slack app bundle, make sure that you [set up your SFDX project](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/run-sfdx.md). Your SFDX project looks like this. ```txt project |_myslackapp |_config |_ project-scratch-def.json |_force-app/main/default/ |_ classes/ |_ createMyRecord.cls |_ createMyRecord.cls-meta.xml |_ permissionsets/ |_ SlackPerms.permissionset-meta.xml |_ slackapps/ |_ MySlackApp.slackapp |_ MySlackApp.slackapp-meta.xml |_ viewdefinitions/ |_ my_message.view |_ my_message.view-meta.xml |_package.json |_sfdx-project.json ``` A Slack app bundle in the `force-app/main/default/` directory includes: - [Apex classes containing command logic](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/actions.md) in `classes/` - Action handlers - Event handlers (for `onclick` and other events) - Shortcut handlers - Slash command handlers - [Data providers](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/data-providers.md) - [Permission set](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/orgs-users.md#create-permissions-for-a-slack-app) in `permissionsets/` - [SlackApp metadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/api_meta/meta_slackapp.md) in `slackapps/` - [ViewDefinition metadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/api_meta/meta_viewdefinition.md) in `viewdefinitions/` # Publish Your Slack App **important:** Packaging and distribution of Slack Apps is available only after the beta phase is complete. Users operating under the beta agreement can't package and distribute Slack apps using the Apex SDK. You can publish a Slack app internally or publicly. ## Internal Distributions If you're using your app with users within an org only, consider making your app manifest available internally. ## Public Distributions If you're making the app available to multiple orgs, we recommend enabling public distributions with or without the Slack App Directory. Public distribution is best suited if your Slack app is GA. [Distributing your app in the Slack App Directory](https://api.slack.com/start/distributing/directory) lets you boost your app visibility and usage. To go this route, you must submit your app for review to Slack and adhere to Slack's submission guidelines. Alternatively, you can [distribute your apps without using the Slack App Directory](https://api.slack.com/start/distributing/public). For this scenario, you don't need to submit your app for a review for other workspaces to install it, since you're not publishing to the App Directory. # Register and Dispatch an Action Slack provides a [web API](https://api.slack.com/methods) that allows applications to invoke RPC-style methods to read and write data in Slack. The `Slack` namespace provides access to these web APIs by obtaining a Slack client and enabling you to post messages or work with reactions etc. ## Register an Action To register an action with an app, use the [`SlackApp` metadata definition](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/api_meta/meta_slackapp.md). The `.slackapp` file must have at least two properties. - `description`—A brief description of the action. - `action`—The location of the action. - To register an action for commands and shortcuts, use the `commands`, `globalShortcuts`, and `messageShortcuts` properties. ```yaml description: End to End Apex Example App commands: /apex-create-record: action: definition: apex__action__CreateRecordCommandDispatcher title: Create Record Command description: Create a record using a slack command. globalShortcuts: apex-create-record-global: action: definition: apex__action__CreateRecordShortcutDispatcher title: Create Record Global Shortcut description: Create a record using a slack global shortcut. messageShortcuts: apex-create-record-message: action: definition: apex__action__CreateRecordShortcutDispatcher title: Create Record Message Shortcut description: Create a record using a slack message shortcut. ``` In the `ViewDefinition` metadata, use an action address to associate an event with an action. To build an action address, use the `apex__action__ClassName` or `apex__action__Namespace.ClassName` format. See [App Configuration Keys](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/app-definition.md#app-configuration-keys). ## Dispatch an Action The action system comprises two phases, insulating the app from dealing with the timeouts Slack imposes for HTTP responses. ### Phase 1: Dispatching In the dispatching phase, the action determines how it reacts to the request. The action must decide how to handle the request. It must choose which of these types of responses it wants to use based on the inputs to the action. - Ack: The action executes some arbitrary logic but doesn’t have to inform Slack of anything in particular about that logic. - Open a modal: The action opens a modal view. - Push a modal: The action pushes a modal view on to the existing modal view stack from which the request action originated. - Update a modal: The action updates the current modal view from which the request action originated. - Clear modal: The action closes the current modal view and clears the entire view stack. ### Phase 2: Handling In the handling phase, the action determines the details of how to react to the request. The action can run any logic it wants, send requests over the network, query or update a database, or run process-intensive operations. This phase can take as much time as necessary because it isn’t susceptible to the initial HTTP request timeout or a `trigger_id` timeout based on the dispatching phase's logic. **note:** Avoid expensive operations in the dispatching phase, such as database queries, calls to one of the provided Slack clients, or other network requests. Defer all such activity to the handling phase when possible. ## Get Access to a Slack Context and Slack Client An action can be bound directly in a Slack runtime context, such as: 1. An event handler in a declarative component. 2. A handler in Slack application metadata for commands, shortcuts, and events. ### Access Slack Context An instance of `RequestContext` is passed to the `invoke()` method, which describes the context in which a particular Slack action is invoked. The `invoke()` method is available via these dispatcher classes. - [Slack.ActionDispatcher](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_dispatchers.md#actiondispatcher-class) - [Slack.EventDispatcher](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_dispatchers.md#eventdispatcher-class) - [Slack.ShortcutDispatcher](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_dispatchers.md#shortcutdispatcher-class) - [Slack.SlashCommandDispatcher](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_dispatchers.md#slashcommanddispatcher-class) The context exposes information about the source of the action in Slack, performs custom logic, and obtains the correct Slack client to respond to Slack based on the request. For example, you can respond to a slash command in the Slack app by extending `Slack.SlashCommandDispatcher`. ```java public class ViewRecordCommandDispatcher extends Slack.SlashCommandDispatcher { public override Slack.ActionHandler invoke(Slack.SlashCommandParameters parameters, Slack.RequestContext context) { return Slack.ActionHandler.modal(new Handler(parameters, context)); } // Set up Handler and update modal // or do something else } ``` Each action type receives different information in its `RequestContext`. Here's a summary of the [`RequestContext` class](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_requestcontext.md). ```java global class RequestContext { String appId; String enterpriseId; String teamId; String channelId; String triggerId; String userId; Map formData; ActionPayload actionPayload; MessageContext messageContext; ViewContext viewContext; } ``` ### Access a Slack Client To respond to a request from Slack, obtain the appropriate client to interact with Slack's web API. Use the [`App` class](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_client_access.md) to obtain a Slack client. - `getAppClient()`—Gets a client to invoke Slack web API methods as the application in this context. - `getBotClientForTeam(String teamId)`—Gets a client to invoke Slack web API methods as the application's bot user in this context for the workspace. - `getUserClientForTeam(String teamId, String slackUserId)`—Gets a client to invoke Slack web API methods as the user in this context. ### Example This example calls the `getBotClientForTeam()` method and posts a message using `ChatPostMessageRequest`, which is an Apex wrapper for Slack's [`chat.postMessage` API method](https://api.slack.com/methods/chat.postMessage). It assumes that you created a `SlackApp` and `ViewDefinition` metadata definition and authorized the app. ```java public class ClientTest { public static void run() { // Replace with your own values String teamId = 'Txxxx'; String enterpriseId = 'xxxx'; String channelId = 'Dxxxx'; String userId = 'Uxxxx'; String adminUserId = 'Uxxxx'; String text = 'Hello from Apex!'; Slack.App app = Slack.App.ExampleIsvApp.get(); Slack.BotClient client = app.getBotClientForTeam(teamId); // Post a message Slack.ViewReference view = Slack.View.message_withblocks.get(); view.setParameter('text', 'Hello from apex'); Slack.ChatPostMessageRequest req = new Slack.ChatPostMessageRequest.builder() .channel(channelId) .viewReference(view) .build(); Slack.ChatPostMessageResponse response = client.chatPostMessage(req); System.debug('response: ' + response.isOk()); System.debug('error: ' + response.getError()); } } ``` ## See Also [Create an Apex Handler](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/actions_handlers_apex.md) # Register and Dispatch an Event Handler Slack provides the [Events API](https://api.slack.com/events) to simplify how your app responds to activities. Make sure that you enable event subscriptions on your Slack app, and then select the event types that you want to subscribe to. When creating your Slack app at [api.slack.com/apps/](https://api.slack.com/apps/), you can add or remove event subscriptions in one of several ways. - In the app manifest on the **App Manifest** page - On the **Event Subscriptions** page **tip:** Events aren’t the same as user-triggered actions. For user-triggered actions, see [Interactive Components](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/actions_handlers_write.md). To handle an event, register the event handler by defining it in your app metadata and create an Apex class that extends the `Slack.EventDispatcher`. You must also specify an [integration user](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/events_integration_users.md) to run your Slack events in Salesforce. ## Register an Event Handler Register the event handlers in your `.slackapp` file. For example, define `apex__action__AppHomeOpened` if you're handling the `app_home_opened` event in an Apex class named `AppHomeOpened`. ```yaml description: App Home Example App # Other command and shortcut definitions here # Define the action binding for the app_home_opened event events: app_home_opened: action: definition: apex__action__AppHomeOpened title: Example event handler for app_home_opened description: Event fires when a user opens the home tab. ``` For [synthetic events](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/events_mapping.md#synthetic-events), register them in the `.slackapp` file. However, you don't need to define synthetic events in the app manifest at [api.slack.com/apps/](https://api.slack.com/apps/). ## Register a Message Event Handler Message events are represented by the [Slack.MessageEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#messageevent-class) class. Use `Slack.MessageEvent` to handle Slack events of `message` type. The `message` event type includes: - `message.app_home` - `message.channels` - `message.groups` - `message.im` - `message.mpim` In your `.slackapp` file, use the `events.message` property to define your handler for any `message.*` events. ```yaml description: Handle Message.* Events name: MessageDemoApp events: message: action: definition: apex__action__messageEvent title: Event handler for various message.* events description: Use the events.message property to define your message.* event handler ``` Use the `channel_type` property to determine the `message.*` event you're handling. For example, the `message.im` type returns `channel_type` with the `im` value. ```json "event": { "type": "message", "channel": "C0000000005", "user": "U0000000001", "text": "This is a message from a DM", "ts": "1648762903933", "channel_type": "im" } ``` Additionally, `message` events can have a subtype. For example, the `channel_join` subtype is represented by the [Slack.MessageChannelJoinEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#messagechanneljoinevent-class) class. For more information, see [how the events map to Slack Apex classes](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/events_mapping.md). ```yaml { "type": "message", "subtype": "channel_join", "text": "Someone has joined the channel", "ts": "1403051575.000407", "user": "U023ABCDE", } ``` For a full list of message subtypes, see [Message subtypes](https://api.slack.com/events/message#subtypes) in the Slack API documentation. **tip:** Some events contain subclasses that are included in their payloads. For example, the [`channel_rename` event](https://api.slack.com/events/channel_rename) is represented by the [Slack.ChannelRenameEvent](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_events.md#channelrenameevent-class) class. It returns the `channel` property represented by the Slack.ChannelRenameEvent.Channel class. ## Dispatch an Event Handler To implement an event handler, extend the [`Slack.EventDispatcher`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_dispatchers.md#eventdispatcher-class) class. ```java public class EventDispatcherExample extends Slack.EventDispatcher { public override Slack.ActionHandler invoke(Slack.EventParameters parameters, Slack.RequestContext context) { return Slack.ActionHandler.ack(new Handler(parameters, context)); } public class Handler implements Slack.RunnableHandler { Slack.EventParameters parameters; Slack.RequestContext context; public Handler(Slack.EventParameters parameters, Slack.RequestContext context) { this.parameters = parameters; this.context = context; } public void run() { // Do something with the runnable handler // such as updating the app home view // or posting a message } } } ``` Event handlers receive these properties from [`Slack.RequestContext`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_requestcontext.md). - `appId`—The app's unique ID. - `channelId`-The channel ID. - `enterpriseId`—The organization ID for Enterprise Grid. null values are accepted. - `teamId`—The Slack workspace ID. - `userId`-The Slack user ID. For example, the app uses the user ID from the event payload and displays a view. You can publish your view using the [`Slack.ViewsPublishRequest`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_views.md#viewspublishrequest-class) and [`Slack.ViewsPublishResponse`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_views.md#viewspublishresponse-class) classes. For an example, see [Onboarding with App Home](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/views_onboarding.md). When the event is invoked, you receive the event parameters using the `Slack.Event` class. For example, you can handle the `group_rename` event using `Slack.GroupRenameEvent` and respond with a message using [`Slack.ChatPostMessageResponse`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_chat.md#chatpostmessageresponse-class) in the `run()` method of your event handler. ```java Slack.App app = Slack.App.ApexSlackApp.get(); Slack.BotClient botClient = app.getBotClientForTeam(context.getTeamId()); Slack.Event event = parameters.getEvent(); String channelId = ''; String channelName = ''; if (event instanceof Slack.GroupRenameEvent) { Slack.GroupRenameEvent groupRenameEvent = (Slack.GroupRenameEvent) event; channelId = groupRenameEvent.getChannel().getId(); channelName = groupRenameEvent.getChannel().getName(); } else if (event instanceof Slack.ChannelRenameEvent) { Slack.ChannelRenameEvent channelRenameEvent = (Slack.ChannelRenameEvent) event; channelId = channelRenameEvent.getChannel().getId(); channelName = channelRenameEvent.getChannel().getName(); } Slack.ChatPostMessageResponse response = botClient.chatPostMessage( Slack.ChatPostMessageRequest.builder().channel(channelId).text('The channel was renamed to ' + channelName).build() ); ``` Similarly, you can get the parameters using the corresponding Apex class for the Slack event. For example, use the `Slack.AppHomeOpenedEvent` class for the `app_home_opened` event. ```java Slack.AppHomeOpenedEvent appHomeOpened = (Slack.AppHomeOpenedEvent) parameters.getEvent(); String userId = appHomeOpened.getUser(); ``` **tip:** The Apex SDK sample app provides examples on event handling. See [Sample Apex SDK for Slack App](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/setup-install-app.md). ## Rate Limits Apex SDK for Slack is subject to [Slack's rate limits](https://api.slack.com/docs/rate-limits). Slack’s Event API invokes the [app_rate_limited event](https://api.slack.com/events/app_rate_limited) when a single app receives more than 30,000 events in a single hour from a single workspace. It's automatically sent when your app's event subscriptions are rate limited or disabled. Apex SDK for Slack apps automatically subscribes to app_rate_limited. But a default event handler is unavailable. To determine if your Slack client has reached a rate limit error, look for these fields in the response. - `ratelimited`: Most Apex classes that call Slack Client API methods include this field, which means that your request is rate limited and you must wait a certain period before retrying the request. - `rate_limited`: For Apex classes calling Slack Client API methods that involve posting to a channel, this field is included in the response if the app posted too many messages. Apps aren’t allowed to post more than one message per second per channel, although short bursts that exceed the limit are allowed. ## See Also - [Using the Slack Events API](https://api.slack.com/apis/connections/events-api) - [Welcome users to your App Home using events](https://api.slack.com/surfaces/tabs/events) - [Building a Home for your app](https://api.slack.com/tutorials/app-home-with-modal) # RunnableHandler Interface Implement this interface to handle an action. **Usage** Create an Apex class that implements this interface as a callback for your action or event dispatcher. ```java public class MySlashCommandDispatcher extends Slack.SlashCommandDispatcher { public override Slack.ActionHandler invoke(Slack.SlashCommandParameters parameters, Slack.RequestContext context) { return Slack.ActionHandler.ack(new Handler()); } public class Handler implements Slack.RunnableHandler { public void run () { System.debug('My Callback'); } } } ``` ## RunnableHandler Methods `RunnableHandler` has the following method. ### run() A callback method for the dispatcher handler, such as for a class that extends `Slack.SlashCommandDispatcher` or `Slack.ShortcutDispatcher`. **Signature** ```java public void run() ``` **Return Value** Type: void # Sample Apex SDK for Slack App The sample app includes a variety of view definitions and Apex handlers to demonstrate its core functionalities. ## Prerequisites Before you download the sample app, make sure you've set up the prerequisites. - [Set Up Your Development Environment](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/setup-your-env.md) - [Set Up Your SFDX Project](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/run-sfdx.md) ## Download the Sample App There are several versions of the sample app. - [apex-end-to-end-example-v5.zip](https://resources.docs.salesforce.com/rel1/doc/en-us/static/misc/apex-end-to-end-example-v5.zip): This file has new changes. - Added the `TestEventDispatcherEventExample` test example - Added the `ActionDispatcherViewSelectedRecord` class that handles the `onsubmit` event on the `view_oppportunities_by_account` view definition. - Fixed the `ApexSlackApp.slackapp` app definition for the `reaction_added` and `reaction_removed` events. - [apex-end-to-end-example-v4.zip](https://resources.docs.salesforce.com/rel1/doc/en-us/static/misc/apex-end-to-end-example-v4.zip): This file has new changes. - Replaced the field component with mrkdwn. - Added the `EventDispatcherEventExample` class to demonstrate event support. - Added the test suite `ApexEndToEndTestSuite`. - Added test classes `TestDataProviderAccountLookup`, `TestDataProviderOpportunityLookup`, and `TestDataProviderSObjectRecord`. - Deleted `TestOpportunityLookupDataProvider`. - Renamed `RecordDataProvider` to `EventDispatcherAppHomeOpened`. - Renamed the following test classes. - `TestAppHomeOpened` is now `TestEventDispatcherAppHomeOpened` - `TestCreateRecordDispatcher` is now `TestShortcutDispatcherCreateRecord` - `TestReactionsGetShortcutDispatcher` is now `TestShortcutDispatcherReactionsGet` - `TestViewOppByAccountCommandDispatcher` is now `TestCommandDispatcherViewOppByAccount` - `TestViewRecordCommandDispatcher` is now `TestCommandDispatcherViewRecord`. - Renamed the following action dispatchers. - `CreateRecordCommandDispatcher` is now `CommandDispatcherCreateRecord` - `CreateRecordShortcutDispatcher` is now `ShortcutDispatcherCreateRecord` - `ViewOppByAccountCommandDispatcher` is now `CommandDispatcherViewOppByAccount` - `ViewRecordCommandDispatcher` is now `ShortcutDispatcherReactionsGet`. - [apex-end-to-end-example-v3.zip](https://resources.docs.salesforce.com/rel1/doc/en-us/static/misc/apex-end-to-end-example-v3.zip): This file has new changes. - Added a test suite for the Apex handlers. - Added example classes `OpportunityLookupDataProvider` and `ViewOppByAccountCommandDispatcher` to demonstrate how to use the Select Component using `List` and `List`. - [apex-end-to-end-example-v2.zip](https://resources.docs.salesforce.com/rel1/doc/en-us/static/misc/apex-end-to-end-example-v2.zip): Added a [`ReactionsGetResponse`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_reactions.md#reactionsgetrequest-class) example - [apex-end-to-end-example.zip](https://resources.docs.salesforce.com/rel1/doc/en-us/static/misc/apex-end-to-end-example.zip) **tip:** After you download the sample app, unzip the file, and move the content of the `force-app` folder into your SFDX project. ## Create a Slack App After setting up your prerequisites, create a Slack app to work with your sample app. 1. Create an app on [api.slack.com](https://api.slack.com/apps) and use the following app manifest. ```yaml _metadata: major_version: 1 minor_version: 1 display_information: name: Apex Example App features: app_home: home_tab_enabled: true messages_tab_enabled: false messages_tab_read_only_enabled: false bot_user: display_name: apex-end-to-end-example-app always_online: true shortcuts: - name: apex create record type: message callback_id: apex-create-record-message description: apex create record global - name: apex create record type: global callback_id: apex-create-record-global description: Create a record with Apex - name: apex reactions get type: message callback_id: apex-reactions-get description: Retrieve reactions for a message with the ReactionsGet api slash_commands: - command: /apex-create-record url: https://slack-apps.salesforce.com:9443/a/ description: Create a record with Apex should_escape: false - command: /apex-view-record url: https://slack-apps.salesforce.com:9443/a/ description: View a record with Apex should_escape: false - command: /apex-find-opp-by-account-id url: https://slack-apps.salesforce.com:9443/a/ description: view opportunities by accountId should_escape: false oauth_config: redirect_urls: - https://auth.slack-apps.salesforce.com/slack_oauth_callback/ scopes: user: - channels:read bot: - chat:write - commands - channels:history - groups:history - im:history settings: event_subscriptions: bot_events: - app_home_opened - app_uninstalled - channel_rename - group_rename - reaction_added - reaction_removed - tokens_revoked request_url: https://slack-apps.salesforce.com:9443/a/ interactivity: is_enabled: true message_menu_options_url: https://slack-apps.salesforce.com:9443/a/ request_url: https://slack-apps.salesforce.com:9443/a/ org_deploy_enabled: false socket_mode_enabled: false token_rotation_enabled: false ``` **important:** The `app_uninstalled` and `tokens_revoked` events are required if you expect to disconnect your Slack app from an org and reconnect to a different org. See [Org Connections](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/orgs-multi.md). An app manifest enables you to create, configure, and copy your Slack apps easily. If you see an error while saving the manifest, check your indentation. For the manifest schema, see [Create and configure apps with manifests](https://api.slack.com/reference/manifests). 1. Install the app to your workspace. 2. Update the app manifest with your app ID. **note:** Alternatively, update your app ID via the **OAuth & Permissions** page. Under **Redirect URLs**, replace `` with the app ID on the **Basic Information** page. ## Configure the Sample App 1. From your local SFDX directory, open `slackapp/ApexSlackApp.slackapp-meta.xml`. - Replace the appKey, appToken, clientKey, clientSecret, and signingSecret with values from the app you created on [api.slack.com](https://api.slack.com/apps). The app Key (as App Id), client Key (as Client Id), client key, and client secret are available on the app's **Basic Information** page at [api.slack.com](https://api.slack.com/apps). - Generate the app token under **App-Level Tokens**. 2. Make sure the commands, shortcuts, and events defined in `ApexSlackApp.slackapp` match the values in your app manifest on [api.slack.com](https://api.slack.com/apps). - If you're installing your app to a shared workspace, prefix your commands with a unique identifier in both places. This identifier ensures your commands don't break if another user installs a second example app to the same workspace. **tip:** To use a different name for your app besides "ApexSlackApp," you can change the name of the `.slackapp` and `.slackapp-meta.xml` files, like `myApp.slackapp` and `myApp.slackapp-meta.xml`. Update any references to your app name in apex classes. For example in `EventDispatcherAppHomeOpened`, replace `Slack.App.ApexSlackApp.get()` with `Slack.App.myApp.get()`. Next, you can deploy your sample app to a scratch org using `sf project deploy start`. If you haven't set up a scratch org, see [Create a Scratch Org](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/run-sfdx.md#create-a-scratch-org). ## Explore the Sample App After you push your sample app to a scratch org, you can test the commands in your Slack workspace as discussed in this section. For example, when you run `/apex-create-record` the first time, you get a prompt to connect your Salesforce org. Click the link and log in with your scratch org's username and password. After you successfully connect your Salesforce org, run your command again. **tip:** To see your username, run `sf org list`. To generate a password, run `sf org generate password --target-org @example.com`. The sample app demonstrates the following areas. - Slash Commands - Global Shortcuts - Message Shortcuts - Events - Test Suite ### Slash Commands The `ApexSlackApp.slackapp` file configures these commands and the Apex actions they call. ```yaml commands: /apex-create-record: action: definition: apex__action__CommandDispatcherCreateRecord title: Create Record Command description: Create a record using a slack command. /apex-view-record: action: definition: apex__action__CommandDispatcherViewRecord title: View Record Command description: View record details by objectApiName and recordId. # More shortcut definitions here ``` `/apex-create-record` calls the `CommandDispatcherCreateRecord` Apex class to open a modal using the `create_record` view definition. `/apex-view-record` calls the `CommandDispatcherViewRecord` Apex class to open a modal to view record details for Accounts, Contacts, or Opportunities using the corresponding view definitions: `view_account`, `view_contact`, or `view_opportunity`. The `CommandDispatcherViewRecord` Apex class extends [`Slack.SlashCommandDispatcher`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_dispatchers.md#slashcommanddispatcher-class) to handle the slash command that's registered with the Slack app. For example, you can enter a command like `/apex-view-record Account 00Bxx0000029bnsEAA` and the Apex action returns a modal described by the `view_account` definition. ### Global Shortcuts The `ApexSlackApp.slackapp` file configures a global shortcut and its Apex action. ```yaml globalShortcuts: apex-create-record-global: action: definition: apex__action__ShortcutDispatcherCreateRecord title: Create Record Global Shortcut description: Create a record using a slack global shortcut. ``` The `apex-create-record-global` global shortcut calls the `ShortcutDispatcherCreateRecord` Apex class to open a modal using the `create_record` view definition. The `ShortcutDispatcherCreateRecord` Apex class extends [`Slack.ShortcutDispatcher`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_dispatchers.md#shortcutdispatcher-class) to handle the global and message shortcuts that are registered with the Slack app. To test out the global shortcut, press the shortcuts button in the message composer or from within search in your Slack workspace. For more information, see [Shortcuts](https://uisf-docs.herokuapp.com/salesforce-slack-sdk/guide/actions_interact.html). ### Message Shortcuts The `ApexSlackApp.slackapp` file configures a message shortcut to call an Apex action. ```yaml messageShortcuts: apex-create-record-message: action: definition: apex__action__ShortcutDispatcherCreateRecord title: Create Record Message Shortcut description: Create a record using a slack message shortcut. ``` The `apex-create-record-message` message shortcut calls the `ShortcutDispatcherCreateRecord` Apex class to open a modal using the `create_record` view definition. The `ShortcutDispatcherCreateRecord` Apex class extends [`Slack.ShortcutDispatcher`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_dispatchers.md#shortcutdispatcher-class) to handle the slash command registered with the Slack app. To test out the message shortcut, go to the overflow menu on a message. If the shortcut isn't available on the menu, click "More message shortcuts..." and find the shortcut by typing it in the search field in your Slack workspace. ### Events The `ApexSlackApp.slackapp` file configures the [`app_home_opened` event](https://api.slack.com/events/app_home_opened) to call an Apex action. ```yaml events: app_home_opened: action: definition: apex__action__EventDispatcherAppHomeOpened title: Example event handler for app_home_opened description: event fires when a user opens the home tab. # More event definitions here ``` When a user clicks into the App Home tab, the `EventDispatcherAppHomeOpened` Apex class returns the `app_home` view definition. The `EventDispatcherAppHomeOpened` Apex class extends [`Slack.EventDispatcher`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref/apex_ref_dispatchers.md#eventdispatcher-class) to handle the `app_home_opened` event. ### Run Test Suite The example app includes an implementation of the [test harness](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/test/test.md). The `ApexExampleEndToEndTestSuite` test suite in `force-app/main/default/testSuites` contains tests for commands, shortcuts, and event handlers in the example app that are currently supported by the test harness. To run the Apex test suite: ```bash sf apex run test --suite-names ApexExampleEndToEndTestSuite ``` To run the Apex test suite with coverage: ```bash sf apex run test --suite-names ApexExampleEndToEndTestSuite --code-coverage --result-format human ``` **tip:** See the [apex run test](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_apex_commands_unified.htm#cli_reference_apex_run_test_unified) command. Alternatively, run the test suite in the Developer Console after logging into the scratch org. # Set Up Your Development Environment Use Salesforce DX tools for an integrated development experience. Make sure that you have a Slack workspace that you can deploy apps to. To set up Salesforce DX tools: 1. [Set up VS Code.](https://code.visualstudio.com/) 2. [Install the Salesforce Extension Pack for VS Code.](https://marketplace.visualstudio.com/items?itemName=salesforce.salesforcedx-vscode) Salesforce Extension Pack provides features for working with the Salesforce CLI, Apex, and other Salesforce Platform features. 3. [Install Salesforce CLI.](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm) Next, get your Salesforce org ready for Slack development by following these steps. - [Set Up Your Development Environment](#set-up-your-development-environment) - [Set Up Your Dev Hub Org](#set-up-your-dev-hub-org) - [Enable User Permissions](#enable-user-permissions) - [Authenticate to Your Dev Hub Org](#authenticate-to-your-dev-hub-org) - [See Also](#see-also) ## Set Up Your Dev Hub Org A Dev Hub org enables you to create and manage scratch orgs. **important:** You must also [accept the Salesforce for Slack Beta Terms and Conditions](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/enable-beta.md) to use Apex SDK for Slack. To set up a Dev Hub org with My Domain enabled: 1. [Create a Developer Edition (DE) org](https://developer.salesforce.com/signup) if you don't already have one. 2. [Enable My Domain](https://help.salesforce.com/s/articleView?id=xcloud.domain_name_rename.htm&type=5). An email is sent to you when the domain is ready. Log in from your domain and deploy the domain to users. 3. [Enable Dev Hub in your org](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_setup_enable_devhub.htm) and select the **Enable Unlocked Packages and Second-Generation Managed Packages** option. **note:** If you're working with second-generation managed packaging (2GP), see [Distribute Slack Apps](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/packaging/packaging.md). ## Enable User Permissions To enable user permission for developing Slack apps: 1. From Setup, in the Quick Find box, enter **Permission**, and then select **Permission Sets**. 2. Select an existing permission set, or create one. 3. Under **System Permissions**, enable permission **Connect Salesforce with Slack**. If you're working with second-generation packages, enable permission **Create and Update Second-Generation Packages** as well. Save your changes. 4. Click **Manage Assignments** and assign the permission to your admin user. 5. Click **Done**. ## Authenticate to Your Dev Hub Org To authenticate to your org from the CLI: 1. Use a terminal to cd to a location. 2. Create an SFDX project by using this command. ```bash sf project generate --name ``` 3. Go to your project. ```bash cd ``` 4. Authenticate to your org. ```bash sf org login web --alias devhub --set-default-dev-hub --instance-url https://.my.salesforce.com ``` - `org login web` opens a browser and uses the URL specified by `--instance-url`. Use the `my.salesforce` version (Classic) of the URL, not a Lightning Experience one. - `--alias` sets an alias for your Dev Hub org username so that you can refer to it with a simpler name from other commands. - `--set-default-dev-hub` sets this org as the default Dev Hub org for your project so that you can omit the target Dev Hub org for commands that require it. 5. Log in with the username and password from the org you just made. Allow access to the org from the CLI. The command exits in your shell when the authentication is successful. **tip:** You can see your authenticated orgs by running `sf org list`. If you must authenticate to your dev hub org again, run `sf org login web --set-default-dev-hub`. Now that you authenticated to your Dev Hub org, you can [run your Slack app with Apex](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/run-sfdx.md). ## See Also - [Enable Dev Hub Features in Your Org](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_setup_enable_devhub.htm) - [External Client Apps and Connected Apps](https://help.salesforce.com/s/articleView?id=xcloud.external_integrations.htm&type=5) # Set Up Your SFDX Project After you [set up your development environment](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/setup-your-env.md), configure your project definitions and create a scratch org for your first Slack app. ## Configure Your Project Definitions To configure your SFDX project definition: 1. Open the project in VS Code. 2. Update `sfdx-project.json` with the login URL for your Dev Hub org. Use the `my.salesforce` version (Classic) of the URL, not a Lightning Experience one. For example, `https://my-dev-domain.my.salesforce.com`. ```bash "sfdcLoginUrl": "https://.my.salesforce.com", ``` 3. Set `sourceApiVersion` to 54.0 or later. ```bash "sourceApiVersion": "54.0", ``` ## Create a Scratch Org Scratch orgs simplify your Slack app development and drive developer productivity and collaboration. You can only have 3 active orgs at once. By default, you can create up to 6 scratch orgs a day. **note:** Scratch orgs are short-lived, development, and testing orgs that are similar to your production and sandbox orgs. To create a scratch org: 1. Sign up and configure the scratch org using the scratch org definition in `project-scratch-def.json`, and run this command. ```bash sf org create scratch --definition-file config/project-scratch-def.json --alias scratch1 --set-default --duration-days 30 ``` - `--alias` sets an alias for your scratch org username so that you can refer to it with a simpler name from other commands. - `--set-default` sets this org as the default scratch org for your project so that you don’t have to specify the target org with commands that require it. - `--duration-days` sets the duration of the scratch org to the maximum of 30 days, after which it's deleted and you lose access to it. 2. After you create your scratch org, you can see it in your org list known to the CLI by running `sf org list`. **tip:** To see how many scratch orgs you're using, run `sf org list limits --target-org ` and search for `ActiveScratchOrgs` and `DailyScratchOrgs` in the output table. Alternatively, to view your Active scratch orgs, go to the App Launcher in Lightning Experience, enter **Scratch** to find **All Scratch Orgs** and **Scratch Org Info**. 3. Capture your scratch org user information. 1. With the username that was created for your new scratch org, generate a password for this new admin user. Record this password to help you log in to your scratch org later. ```bash sf org generate password --target-org scratch1 ``` - `--target-org` specifies your scratch org username. You can find this information in **Scratch Org Info**. Alternatively, use the `scratch1` alias you created earlier. 2. Next, determine the instance URL using the same username or alias. Save this info for later. ```bash sf org display user --target-org scratch1 ``` 4. Assign Slack permission sets to your scratch org user. 1. Log in to your scratch org with your scratch org username and generated password. Alternatively, open your scratch org by running `sf org open`. Since you set this scratch org as the default using the `--set-default` flag in an earlier step, SFDX stores your authentication token and uses it to log in for you. 2. Create a permission set with the same steps as [Enable User Permissions](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/setup-your-env.md#enable-user-permissions) in your scratch org. Make sure to select **Connect Salesforce with Slack** and **Create and Update Second-Generation Packages**. Assign the permission set to your scratch org user. **important:** You must also [accept the Salesforce for Slack Beta Terms and Conditions](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/enable-beta.md) to use Apex SDK for Slack in a scratch org. 5. Confirm your SFDX setup. 1. Open VS Code, and create a file called `SayHello.cls` in `force-app/main/default/classes`. Copy and paste this code, and then save the file. ```java // SayHello.cls public class SayHello { public String hello() { return 'Hello World!'; } } ``` 2. Create the metadata file `SayHello.cls-meta.xml` in `force-app/main/default/classes`. Copy and paste this code, and then save the file. ```xquery 54.0 Active ``` 3. Deploy the source to the scratch org. ```bash sf project deploy start ``` When you deploy successfully, a summary is displayed. Next, [deploy a Slack app](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/run-deploy.md) to your scratch org. **tip:** If you receive an expired access or refresh token error, check that your scratch org is still valid and not expired. ## See Also [Scratch Orgs](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_scratch_orgs.htm) # Shortcuts and Slash Commands Users can interact with your app through shortcuts and slash commands. To respond when a shortcut or slash command is triggered, or when an event is dispatched: - Write a class that extends from one of the [dispatcher classes](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_dispatchers.md) - Register the class in the [app's metadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/app-definition.md). A class that extends the dispatcher based on the action or event you’re handling provides dispatching logic that returns a [`Slack.ActionHandler`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_dispatchers.md#actionhandler-class). The `Slack.ActionHandler` `invoke()` method performs processing logic when the handler is invoked. ## Shortcuts Users access shortcuts in Slack by clicking the lightning bolt or typing a slash. They’re ideal for common and repeatable actions within an app. An app can have up to 5 shortcuts, and only up to 10 actions (shortcuts and slash commands) are visible within the menu, and fewer are visible on mobile. ![Shortcuts enable users to invoke actions](https://developer.salesforce.com/media/shortcuts.png) There are two types of shortcuts. - Global shortcuts: Available to users from the shortcuts button in the composer or when using search. - Message shortcuts: Available to users in the context menu of a message. For more information, see [What's the difference between message and global shortcuts?](https://api.slack.com/interactivity/shortcuts/using#shortcut_types) To implement a shortcut handler for a global or message shortcut, extend the `Slack.ShortcutDispatcher` class. Write code that performs actions and generates a response when the shortcut is triggered. To map this class as the handler for the corresponding shortcut in the app's metadata, use its `callback_id`. This value must match the value that you define when you create the shortcut in your Slack app. You can find the callback ID in the **Interactivity & Shortcuts** page at [api.slack.com/apps](https://api.slack.com/apps/). ![Shortcuts with callback IDs](https://developer.salesforce.com/media/callbackID.png) **tip:** If you've already defined your shortcuts, you can also find the `callback_id` in the app manifest. ### Global Shortcuts Global shortcut handlers receive these properties from `Slack.RequestContext`, a class that's passed into the `invoke()` method. - `appId`—The application's unique ID. - `enterpriseId`—The organization ID for Enterprise Grid. null values are accepted. - `userId`—The Slack user’s user_id associated with this request. - `teamId`—The Slack workspace ID. - `triggerId`—A temporary ID generated for the interaction in your app. This value can be used to open [modals](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/surface.md#modal). ### Message Shortcuts Message shortcut handlers receive these properties from `Slack.RequestContext`, a class that's passed into the `invoke()` method. - `appId`—The application's unique ID. - `channelId`—The channel where the source message was located. - `enterpriseId`—The organization ID for Enterprise Grid. null values are accepted. - `Message`—The message that the user initiated the shortcut from. - `text`—The text of the message. - `ts`—The timestamp of the message. - `user`—The user who initiated the shortcut. - `userId`—The Slack user’s user_id associated with this request. - `teamId`—The Slack workspace ID. - `triggerId`—A temporary ID generated for the interaction in your app. This value can be used to open [modals](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/surface.md#modal). ## Slash Commands Generally, we recommend creating shortcuts instead of slash commands for key navigation and discoverability. When a user submits a slash command, Slack sends a payload of data to your app via an HTTP POST request. The slash command can be an entry point to a simple message response or a complex workflow. ![Slash commands trigger an action like viewing a record](https://developer.salesforce.com/media/slash_command.png) **tip:** Slack comes prebuilt with a list of slash commands. See [What are Slash Commands?](https://api.slack.com/interactivity/slash-commands#enabling-interactivity-with-slash-commands__what-are-slash-commands) and [Getting Started with Slash Commands](https://api.slack.com/interactivity/slash-commands#getting_started). To perform actions and generate a response when a slash command is sent from the message composer box in Slack, extend the [`Slack.SlashCommandDispatcher` class](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_dispatchers.md#slashcommanddispatcher-class). Map this class as the handler for the corresponding slash command in the app's metadata. The command must specify the same value used to create the slash command in your Slack app. See [Register an Action](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/actions_register.md). Slash commands receive these properties from [`Slack.RequestContext`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_requestcontext.md), a class that's passed into the `invoke()` method. - `appId`—The application's unique ID. - `channelId`—The channel where the source message was located. - `enterpriseId`—The organization ID for Enterprise Grid. null values are accepted. - `userId`—The Slack user’s user_id associated with this request. - `teamId`—The Slack workspace ID. - `triggerId`—A temporary ID generated for the interaction in your app. This value can be used to open windows. ## Use Slash Commands and Shortcuts with Flows Users can use slash commands, global shortcuts, and message shortcuts to trigger flows. Add your action to the [app's metadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/app-definition.md). ```yaml description: App configuration for running flows in slack commands: /SlashCommandName: action: definition: flow__requestHandler properties: flowApiName: slashCommandFlow title: Launch flow command description: Launches a flow in a modal from slack` globalShortcuts: flow-gs: action: definition: flow__requestHandler properties: flowApiName: ScreenFlowOnSlackGS title: Launches flow with API Name ScreenFlowOnSlackGS description: Launches a flow from slack global shortcut. messageShortcuts: flow-ms: action: definition: flow__requestHandler properties: flowApiName: ScreenFlowOnSlackMS title: Launches flow with API Name ScreenFlowOnSlackMS description: Launches a flow from slack message shortcut. ``` **important:** Slash commands are global and can’t contain namespaces. This table outlines the keys required in the app manifest to bind flows to actions. **Keys** | Key | Type | Required | Description | | ------------------------------- | ------ | -------- | -------------------------------------------------------- | | `action.definition` | String | Yes | A reference to the expected return type of the flow API. | | `action.properties.flowApiName` | String | Yes | The name of the flow API. | | `title` | String | No | Reserved for future use. | | `description` | String | No | The purpose for this slash command. Not used in code. | ## Use Slack Buttons with Flows Trigger flows with Slack buttons by using an on-click event. ```yaml description: "Launches a flow from a button" components: definition: message components: definition: "actions" components: definition: "button" properties: name: "flowButton" label: "Launch Flow" events: onclick: definition: "flow__requestHandler" properties: flowApiName: "MyFlow" ``` **Keys** | Key | Type | Required | Description | | ------------------------------------------------------------- | ------ | -------- | ----------------------------------------------------- | | `properties.name` | String | Yes | Button Name | | `properties.label` | String | Yes | Button Label | | `properties.events.onclick.definition` | String | No | The purpose for this slash command. Not used in code. | | `properties.events.onclick.definition.properties.flowAPIName` | String | | The name of the flow API. | ## See Also [Entry points for app interactions](https://api.slack.com/interactivity/entry-points) # Slack Integration User Sharing Salesforce data securely is essential regardless if users are chatting on public, private, multi-party, or connect channels. Salesforce sends data to Slack, but Slack must know how to display data based on each user's context within a given channel. The Slack System User configuration page provides the most secure rendering experience for multi-user Salesforce content displayed in Slack from Salesforce. All users get a tailored experience based on the preferences configured on the Slack Integration User Setup. To get a better of understanding of how to use the integration user setup in Salesforce it's necessary to understand the types of users within Slack. ## Categories of Slack Users Within any Slack Channel, there are three categories of users: 1. Default Render User, a global user that has access to all Slack apps. 2. System User, a user based on a system event. 3. Unmapped User, a user not mapped between Salesforce and Slack when a request is made for that user. ## Integration User Setup 1. From Setup, in the Quick Find box, enter `Apex`. 2. Select **Build Slack Apps with Apex**. 3. Accept the terms of services. 4. In the Quick Find box, enter `System Users`. 5. Select **System Users Setup**. ![IntegrationUserSetup](https://developer.salesforce.com/docs/media/slack_default_render.png) ## Shared User Mappings Shared user mappings enable a Slack user to authenticate to a Salesforce org one time for all Apex SDK for Slack apps. These apps must be installed in the same Salesforce org within the same Slack workspace. When a user authenticates successfully to one of these apps, a shared user-mapping record is created. ### View or Delete User Mappings The Slack User Mappings page in your Personal Settings shows the Slack users who are mapped to your Salesforce account. This page is available only in Lightning Experience. On the Slack User Mappings page, you can delete a user mapping if you no longer wish to use an Apex SDK for Slack app. To remove the shared user-mapping record in your org: 1. From your personal settings, in the Quick Find box, enter Slack, and then select **Slack User Mappings**. 2. Click the dropdown next to the user mapping you want to delete. Select **Delete**. ### Revoke a User Mapping Removing the shared user-mapping record doesn’t remove your org association from the app. You’ll be prompted to reconnect your app to the same org next time, which then establishes a new user-mapping record. To fully revoke user mapping to an org or app, an admin must deactivate the user in the Salesforce org or Slack app. By doing so, you can then associate the Slack user with another user of that org. Alternatively, if you must associate a Slack workspace to a different org, we recommend that you uninstall the app from the Slack workspace before attempting to connect the workspace to the org. ## Connection Errors The following list of scenarios result in an error. - Connecting a Slack app and user to a Salesforce org with a different Salesforce username. After a Slack user-mapping record is created, Apex SDK for Slack uses it for org authentication. However, if you install the Slack app in a different workspace, then you can use a different Salesforce username. - A user doesn't have permission to access a Slack app. - An org doesn't have permission to access a Slack app. **note:** Slack displays `Dispatch failed` if it doesn't get a response from the SDK within a certain time limit, receives a 404, or encounters an unexpected error. # Slack Mass User Provisioning API ## Overview The Slack Mass User Provisioning API allows bulk import and the ability to revoke user mappings between a Salesforce and Slack user. This feature is helpful for organizations with larger user lists. ## Prerequisites 1. Accept all Slack terms of service. ([Learn more](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/enable-beta.html?q=enable)) 2. A user who has the Connect Salesforce with Slack and the Manage Slack user mappings permissions enabled and assigned. 3. Access to a list of user mappings of Salesforce user id to Slack user id. ## Importing User Mappings To import user mappings you must know the Salesforce and the Slack User IDs. Using the known IDs, create a list of user mappings with the Slack.UserMapping object. ```java List mappings = new List(); mappings.add(new Slack.UserMapping(salesforceUserId, slackUserId)); ``` After you have a list of mappings, use the Slack.UserProvisioningProvider to import the users for the workspace. ```java Slack.UserProvisioningProvider.importUsers(mappings, workspaceId); ``` When the call to importUsers is complete, the API returns a result object that contains a list of successful mappings and a list of unsuccessful mappings. ```java Slack.UserProvisioningResult result = Slack.UserProvisioningProvider.importUsers(mappings, workspaceId); List successfulMappings = result.getSuccessfulMappings(); List failedMappings = result.getFailedMappings(); ``` Each unsuccessful mapping has a failure code and message associated with it. Mappings can fail because of an invalid Salesforce ID, an invalid Slack ID, or a previous mapping. ```java failedMapping.getError().getCode(); failedMapping.getError().getMessage(); ``` Important: Use of Slack.UserProvisioningProvider is limited to Salesforce users with the Enable Slack User Pre-mapping API user permission. A user without this permission gets an exception during execution. ### Example - Import Users This code sample uses the API to create a single user mapping. The Slack user ID and Salesforce user ID of the mapping is already known. ```java // needed information - workspace id, salesforce user id, slack user id String workspaceId = 'T0000000001'; String salesforceUserId = '005xx000001X7yjAAC'; String slackUserId = 'U000000001'; // create a list of user mappings between salesforce and slack ids List mappings = new List(); mappings.add(new Slack.UserMapping(salesforceUserId, slackUserId)); // import the user mappings Slack.UserProvisioningResult result = Slack.UserProvisioningProvider.importUsers(mappings, workspaceId); // assert the results List successfulMappings = result.getSuccessfulMappings(); List failedMappings = result.getFailedMappings(); System.debug('Number of successful mappings: ' + successfulMappings.size()); System.debug('Number of failed mappings: ' + failedMappings.size()); ``` ## Revoking User Mappings Individual mappings can be revoked by providing the Salesforce user ID and the team or workspace that they’re associated with or the Slack user id. Using the known user id, you create a list of strings of either the Salesforce user id or the Slack user id. ```java List salesforceIdsToRevoke = new List(); salesforceIdsToRevoke.add(salesforceUserId); ``` After you have a list of user ids, use the Slack.UserProvisioningProvider to revoke the users based on id type for the workspace. ```java // revoke by salesforce id Slack.UserProvisioningProvider.revokeUsersBySalesforceId(salesforceIdsToRevoke, workspaceId); // revoke by slack id Slack.UserProvisioningProvider.revokeUsersBySlackId(slackIdsToRevoke); ``` After the call to revoke users is complete, the API returns a result object containing a list of successful mappings and a list of unsuccessful mappings. ```java Slack.UserProvisioningResult result = Slack.UserProvisioningProvider.revokeUsersBySalesforceId(salesforceIdsToRevoke, workspaceId); List successfulRevokedMappings = result.getSuccessfulMappings(); List failedRevokedMappings = result.getFailedMappings(); ``` Each unsuccessful revoked mapping has a failure code and message associated with it. Revoked mappings fail because of an invalid Salesforce ID, an invalid Slack ID, or a non-existent user mapping. ```java failedMapping.getError().getCode(); failedMapping.getError().getMessage(); ``` Important: Use of Slack.UserProvisioningProvider is limited to Salesforce users with the Enable Slack User Pre-mapping API user permission. A user without this permission gets an exception during execution. ### Example - Revoke by Salesforce User Id ```java // needed information - workspace id, salesforce user id String workspaceId = 'T0000000001'; String salesforceUserId = '005xx000001X7yjAAC'; // create a list of user mappings between salesforce and slack ids List salesforceIdsToRevoke = new List(); salesforceIdsToRevoke.add(salesforceUserId); // revoke the user mappings Slack.UserProvisioningResult result = Slack.UserProvisioningProvider.revokeUsersBySalesforceId(salesforceIdsToRevoke, workspaceId); // assert the results List successfulRevokedMappings = result.getSuccessfulMappings(); List failedRevokedMappings = result.getFailedMappings(); System.debug('Number of successful revoked mappings: ' + successfulRevokedMappings.size()); System.debug('Number of failed revoked mappings: ' + failedRevokedMappings.size()); ``` ### Example - Revoke by Slack User Id ```java // needed information - slack user id String slackUserId = 'U000000001'; // create a list of user mappings between salesforce and slack ids List slackIdsToRevoke = new List(); slackIdsToRevoke.add(slackUserId); // revoke the user mappings Slack.UserProvisioningResult result = Slack.UserProvisioningProvider.revokeUsersBySlackId(slackIdsToRevoke); // assert the results List successfulRevokedMappings = result.getSuccessfulMappings(); List failedRevokedMappings = result.getFailedMappings(); System.debug('Number of successful revoked mappings: ' + successfulRevokedMappings.size()); System.debug('Number of failed revoked mappings: ' + failedRevokedMappings.size()); ``` # SlackApp Represents a Slack app. This type extends the [MetadataWithContent](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_metadatawithcontent.htm) metadata type and inherits its `content` and `fullName` fields. ## Declarative Metadata File Suffix and Directory Location The file suffix is `.slackapp` for the Slack app configuration file. The accompanying metadata file is named `YourAppName.slackapp-meta.xml`. The files are stored in the `slackapps` folder in the corresponding package directory. ## Version Slack apps are available in API version 54.0 and later. ## Special Access Rules To use this metadata type, your org must have Slack capabilities and packaging enabled. You must also [enable user permissions](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/setup-your-env.md) to connect Salesforce with Slack. ## Fields | Field Name | Field Type | Description | | --------------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `appKey` | string | Required. The app ID, as shown on the Slack app's Basic Information page. | | `appToken` | string | Required. The app token, as shown on the Basic Information page. The app token starts with `xapp-` . Retrieving this field isn't supported. The app token is always returned as `*`. | | `botScopes` | string | The comma-separated list of scopes that determine what your app can access, as shown on the OAuth & Permissions page. For example, `chat:write` lets your app post messages. See [Slack API: Permission scopes](https://api.slack.com/scopes). | | `clientKey` | string | Required. The client ID, as shown on the Basic Information page. Retrieving this field isn't supported. The client ID is always returned as `*`. | | `clientSecret` | string | Required. The client secret, as shown on the Basic Information page. See [Slack API: oauth.v2.access](https://api.slack.com/methods/oauth.v2.access). Retrieving this field isn't supported. The client secret is always returned as `*`. | | `content` | base64Binary | The page content. Base 64-encoded binary data. Prior to making an API call, client applications must encode the binary attachment data as base64. Upon receiving a response, client applications must decode the base64 data to binary. This conversion is usually handled for you by a SOAP client. This field is inherited from the MetadataWithContent component. | | `fullName` | string | The developer name used as a unique identifier for API access. `fullName` can contain only underscores and alphanumeric characters. It must be unique, begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores. This field is inherited from the [Metadata](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/docs/atlas.en-us.api_meta.meta/api_meta/metadata.htm) component. | | `isProtected` | boolean | Indicates whether the Slack app is protected (true) or not (false). If true, only this package can reference the Slack app directly. | | `masterLabel` | string | Required. Name of the Slack app that appears in the Salesforce user interface. | | `signingSecret` | string | Required. The string that Slack uses to sign the request. Retrieving this field isn't supported. The signing secret is always returned as `*`. | | `userScopes` | string | The comma-separated list of scopes that access user data and act on behalf of users that authorize them. For example, `channels:write` manages a user's public channels and create new ones on a user's behalf. See [Slack API: Permission scopes](https://api.slack.com/scopes). | ## Usage `SlackApp` enables you to configure your app's info, configuration, and connection. Create the following files: - `.slackapp-meta.xml` defines your app connection, such as your app key and token. - `.slackapp` defines your app handlers for slash commands, shortcuts, and event handlers in YAML format. By default, posting to Slack on behalf of the app is restricted. If the app is protected, Apex references to the app, like `Slack.App.namespace.AppName`, fail at save time. ```java // Don't do this Slack.App.namespace.ProtectedAppName; // FAIL // Do this instead Slack.App.namespace.UnprotectedAppName; Slack.App.MyAppName; ``` ## Declarative Metadata Sample Definition This is the definition of a Slack app in the `MySlackApp.slackapp-meta.xml` file. **note:** Replace the `botScopes`, `userScopes`, and other field values with your own. ```xquery A01NQ710000 xapp-1-A1191J583K2-2584222565523... * 62673491768.1771200000000 33fea01130000 false My Slack App 8f742231b10e8888abcd99yyyzzz85a5 * ``` The corresponding `MySlackApp.slackapp` configuration file in YAML format, which defines the commands and shortcut handlers. See [Define an App](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/app-definition.md). ```yml description: Hello World Example App commands: /apex-hello: action: definition: apex__action__SayHello title: Say Hello description: A command to say Hello ``` In the `/classes` directory, create the `SayHello.cls` Apex class and the `SayHello.cls-meta.xml` files. This class retrieves the `hello` example view definition. See [ViewDefinition](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/meta_viewdefinition.md). ```java // SayHello.cls public class SayHello extends Slack.SlashCommandDispatcher { public override Slack.ActionHandler invoke(Slack.SlashCommandParameters parameters, Slack.RequestContext context) { return Slack.ActionHandler.modal(new Handler(parameters, context), 'Say Hello'); } public class Handler implements Slack.ModalHandler { Slack.SlashCommandParameters parameters; Slack.RequestContext context; public Handler (Slack.SlashCommandParameters parameters, Slack.RequestContext context){ this.parameters = parameters; this.context = context; } public Slack.ModalView call () { String name = parameters.getText(); Slack.ViewReference viewReference = Slack.View.hello.get(); viewReference.setParameter('name', name); Slack.ModalView modalView = new Slack.ModalView.builder() .viewReference(viewReference) .build(); return modalView; } } } ``` The `SayHello.cls-meta.xml` file looks like this. ```xquery 54.0 Active ``` ## Wildcard Support in the Manifest File This metadata type supports the wildcard character \* (asterisk) in the package.xml manifest file. For information about using the manifest file, see [Deploying and Retrieving Metadata with the Zip File](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/docs/atlas.en-us.api_meta.meta/api_meta/file_based_zip_file.htm). # SlackApp Represents a Slack app. Includes access to the associated SlackApp object in the Metadata API. Available in API version 54.0 and later. ## Supported SOAP API Calls `create()`, `delete()`, `describeSObjects()`, `query()`, `retrieve()`, `update()`, `upsert()` ## Supported REST API HTTP Methods `DELETE`, `GET`, `HEAD`, `PATCH`, `POST`, `Query` ## Special Access Rules To use this object, your org must have Slack capabilities and packaging enabled. You must also [enable user permissions](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/setup-your-env.md) to connect Salesforce with Slack. | Field Name | Description | | :---------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `AppKey` | **Type**
encryptedstring
**Properties**
Filter, Group, idLookup, Sort
**Description**
The app ID, as shown on the Slack app's Basic Information page. | | `AppToken` | **Type**
encryptedstring
**Type**
encryptedstring
**Properties**
Nillable
**Description**
The app token, as shown on the Basic Information page. The app token starts with `xapp-`. Retrieving this field isn't supported. | | `ClientKey` | **Type**
encryptedstring
**Properties**
Nillable
**Description**
The client ID, as shown on the Basic Information page. Retrieving this field isn't supported. | | `ClientSecret` | **Type**
encryptedstring
**Properties**
Nillable
**Description**
The client secret, as shown on the Basic Information page. See [Slack API: oauth.v2.access](https://api.slack.com/methods/oauth.v2.access). Retrieving this field isn't supported. | | `Config` | **Type**
textarea
**Properties**
Nillable
**Description**
The app configuration in YAML format. | | `DeveloperName` | **Type**
string
**Properties**
Filter, Group, Sort
**Description**
The unique name of the object in the API. This name can contain only underscores and alphanumeric characters, and must be unique in your org. It must begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores. In managed packages, this field prevents naming conflicts on package installations. With this field, a developer can change the object’s name in a managed package and the changes are reflected in a subscriber’s organization. | | `FullName` | **Type**
string
**Properties**
Create, Group, Nillable
**Description**
The full name of the associated SlackApp object in Metadata API. Query this field only if the query result contains no more than one record. Otherwise, an error is returned. If more than one record exists, use multiple queries to retrieve the records. This limit protects performance. | | `IsProtected` | **Type**
boolean
**Properties**
Defaulted on create, Filter, Group, Sort
**Description**
Indicates whether the Slack app is protected (true) or not (false). If true, only this package can reference the Slack app directly. The default value is false. | | `Language` | **Type**
picklist
**Properties**
Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort
**Description**
The language associated with the Slack app. For example, en_US for English and es for Spanish. | | `ManageableState` | **Type**
ManageableState enumerated list
**Properties**
Filter, Group, Nillable, Restricted picklist, Sort
**Description**
Indicates the manageable state of the specified component that is contained in a package:
- beta
- deleted
- deprecated
- deprecatedEditable
- installed
- installedEditable
- released
- unmanaged | | `MasterLabel` | **Type**
string
**Properties**
Filter, Group, Nillable, Sort
**Description**
Label for the Slack app. | | `NamespacePrefix` | **Type**
string
**Properties**
Filter, Group, Nillable, Sort
**Description**
The namespace that identifies the package that manages the Slack app. | | `SigningSecret` | **Type**
encryptedstring
**Properties**
Nillable
**Description**
The string that Slack uses to sign the request. Retrieving this field isn't supported. | # Standard Apex Response Methods The Apex response classes include standard response methods for Slack's [Web API methods](https://api.slack.com/methods). These response methods are indicated on the Apex response classes that support them. ## getError() Gets the error on the response. See the corresponding Slack method's list of errors, for example, [calls.add method’s list of errors](https://api.slack.com/methods/calls.add#errors). **Signature** ```java public String getError() ``` **Return Value** Type: String ## getHttpResponseHeaders() **Signature** ```java public Map> getHttpResponseHeaders() ``` **Return Value** Type: Map> ## getNeeded() **Signature** ```java public String getNeeded() ``` **Return Value** Type: String ## getProvided() **Signature** ```java public String getProvided() ``` **Return Value** Type: String ## getWarning() Gets the warning on the response. See the corresponding Slack method's list of errors, for example, [calls.add method’s list of warnings](https://api.slack.com/methods/calls.add#warnings). **Signature** ```java public String getWarning() ``` **Return Value** Type: String ## isOk() Specifies whether the API call is successful. **Signature** ```java public Boolean isOk() ``` **Return Value** Type: Boolean ## isSnoozeIsIndefinite() **Signature** ```java public Boolean isSnoozeIsIndefinite() ``` **Return Value** Type: Boolean ## setError(error) Sets the error message in the response. **Signature** ```java public void setError(String error) ``` **Parameters** _error_ Type: String **Return Value** Type: void ## setHttpResponseHeaders(httpResponseHeaders) **Signature** ```java public void setHttpResponseHeaders(Map> httpResponseHeaders) ``` **Parameters** _error_ Type: Map> **Return Value** Type: void ## setNeeded(needed) **Signature** ```java public void setNeeded(String needed) ``` **Parameters** _needed_ Type: String **Return Value** Type: void ## setOk(ok) Specifies whether the API call is successful. **Signature** ```java public void setOk(Boolean ok) ``` **Parameters** _ok_ Type: Boolean **Return Value** Type: void ## setProvided(provided) **Signature** ```java public void setProvided(String provided) ``` **Parameters** _provided_ Type: String **Return Value** Type: void ## setSnoozeIsIndefinite(snoozeIsIndefinite) **Signature** ```java public void setSnoozeIsIndefinite(Boolean snoozeIsIndefinite) ``` **Parameters** _snoozeIsIndefinite_ Type: Boolean **Return Value** Type: void ## setWarning(warning) Sets the warning message in the response. **Signature** ```java public void setWarning(String warning) ``` **Parameters** _warning_ Type: String **Return Value** Type: void # Surface Components The root component of a view containing layout components. You can add components to these surfaces: the Home tab, messages, and modals. ## Home The Home tab is a persistent, dynamic interface for apps. Present each of your users with a unique Home tab just for them, always found in the same place. The Home tab is a space you can fully customize in your app, complete with intricate layouts and deep interactivity. A single API endpoint handles building and updating the Home tab. See [Home is where the tabs are](https://api.slack.com/surfaces/tabs). Publish views to the app's home tab in Slack using Slack.BotClient. See [Access a Slack Client](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/actions_register.md#access-a-slack-client). **warning:** Apex SDK for Slack is subject to Slack's block limit, which is 100 blocks in a the Home tab. If you are displaying Salesforce record data that exceeds 100 blocks, we recommend that you provide a button or link that directs a user back to Salesforce for a complete view. ![Home tab example](https://developer.salesforce.com/media/home.png) **Examples** This example creates a header and section for the Home tab. ```yaml components: - definition: home components: - definition: header properties: text: "Our App" - definition: section properties: text: type: "mrkdwn" text: "Our app helps you take off. :rocket:" - definition: divider - definition: section properties: text: "For more information, check out the example." components: - definition: button properties: name: "my_button" label: "Click Me" url: "https://www.example.com" ``` This example creates some text, a header, and several buttons for the Home tab. ```yaml description: "This is a simple app home" schema: properties: bodyText: type: string required: true headerText: type: string defaultValue: "Welcome Home" components: - definition: home components: - definition: header properties: text: "{!view.properties.headerText}" - definition: section properties: text: type: "mrkdwn" text: "{!view.properties.bodyText}" - definition: divider - definition: actions components: - definition: button properties: label: "Click Me" name: "homeButton" value: "someData" events: onclick: definition: "apex__action__HandleClick" - definition: button properties: label: "View Opportunity" name: "opptyButton" events: onclick: definition: "apex__action__ViewRecord" properties: objectApiName: "Opportunity" recordId: "006R0000003FpnmIII" ``` **Keys** | Key | Type | Required | Description | | ------------ | ------ | -------- | ------------------------------------------- | | `definition` | String | Yes | The value must be `home`. | | `components` | Array | Yes | An array of [layout components](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md). | ## Message Messages are one of the basic ingredients of Slack apps. Compose them, send them, retrieve them, update them, delete them. Send messages to a channel using `Slack.BotClient` and `Slack.UserClient`. See [Access a Slack Client](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/actions_register.md#access-a-slack-client). **warning:** Apex SDK for Slack is subject to Slack's block limit, which is 50 blocks in a message. If you are displaying Salesforce record data that exceeds 50 blocks, we recommend that you provide a button or link that directs a user back to Salesforce for a complete view. ![Message example](https://developer.salesforce.com/media/message.png) **Examples** This example creates a message with a header and a section containing some text. ```yaml components: - definition: message properties: text: "All your tasks are completed." components: - definition: header properties: text: "Daily Tasks" - definition: section properties: text: type: "mrkdwn" text: "You've completed all your tasks today. :tada:" ``` This example creates a message with a header and a button that opens a URL. ```yaml description: "This is the app welcome message." schema: properties: homeLink: type: string required: true components: - definition: message properties: text: "This is the app welcome message." components: - definition: header properties: text: "Welcome!" - definition: actions components: - definition: button properties: name: "visit_home_button" label: "Visit the Home Page" url: "{!view.properties.homeLink}" ``` **Keys** | Key | Type | Required | Description | | ----------------- | --------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `definition` | String | Yes | The value must be `message`. | | `properties` | Object | No | The component's properties. | | `properties.text` | String, [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md) | No | When you use components in a message payload, `text` becomes a fallback message displayed in notifications. Use components to define everything else about the visible message. | | `components` | Array | No | An array of [layout components](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md) to render as the message. | ## Modal Modals are focused spaces to request and collect data from users, or to temporarily display dynamic and interactive information. Modals are the Slack app equivalent of alert boxes, pop-ups, or dialog boxes. They capture and maintain focus within Slack until the user submits or dismisses the modal. Compose a modal using visual and interactive components. If you're not familiar with a modal's lifecycle in a Slack app, see [Modals: focused spaces for user interaction](https://api.slack.com/surfaces/modals). Modals can handle these interaction payloads. - `block_actions`—Received when a user interacts with a component - `view_submission`—Received when a user submits a view in a modal. - `view_closed`—Received when a user dismisses a modal. To receive these payloads, the modal view must have been created with the `notify_on_close` argument set to `true`. Payloads include a `trigger_id` that you must use to respond back with a modal. Slack has a 3-second expiration on the `trigger_id`. But what if you're making an API call to fetch some data? A request could exceed this 3-second timeout. To satisfy the 3-second ack rule and work with modals, use the `Slack.ActionHandler` Apex class. [`Slack.ActionHandler`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_dispatchers.md#actionhandler-class) has a number of methods to help you structure your handler. You can respond to Slack with a staging modal, which is a simple **Loading...** view. At this point, app code can take time to build up the actual modal view to show. **warning:** Apex SDK for Slack is subject to Slack's block limit, which is 100 blocks in a modal. If you are displaying Salesforce record data that exceeds 100 blocks, we recommend that you provide a button or link that directs a user back to Salesforce for a complete view. ![Modal example](https://developer.salesforce.com/media/modal.png) **Example** ```yaml components: - definition: modal properties: title: "Update Opportunity" submitLabel: "Update" closeLabel: "Cancel" events: onsubmit: definition: "apex__action__EditRecord" properties: recordId: "{!view.properties.recordId}" objectApiName: "Opportunity" oncancel: definition: "apex__action__CancelSave" properties: recordId: "{!view.properties.recordId}" objectApiName: "Opportunity" components: - definition: section properties: text: "Text Value" ``` **Keys** | Key | Type | Required | Description | | ---------------------------- | -------------------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------- | | `definition` | String | Yes | The value must be `modal`. | | `properties` | Object | Yes | The component's properties | | `properties.title` | String, [Plain Text](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#plain-text), [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md#expressions) | Yes | Title text for the modal | | `properties.submitLabel` | String, [Plain Text](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#plain-text), [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md#expressions) | No | A label for the submit button | | `properties.closeLabel` | String, [Plain Text](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/composition.md#plain-text), [Expression](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/expressions.md#expressions) | No | A label for the close button | | `components` | Array | No | An array of [layout components](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md) to render inside the modal. | | `events` | Object | No | The events on the modal that trigger [Actions](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#actions) to execute. | | `events.onsubmit` | Object | No | An object that defines the action to take when the `onsubmit` event fires and the properties to pass to the action. | | `events.onsubmit.definition` | String | No | The [action](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#actions) that executes when a user clicks the submit button. | | `events.onsubmit.properties` | Object | No | The properties to pass to the action. | | `events.oncancel` | Object | No | An object that defines the action to take when the `oncancel` event fires and the properties to pass to the action. | | `events.oncancel.definition` | String | No | The [action](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/layout.md#actions) that executes when a user clicks the cancel button. | | `events.oncancel.properties` | Object | No | The properties to pass to the action. | ## See Also - [Creating useful dialogs](https://api.slack.com/best-practices/creating-useful-dialogs) - [Interacting with users through dialogs](https://api.slack.com/dialogs) # Test Client Overrides Test Harness allows test authors to override various clients (AppClient, BotClient, UserClient) when running tests. Test Harness also allows test authors to provide implementations for the Slack API methods without a default implementation by the test harness. Negative testing of Slack APIs is allowed as well. To mock the clients, the test author must extend from the proper client mock (AppClientMock, BotClientMock, UserClientMock). The tester then provides override implementations for the API methods to mock. The implementation must receive the request payload as the parameter and return a response payload as a result. You can override multiple methods in the same mock, but any methods that aren’t overridden default to the implementation that the test harness provides. Methods with a default implementation: - chatPostEphemeral - chatPostMessage - conversationsInfo - usersInfo - viewsOpen - viewsPublish - viewsPush - viewsUpdate **note:** If you provide a constructor implementation for your mock client, you must call the super method to insure access to the default api method implementations. To use the mock implementation it must be set on the Slack State object by calling the proper method in the test. - [SlackState.setAppClientMock(AppClientMock)](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_testharness.md#testharnessstate-class) - [SlackState.setBotClientMock(BotClientMock)](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_testharness.md#testharnessstate-class) - [SlackState.setUserClientMock(UserClientMock)](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_testharness.md#testharnessteam-class) It’s optional, but recommended, to clear the mock clients after the test finishes by calling the proper methods in the test. - [SlackState.clearAppClientMock()](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_testharness.md#testharnessstate-class) - [SlackState.clearBotClientMock()](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_testharness.md#testharnessstate-class) - [SlackState.clearUserClientMock()](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_testharness.md#testharnessstate-class) Alternatively you can call [SlackState.clearAllClientMocks()](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_testharness.md#testharnessstate-class) to clear them all at the same time. ## Apex Example ```xquery @isTest public class ExampleMockOverrideTest { private static Slack.TestHarness testHarness; private static Slack.TestHarness.State slackState; static { testHarness = new Slack.TestHarness(); slackState = testHarness.getNewSlackState(); } @isTest static void testReactionsGet() { slackState.setBotClientMock(new MyBotClientMock()); // run commands, shortcuts, events, etc slackState.clearBotClientMock(); } class MyBotClientMock extends Slack.BotClientMock { public override Slack.ReactionsGetResponse reactionsGet(Slack.ReactionsGetRequest request) { Slack.ReactionsGetResponse response = new Slack.ReactionsGetResponse(); response.setOk(true); Slack.ReactionsGetResponse.Message message = new Slack.ReactionsGetResponse.Message(); Slack.Reaction reaction = new Slack.Reaction(); reaction.setName('party'); reaction.setCount(3); List reactions = new List(); reactions.add(reaction); message.setReactions(reactions); message.setText('Test Reactions Message'); response.setMessage(message); return response; } } } ``` # Test Slack Apps Write unit tests to verify whether your Apex code is working properly. Unit tests are class methods that don't take arguments or commit data to the database. Slack app testing includes several files. - The Apex class to be tested - The Apex unit tests - `ApexClass` metadata file - `ApexTestSuite` metadata file In your SFDX project, create an Apex unit test in the `classes` folder. ```txt |_ classes/ |_ MyAction.cls |_ MyAction.cls-meta.xml |_TestMyAction.cls |_TestMyAction.cls-meta.xml |_ slackapps/ |_ testSuites/ |_MyActionTestSuite.testSuite-meta.xml |_ viewdefinitions/ ``` ## Write a Test Create a test class and annotate it with `@isTest`. Similarly, annotate your class methods with `@isTest`. Name your test class using the format `TestYourActionName`, like `TestAppHomeOpened` or `TestCreateRecordDispatcher`. Declare your test harness variables to store the Slack state and user session. To set up your test harness and simulate user interactions, use the [Slack.TestHarness class](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_testharness.md). ```java @isTest public class TestMyAction { // Test harness variables private static Slack.App slackApp; private static Slack.TestHarness testHarness; private static Slack.TestHarness.State slackState; private static Slack.TestHarness.UserSession userSession; static { // Set up test harness and user session slackApp = Slack.App.ApexSlackApp.get(); testHarness = new Slack.TestHarness(); slackState = testHarness.getNewSlackState(); userSession = slackState.createUserSession(); } // Methods for testing @isTest static void test1() { // Implement test code } @isTest static void test2() { // Implement test code } } ``` **tip:** For more information, see [Testing Examples](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/test_examples.md). ## Add the ApexClass Metadata File The [ApexClass metadata file](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_classes.htm) represents an Apex class, which you include for each test class. TestMyAction.cls-meta.xml: ```xquery 54.0 Active ``` ## Add the ApexTestSuite Metadata File The [ApexTestSuite metadata file](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_apextestsuite.htm) represents a suite of Apex test classes to include in a test run. MyActionTestSuite.testSuite-meta.xml: ```xquery TestMyAction TestMyOtherAction ``` ## See Also [What Are Apex Unit Tests?](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_unit_tests.htm) # Test Slack Apps Apex SDK for Slack provides a test harness framework that enables you to write functional tests for Slack apps without involving the Slack infrastructure. The test framework aims to emulate essential parts of the Slack infrastructure, allowing you to manipulate the emulated state, describe user interactions, and assert against the results. # Testing Examples The [sample Apex SDK for Slack app](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/setup-install-app.md) contains an example implementation of the test harness. These sections show sample app examples. ## Test the Command Dispatcher This example creates an account record and views it in a modal. It runs a test for the `ViewRecordCommandDispatcher.cls` Apex action in the [sample app](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/setup-install-app.md). ```java @isTest public class TestViewRecordCommandDispatcher { private static Slack.App slackApp; private static Slack.TestHarness testHarness; private static Slack.TestHarness.State slackState; private static Slack.TestHarness.UserSession userSession; static { // Set up test harness and user session slackApp = Slack.App.ApexSlackApp.get(); testHarness = new Slack.TestHarness(); slackState = testHarness.getNewSlackState(); userSession = slackState.createUserSession(); } // Create an account and view it in a modal @isTest static void testViewAccount() { // Create new account record Test.startTest(); Account account = new Account(Name='Bob'); insert account; Test.stopTest(); // Execute the 'apex-view-record' command and assert modal userSession.executeSlashCommand('/apex-view-record', 'Account ' + account.Id, slackApp); Slack.TestHarness.Modal modal = userSession.getTopModal(); System.assertEquals('View Account', modal.getTitle()); Slack.TestHarness.Section section = (Slack.TestHarness.Section)modal.getComponent(1, Slack.TestHarness.Section.class); System.assertEquals('Bob', section.getText()); modal.submit(); // Assert message contents with fields: name and id List messages = userSession.getMessages(); System.assertEquals(1, messages.size()); Slack.TestHarness.Message message = messages.get(0); System.assertEquals(4, message.getComponentCount()); Slack.TestHarness.Header header = (Slack.TestHarness.Header)message.getComponent(0, Slack.TestHarness.Header.class); System.assertEquals('Account Record Details', header.getText()); Slack.TestHarness.Field field = (Slack.TestHarness.Field)message.getComponent(2, Slack.TestHarness.Field.class); System.assertEquals('Name', field.getLabel()); System.assertEquals('Bob', field.getField()); field = (Slack.TestHarness.Field)message.getComponent(3, Slack.TestHarness.Field.class); System.assertEquals('Id', field.getLabel()); System.assertEquals(account.Id, field.getField()); } // Create a contact and view it in a modal @isTest static void testViewContact() { // Create new account and contact records Test.startTest(); Account account = new Account(Name='Joe Co'); insert account; Contact contact = new Contact( FirstName='Joe', LastName='Smith', Phone='777-777-7777', Email='joesmith@example.com', AccountId=account.Id ); insert contact; Test.stopTest(); // Execute the 'apex-view-record' command and assert modal userSession.executeSlashCommand('/apex-view-record', 'Contact ' + contact.Id, slackApp); Slack.TestHarness.Modal modal = userSession.getTopModal(); System.assertEquals('View Contact', modal.getTitle()); Slack.TestHarness.Section section = (Slack.TestHarness.Section)modal.getComponent(1, Slack.TestHarness.Section.class); System.assertEquals('Joe Smith', section.getText()); modal.submit(); // Assert message contents with fields: name, id, phone, and email List messages = userSession.getMessages(); System.assertEquals(1, messages.size()); Slack.TestHarness.Message message = messages.get(0); System.assertEquals(6, message.getComponentCount()); Slack.TestHarness.Header header = (Slack.TestHarness.Header)message.getComponent(0, Slack.TestHarness.Header.class); System.assertEquals('Contact Record Details', header.getText()); Slack.TestHarness.Field field = (Slack.TestHarness.Field)message.getComponent(2, Slack.TestHarness.Field.class); System.assertEquals('Name', field.getLabel()); System.assertEquals('Joe Smith', field.getField()); field = (Slack.TestHarness.Field)message.getComponent(3, Slack.TestHarness.Field.class); System.assertEquals('Id', field.getLabel()); System.assertEquals(contact.Id, field.getField()); field = (Slack.TestHarness.Field)message.getComponent(4, Slack.TestHarness.Field.class); System.assertEquals('Phone', field.getLabel()); System.assertEquals('777-777-7777', field.getField()); field = (Slack.TestHarness.Field)message.getComponent(5, Slack.TestHarness.Field.class); System.assertEquals('Email', field.getLabel()); System.assertEquals('joesmith@example.com', field.getField()); } // Create an opportunity and view it in a modal @isTest static void testViewOpportunity() { // Create new opportunity record Test.startTest(); Opportunity opportunity = new Opportunity( Name='Acme Co.', Amount=50000.00, StageName='Qualification', CloseDate=Date.valueOf('2222-12-31') ); insert opportunity; Test.stopTest(); // Execute the 'apex-view-record' command and assert modal userSession.executeSlashCommand('/apex-view-record', 'Opportunity ' + opportunity.Id, slackApp); Slack.TestHarness.Modal modal = userSession.getTopModal(); System.assertEquals('View Opportunity', modal.getTitle()); Slack.TestHarness.Section section = (Slack.TestHarness.Section)modal.getComponent(1, Slack.TestHarness.Section.class); System.assertEquals('Acme Co.', section.getText()); modal.submit(); // Assert message contents with fields: name, id, amount, stage name, qualification, and close date List messages = userSession.getMessages(); System.assertEquals(1, messages.size()); Slack.TestHarness.Message message = messages.get(0); System.assertEquals(7, message.getComponentCount()); Slack.TestHarness.Header header = (Slack.TestHarness.Header)message.getComponent(0, Slack.TestHarness.Header.class); System.assertEquals('Opportunity Record Details', header.getText()); Slack.TestHarness.Field field = (Slack.TestHarness.Field)message.getComponent(2, Slack.TestHarness.Field.class); System.assertEquals('Name', field.getLabel()); System.assertEquals('Acme Co.', field.getField()); field = (Slack.TestHarness.Field)message.getComponent(3, Slack.TestHarness.Field.class); System.assertEquals('Id', field.getLabel()); System.assertEquals(opportunity.Id, field.getField()); field = (Slack.TestHarness.Field)message.getComponent(4, Slack.TestHarness.Field.class); System.assertEquals('Amount', field.getLabel()); System.assertEquals('50000.00', field.getField()); field = (Slack.TestHarness.Field)message.getComponent(5, Slack.TestHarness.Field.class); System.assertEquals('StageName', field.getLabel()); System.assertEquals('Qualification', field.getField()); field = (Slack.TestHarness.Field)message.getComponent(6, Slack.TestHarness.Field.class); System.assertEquals('CloseDate', field.getLabel()); System.assertEquals('Tue Dec 31 00:00:00 GMT 2222', field.getField()); } // Run the view record command without any parameters @isTest static void testMissingParams() { // Execute the 'apex-view-record' command without parameters userSession.executeSlashCommand('/apex-view-record', slackApp); // Assert the message modal Slack.TestHarness.Modal modal = userSession.getTopModal(); System.assertEquals('Invalid Parameters', modal.getTitle()); Slack.TestHarness.Section section = (Slack.TestHarness.Section)modal.getComponent(0, Slack.TestHarness.Section.class); System.assertEquals('The view record command requires 2 arguments: objectApiName and recordId.', section.getText()); } // Run the view record command with invalid parameters @isTest static void testInvalidObject() { // Execute the 'apex-view-record' command with an invalid object userSession.executeSlashCommand('/apex-view-record', 'Invalid_Object Invalid_Record_Id', slackApp); // Assert the message modal Slack.TestHarness.Modal modal = userSession.getTopModal(); System.assertEquals('Invalid Object', modal.getTitle()); Slack.TestHarness.Section section = (Slack.TestHarness.Section)modal.getComponent(0, Slack.TestHarness.Section.class); System.assertEquals('The objectApiName was not a valid option. The view record command supports Account, Contact, and Opportunity', section.getText()); } } ``` ## Mock the Bot Client using the Test Harness For these examples, assume that a basic test harness is set up and the methods are implemented as part of a Slack.BotClientMock. ### Basic Setup This example test suite shows how to mock methods by using the test harness. ```java @isTest public class MyBasicTestSuite { private static Slack.App slackApp; private static Slack.TestHarness testHarness; private static Slack.TestHarness.State slackState; private static Slack.TestHarness.UserSession userSession; static { // setup test harness and user session slackApp = Slack.App.ApexSlackApp.get(); testHarness = new Slack.TestHarness(); slackState = testHarness.getNewSlackState(); userSession = slackState.createUserSession(); } @isTest static void basicTest() { // set the client mock slackState.setBotClientMock(new BasicClientMock()); // perform test operations such as calling slash commands, // shortcuts, or invoking events // clear the client mock slackState.clearBotClientMock(); } // BotClientMock implementation for testing class BasicClientMock extends Slack.BotClientMock { // method overrides } } ``` ## ConversationsCreate This example overwrites the bot clients `conversationsCreate` method. It requires a single `Slack.ConversationsCreateRequest` object as a parameter and returns a `Slack.ConversationsCreateResponse` object as the result. In this example, the Slack state is established in the test context to create a channel using the name from the request object. A successful response is returned with the new channel id and name. See the [Slack Documentation](https://api.slack.com/methods/conversations.create) for more information on the `conversations.create` request and response objects. ```java public override Slack.ConversationsCreateResponse conversationsCreate(Slack.ConversationsCreateRequest request) { Slack.TestHarness.Channel newChannel = null; if (request.isPrivate()) { newChannel = slackState.createPrivateChannel(request.getName()); } else { newChannel = slackState.createPublicChannel(request.getName()); } Slack.ConversationsCreateResponse response = new Slack.ConversationsCreateResponse(); response.setOk(true); Slack.Conversation conversation = new Slack.Conversation(); conversation.setId(newChannel.getId()); conversation.setName(newChannel.getName()); response.setChannel(conversation); return response; } ``` ## Conversations Invite This example overwrites the bot clients `conversationsInvite` method. It requires a single `Slack.ConversationsInviteRequest` object as a parameter and returns a `Slack.ConversationsInviteResponse` object as the result. In this example, the Slack state and the default team are established in the test context to invite the users specified in the request object to the designated channel. A successful response is returned. See the [Slack Documentation](https://api.slack.com/methods/conversations.invite) for more information on the conversations.invite request and response objects. **note:** Orgs need to be on Spring '23 to use the getters associated with any request object. ```java public override Slack.ConversationsInviteResponse conversationsInvite(Slack.ConversationsInviteRequest request) { Slack.TestHarness.Team team = slackState.getDefaultTeam(); String channelId = request.getChannel(); Slack.TestHarness.Channel channel = slackState.getChannel(team, channelId); for (String userId: request.getUsers()) { channel.addUser(slackState.getUser(team, userId)); } Slack.ConversationsInviteResponse response = new Slack.ConversationsInviteResponse(); response.setOk(true); return response; } ``` ## ConversationsList This example overwrites the bot clients `conversationsList` method. It requires a single `Slack.ConversationsListRequest` object as a parameter and returns a `Slack.ConversationsListResponse` object as the result. In this example, the Slack state and default team are established in the test context to return the list of channels. A successful response is returned with a list of channels. See the [Slack Documentation](https://api.slack.com/methods/conversations.list) for more information on the `conversations.list` request and response objects. ```java public override Slack.ConversationsListResponse conversationsList(Slack.ConversationsListRequest request) { List conversations = new List(); List channels = slackState.getDefaultTeam().getChannels(); for (Slack.TestHarness.Channel channel: channels) { Slack.Conversation conversation = new Slack.Conversation(); conversation.setId(channel.getId()); conversation.setName(channel.getName()); conversations.add(conversation); } Slack.ConversationsListResponse response = new Slack.ConversationsListResponse(); response.setOk(true); response.setChannels(conversations); return response; } ``` ## ConversationsInfo This example overwrites the bot clients `conversationsInfo` method. It requires a single `Slack.ConversationsInfoRequest` object as a parameter and returns a `Slack.ConversationsInfoResponse` object as the result. In this example, the super method is called to get information about the requested channel. The mocked topic value is added to the successful response. See the [Slack Documentation](https://api.slack.com/methods/conversations.info) for more information on the `conversations.info` request and response objects. ```java public override Slack.ConversationsInfoResponse conversationsInfo(Slack.ConversationsInfoRequest request) { Slack.ConversationsInfoResponse response = super.conversationsInfo(request); Slack.Conversation conversation = response.getChannel(); Slack.Topic topic = new Slack.Topic(); topic.setValue('Mock Topic Value'); conversation.setTopic(topic); response.setChannel(conversation); return response; } ``` ## Pins Add This example overwrites the bot clients `pinsAdd` method. It requires a single `Slack.PinsAddRequest` object as a parameter and returns a `Slack.PinsAddResponse` object as the result. In this example, the pin information from the request is added to a map that can be used to retrieve the information in a future request. When the request is made it's followed by returning a successful response. See the [Slack Documentation](https://api.slack.com/methods/pins.add) for more information on the pins.add request and response objects. ```java Map> pins = new Map>(); public override Slack.PinsAddResponse pinsAdd(Slack.PinsAddRequest request) { String channelId = request.getChannel(); String timestamp = request.getTimestamp(); if (!pins.containsKey(channelId)) { pins.put(channelId, new List()); } if (!pins.get(channelId).contains(timestamp)) { pins.get(channelId).add(timestamp); } Slack.PinsAddResponse response = new Slack.PinsAddResponse(); response.setOk(true); return response; } ``` ## Pins List This example overwrites the bot clients `pinsList` method. It requires a single `Slack.PinsListRequest` object as a parameter and returns a `Slack.PinsListResponse` object as the result. In this example, the pin information for the given channel specified in the request is removed and a successful response is returned with the list of pinned items. See the [Slack Documentation](https://api.slack.com/methods/pins.list) for more information on the `pins.list` request and response objects. ```java Map> pins = new Map>(); public override Slack.PinsListResponse pinsList(Slack.PinsListRequest request) { String channelId = request.getChannel(); Slack.TestHarness.Channel channel = slackState.getChannel(slackState.getDefaultTeam(), channelId); if (!pins.containsKey(channelId)) { pins.put(channelId, new List()); } List items = new List(); for (String pinTs: pins.get(channelId)) { Slack.PinsListResponse.MessageItem item = new Slack.PinsListResponse.MessageItem(); item.setChannel(channelId); item.setType('message'); items.add(item); } Slack.PinsListResponse response = new Slack.PinsListResponse(); response.setOk(true); response.setItems(items); return response; } ``` ## PinRemove This example overwrites the bot clients `pinsRemove` method. It requires a single `Slack.PinsRemoveRequest` object as a parameter and returns a `Slack.PinsRemoveResponse` object as the result. In this example, the pin information specified in the request is removed from the map containing the information and returned a successful response. See the [Slack Documentation](https://api.slack.com/methods/pins.remove) for more information on the `pins.remove` request and response objects. ```java Map> pins = new Map>(); public override Slack.PinsRemoveResponse pinsRemove(Slack.PinsRemoveRequest request) { String channelId = request.getChannel(); String timestamp = request.getTimestamp(); if (pins.containsKey(channelId) && pins.get(channelId).contains(timestamp)) { pins.get(channelId).remove(pins.get(channelId).indexOf(timestamp)); } Slack.PinsRemoveResponse response = new Slack.PinsRemoveResponse(); response.setOk(true); return response; } ``` # Tooling API for the Apex SDK Use Tooling API for a fine-grained access to your org's metadata. For more information about Tooling API, see the [Tooling API Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling). # Understand Slack App Testing Testing is a critical part of the development process. As with Apex development, we recommend that you use a _test-driven_ development process, which is testing at the same time as code development. When working with Apex SDK for Slack, use the test harness framework to test your Slack apps. Before you can [package and distribute](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/packaging/packaging.md) a Slack app, your unit tests must cover at least 75% of your Apex code, and all of those tests must complete successfully. See [Understanding Testing in Apex](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_intro.htm). ## What to test in a Slack App The test harness is the entry point for testing Slack apps. It mocks the Apex SDK for Slack elements for running in a test environment, allowing the creation of a Slack state as needed. We recommend that you test your actions, event handlers, slash commands, shortcuts, asserting against a real representation of your views and data. These are useful concepts to understand for writing your tests. **Test Harness** The Test Harness mocks out necessary elements to run in a test environment. It allows the creation of a fresh Slack state at will. **Slack State** A mocked instance of the Slack infrastructure. Contains a default enterprise, team (workspace), channel, and user. **Slack User Session** A mock of a typical Slack Client allowing for interaction within the test harness. Contains state information for the user experience and allows simulating user interactions. **Test Components** The test components in the [`Slack.TestHarness` class](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/apex_ref/apex_ref_testharness.md) are a one to one mapping of [components](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/reference.md) to Apex objects that can invoke actions and be asserted against during a test execution. Components are created from the generated view definition. ## Considerations and Limitations Testing is not yet supported for these features. - Threaded conversations - Private conversations - User management within channels - Channel-specific features like pinned messages - User-specific features like saved messages - Use of a client directly to emulate a call out to Slack # User Permissions and Roles A Slack user is mapped to a Salesforce user via the proxy layer that connects Slack to Salesforce. The proxy layer provides authorization and org routing capabilities. When you connect a Slack app to a Salesforce org, a Slack user can perform activities and tasks that are granted to the corresponding Salesforce user. Actions in Slack apps are run in Salesforce within the user's context and follow the user's access rights. For example, an approval that's sent from Salesforce is routed directly to the approver on Slack, such as the user with the sales director role. Only this Slack user receives the message in Slack and can approve or reject the request. ## Understand Salesforce and Slack Permissions In Salesforce, you can [control who sees what](https://help.salesforce.com/s/articleView?id=platform.security_data_access.htm&type=5) by using these methods: - Permission sets and profiles for object-level security - Permission sets and profiles for field-level security - Sharing settings for record-level security Slack users don't have roles and permissions like those defined in Salesforce. However, a Slack user has a role with its own [permissions](https://slack.com/help/articles/1500012572621-Permissions-in-Slack-Connect-channels-) and access. See [Permissions by role in Slack](https://slack.com/help/articles/201314026-Permissions-by-role-in-Slack). For example, a guest role can be granted permission to send messages and upload files but it can't join a public channel. ## Create Permissions for a Slack App Admins can [create and assign permissions](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/setup-your-env.md#enable-user-permissions) in Setup on the **Permission Sets** page. However, if you're distributing your Slack app, it's useful to include a permission to simplify installation and setup for users. To grant a user access, use the [PermissionSet](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_permissionset.htm#permissionSetUserPermissions_title) metadata type and create a `MyPerms.permissionset-meta.xml` file in the `force-app/main/default/permissionsets/` directory of your project. ```ascii project |_myslackapp |_force-app/main/default/ |_ permissionsets/ |_ MyPerms.permissionset-meta.xml |_ slackapps/ |_ MySlackApp.slackapp |_ MySlackApp.slackapp-meta.xml |_package.json |_sfdx-project.json ``` In the metadata file, include the user permissions you want to assign to users. Use one `` element for each permission. ```xml false Salesforce true UserSlackCapabilities ``` **tip:** The Apex SDK sample app provides an example of defining a permission set. See [Sample Apex SDK for Slack App](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/setup-install-app.md). # ViewDefinition Represents a view definition on a Slack app. This type extends the [MetadataWithContent](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_metadatawithcontent.htm) metadata type and inherits its `content` and `fullName` fields. ## Declarative Metadata File Suffix and Directory Location The file suffix is `.view` for the view definition. The accompanying metadata file is named `YourViewName.view-meta.xml`. The files are stored in the `viewdefinitions` folder in the corresponding package directory. ## Version Slack apps are available in API version 54.0 and later. ## Special Access Rules To use this metadata type, your org must have Slack capabilities and packaging enabled. ## Fields | Field Name | Field Type | Description | | ------------- | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `apiVersion` | double | Required. A double value that binds the view definition to a Salesforce API version. | | `content` | base64Binary | The page content. Base 64-encoded binary data. Prior to making an API call, client applications must encode the binary attachment data as base64. Upon receiving a response, client applications must decode the base64 data to binary. This conversion is usually handled for you by a SOAP client. This field is inherited from the MetadataWithContent component. | | `description` | string | A description of the view definition. | | `fullName` | string | The developer name used as a unique identifier for API access. `fullName` can contain only underscores and alphanumeric characters. It must be unique, begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores. This field is inherited from the [Metadata](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/docs/atlas.en-us.api_meta.meta/api_meta/metadata.htm) component. | | `isProtected` | boolean | Indicates whether the view definition is protected (true) or not (false). If true, only this package can reference the view definition directly. | | `masterLabel` | string | Required. Name of the view definition that appears in the Salesforce user interface. | | `targetType` | ViewTargetType (enumeration of type string) | Required. Specifies where the view can be used. Valid value is slack. | ## Declarative Metadata Sample Definition This is the `hello.view-meta.xml` metadata file. ```xquery 54.0 false Hello World Slack App slack ``` Here's the corresponding `hello.view` definition. This view uses the `SlackApp` example with the slash command dispatcher. See [Define a View](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/views.md). ```yml description: "Say Hello Example" schema: properties: name: type: string required: true components: - definition: modal properties: title: "Hello {!view.properties.name}" components: - definition: section properties: text: "You just said Hello from Apex!" ``` ## Wildcard Support in the Manifest File This metadata type supports the wildcard character \* (asterisk) in the package.xml manifest file. For information about using the manifest file, see [Deploying and Retrieving Metadata with the Zip File](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/docs/atlas.en-us.api_meta.meta/api_meta/file_based_zip_file.htm). # ViewDefinition Represents a view definition on a Slack app. Includes access to the associated ViewDefinition object in the Metadata API. Available in API version 53.0 and later. ## Supported SOAP API Calls `create()`, `delete()`, `describeSObjects()`, `query()`, `retrieve()`, `update()`, `upsert()` ## Supported REST API HTTP Methods `DELETE`, `GET`, `HEAD`, `PATCH`, `POST`, `Query` ## Special Access Rules To use this object, your org must have Slack capabilities and packaging enabled. ## Fields | Field Name | Description | | :---------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `ApiVersion` | **Type**
double
**Properties**
Filter, Nillable, Sort
**Description**
The API version is automatically generated and set to the current API version when the view definition is created. | | `Content` | **Type**
textarea
**Properties**
Nillable
**Description**
A string representation of ViewDefinition that contains the definition's metadata. | | `Description` | **Type**
textarea
**Properties**
Filter, Group, Nillable, Sort
**Description**
The view definition's description. | | `DeveloperName` | **Type**
string
**Properties**
Filter, Group, Sort
**Description**
The unique name of the object in the API. This name can contain only underscores and alphanumeric characters, and must be unique in your org. It must begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores. In managed packages, this field prevents naming conflicts on package installations. With this field, a developer can change the object’s name in a managed package and the changes are reflected in a subscriber’s organization. | | `FullName` | **Type**
string
**Properties**
Create, Group, Nillable
**Description**
The full name of the associated `ViewDefinition` object in Metadata API. Query this field only if the query result contains no more than one record. Otherwise, an error is returned. If more than one record exists, use multiple queries to retrieve the records. This limit protects performance. | | `IsDeleted` | **Type**
boolean
**Properties**
Nillable
**Description**
Indicates whether the view definition is deleted (true) or not (false). | | `IsProtected` | **Type**
boolean
**Properties**
Defaulted on create, Filter, Group, Nillable, Sort
**Description**
Indicates whether the view definition is protected (true) or not (false). If true, only this package can reference the view definition directly. The default value is false. | | `Language` | **Type**
picklist
**Properties**
Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort
**Description**
The language associated with the Slack app. For example, `en_US` for English and `es` for Spanish. | | `ManageableState` | **Type**
ManageableState enumerated list
**Properties**
Filter, Group, Nillable, Restricted picklist, Sort
**Description**
Indicates the manageable state of the specified component that is contained in a package:
- beta
- deleted
- deprecated
- deprecatedEditable
- installed
- installedEditable
- released
- unmanaged | | `MasterLabel` | **Type**
picklist
**Properties**
Filter, Group, Restricted picklist,Sort
**Description**
Specifies where the view can be used. Valid value is `slack`. | # Views Compose components into views to guide users through your app's capabilities. A view is a root component that displays in a Slack surface: a home tab, message, or modal. # Work with a Slack App Client Use these Apex classes to work with a Slack app client. ## AppClient Class The `Slack.AppClient` class enables you to work with the Slack App client. **Usage** Before you can work with an app client, [get access to a Slack context](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/actions_register.md). To get access to a Slack client, use the [`Slack.App` class](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_client_access.md). ### AppClient Methods The following are methods for `AppClient`. #### appsEventAuthorizationsList(req) **Signature** ```java public Slack.AppsEventAuthorizationsListResponse appsEventAuthorizationsList( Slack.AppsEventAuthorizationsListRequest req ) ``` **Parameters** _req_ Type: [Slack.AppsEventAuthorizationsListResponse](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_apps.md#appseventauthorizationslistresponse-class) **Return Value** Type: [Slack.AppsEventAuthorizationsListResponse](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_apps.md#appseventauthorizationslistresponse-class) #### authTest(req) **Signature** ```java public Slack.AuthTestResponse authTest(Slack.AuthTestRequest req) ``` **Parameters** _req_ Type: Slack.AuthTestRequest **Return Value** Type: Slack.AuthTestResponse # Work with a Slack Bot Client Use these Apex classes to work with a Slack bot client. ## BotClient Class Provides access to a Slack Bot Client so you can perform tasks such as publishing views to the home tab or sending messages to a channel. **Usage** Before you can work with a bot client, [register the action and get access to a Slack context](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/actions_register.md). To get access to a Slack client, use the [`Slack.App` class](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_client_access.md). ```java public void run () { Slack.App app = Slack.App.MySlackApp.get(); Slack.BotClient client = app.getBotClientForTeam(context.getTeamId()); Slack.ViewReference viewReference = Slack.View.MyViewName.get(); // Get context data String channel = context.getChannelId(); // Specify your request/response objects and pass in your context data } ``` Bots are allowed to post in channels where they are members. If your app must post to a DM between two users, consider using a [user client](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_client_user.md) instead. Many Slack API methods require a token. `BotClient` automatically includes an appropriate token in your requests. For example, [ChatPostMessageRequest](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_chat.md#chatpostmessagerequest-class) calls [Slack's chat.postMessage method](https://api.slack.com/methods/chat.postMessage), which requires a token along with a few other arguments. This token is automatically included when you use `BotClient` to make a request. ### BotClient Methods The following are methods for `BotClient`. #### appsUninstall(req) **Signature** ```java public Slack.AppsUninstallResponse appsUninstall(Slack.AppsUninstallRequest req) ``` **Parameters** _req_ Type: Slack.AppsUninstallRequest **Return Value** Type: Slack.AppsUninstallResponse #### authRevoke(req) **Signature** ```java public Slack.AuthRevokeResponse authRevoke(Slack.AuthRevokeRequest req) ``` **Parameters** _req_ Type: Slack.AuthRevokeRequest **Return Value** Type: Slack.AuthRevokeResponse #### authTeamsList(req) **Signature** ```java public Slack.AuthTeamsListResponse authTeamsList(Slack.AuthTeamsListRequest req) ``` **Parameters** _req_ Type: Slack.AuthTeamsListRequest **Return Value** Type: Slack.AuthTeamsListResponse #### authTest(req) **Signature** ```java public Slack.AuthTestResponse authTest(Slack.AuthTestRequest req) ``` **Parameters** _req_ Type: Slack.AuthTestRequest **Return Value** Type: Slack.AuthTestResponse #### botsInfo(req) **Signature** ```java public Slack.BotsInfoResponse botsInfo(Slack.BotsInfoRequest req) ``` **Parameters** _req_ Type: Slack.BotsInfoRequest **Return Value** Type: Slack.BotsInfoResponse #### callsAdd(req) **Signature** ```java public Slack.CallsAddResponse callsAdd(Slack.CallsAddRequest req) ``` **Parameters** _req_ Type: Slack.CallsAddRequest **Return Value** Type: Slack.CallsAddResponse #### callsEnd(req) **Signature** ```java public Slack.CallsEndResponse callsEnd(Slack.CallsEndRequest req) ``` **Parameters** _req_ Type: Slack.CallsEndRequest **Return Value** Type: Slack.CallsEndResponse #### callsInfo(req) **Signature** ```java public Slack.CallsInfoResponse callsInfo(Slack.CallsInfoRequest req) ``` **Parameters** _req_ Type: Slack.CallsInfoRequest **Return Value** Type: Slack.CallsInfoResponse #### callsParticipantsAdd(req) **Signature** ```java public Slack.CallsParticipantsAddResponse callsParticipantsAdd(Slack.CallsParticipantsAddRequest req) ``` **Parameters** _req_ Type: Slack.CallsParticipantsAddRequest **Return Value** Type: Slack.CallsParticipantsAddResponse #### callsParticipantsRemove(req) **Signature** ```java public Slack.CallsParticipantsRemoveResponse callsParticipantsRemove(Slack.CallsParticipantsRemoveRequest req) ``` **Parameters** _req_ Type: Slack.CallsParticipantsRemoveRequest **Return Value** Type: Slack.CallsParticipantsRemoveResponse #### callsUpdate(req) **Signature** ```java public Slack.CallsUpdateResponse callsUpdate(Slack.CallsUpdateRequest req) ``` **Parameters** _req_ Type: Slack.CallsUpdateRequest **Return Value** Type: Slack.CallsUpdateResponse #### chatDelete(req) **Signature** ```java public Slack.ChatDeleteResponse chatDelete(Slack.ChatDeleteRequest req) ``` **Parameters** _req_ Type: Slack.ChatDeleteRequest **Return Value** Type: Slack.ChatDeleteResponse #### chatDeleteScheduledMessage(req) **Signature** ```java public Slack.ChatDeleteScheduledMessageResponse chatDeleteScheduledMessage( Slack.ChatDeleteScheduledMessageRequest req) ``` **Parameters** _req_ Type: Slack.ChatDeleteScheduledMessageRequest **Return Value** Type: Slack.ChatDeleteScheduledMessageResponse #### chatGetPermalink(req) **Signature** ```java public Slack.ChatGetPermalinkResponse chatGetPermalink(Slack.ChatGetPermalinkRequest req) ``` **Parameters** _req_ Type: Slack.ChatGetPermalinkRequest **Return Value** Type: Slack.ChatGetPermalinkResponse #### chatMeMessage(req) **Signature** ```java public Slack.ChatMeMessageResponse chatMeMessage(Slack.ChatMeMessageRequest req) ``` **Parameters** _req_ Type: Slack.ChatMeMessageRequest **Return Value** Type: Slack.ChatMeMessageResponse #### chatPostEphemeral(req) **Signature** ```java public Slack.ChatPostEphemeralResponse chatPostEphemeral(Slack.ChatPostEphemeralRequest req) ``` **Parameters** _req_ Type: Slack.ChatPostEphemeralRequest **Return Value** Type: Slack.ChatPostEphemeralResponse #### chatPostMessage(req) **Signature** ```java public Slack.ChatPostMessageResponse chatPostMessage(Slack.ChatPostMessageRequest req) ``` **Parameters** _req_ Type: Slack.ChatPostMessageRequest **Return Value** Type: Slack.ChatPostMessageResponse #### chatScheduleMessage(req) **Signature** ```java public Slack.ChatScheduleMessageResponse chatScheduleMessage(Slack.ChatScheduleMessageRequest req) ``` **Parameters** _req_ Type: Slack.ChatScheduleMessageRequest **Return Value** Type: Slack.ChatScheduleMessageResponse #### chatScheduledMessagesList(req) **Signature** ```java public Slack.ChatScheduledMessagesListResponse chatScheduledMessagesList(Slack.ChatScheduledMessagesListRequest req) ``` **Parameters** _req_ Type: Slack.ChatScheduledMessagesListRequest **Return Value** Type: Slack.ChatScheduledMessagesListResponse #### chatUpdate(req) **Signature** ```java public Slack.ChatUpdateResponse chatUpdate(Slack.ChatUpdateRequest req) ``` **Parameters** _req_ Type: Slack.ChatUpdateRequest **Return Value** Type: Slack.ChatUpdateResponse #### conversationsArchive(req) **Signature** ```java public Slack.ConversationsArchiveResponse conversationsArchive(Slack.ConversationsArchiveRequest req) ``` **Parameters** _req_ Type: Slack.ConversationsArchiveRequest **Return Value** Type: Slack.ConversationsArchiveResponse #### conversationsClose(req) **Signature** ```java public Slack.ConversationsCloseResponse conversationsClose(Slack.ConversationsCloseRequest req) ``` **Parameters** _req_ Type: Slack.ConversationsCloseRequest **Return Value** Type: Slack.ConversationsCloseResponse #### conversationsCreate(req) **Signature** ```java public Slack.ConversationsCreateResponse conversationsCreate(Slack.ConversationsCreateRequest req) ``` **Parameters** _req_ Type: Slack.ConversationsCreateRequest **Return Value** Type: Slack.ConversationsCreateResponse #### conversationsHistory(req) **Signature** ```java public Slack.ConversationsHistoryResponse conversationsHistory(Slack.ConversationsHistoryRequest req) ``` **Parameters** _req_ Type: Slack.ConversationsHistoryRequest **Return Value** Type: Slack.ConversationsHistoryResponse #### conversationsInfo(req) **Signature** ```java public Slack.ConversationsInfoResponse conversationsInfo(Slack.ConversationsInfoRequest req) ``` **Parameters** _req_ Type: Slack.ConversationsInfoRequest **Return Value** Type: Slack.ConversationsInfoResponse #### conversationsInvite(req) **Signature** ```java public Slack.ConversationsInviteResponse conversationsInvite(Slack.ConversationsInviteRequest req) ``` **Parameters** _req_ Type: Slack.ConversationsInviteRequest **Return Value** Type: Slack.ConversationsInviteResponse #### conversationsJoin(req) **Signature** ```java public Slack.ConversationsJoinResponse conversationsJoin(Slack.ConversationsJoinRequest req) ``` **Parameters** _req_ Type: Slack.ConversationsJoinRequest **Return Value** Type: Slack.ConversationsJoinResponse #### conversationsKick(req) **Signature** ```java public Slack.ConversationsKickResponse conversationsKick(Slack.ConversationsKickRequest req) ``` **Parameters** _req_ Type: Slack.ConversationsKickRequest **Return Value** Type: Slack.ConversationsKickResponse #### conversationsLeave(req) **Signature** ```java public Slack.ConversationsLeaveResponse conversationsLeave(Slack.ConversationsLeaveRequest req) ``` **Parameters** _req_ Type: Slack.ConversationsLeaveRequest **Return Value** Type: Slack.ConversationsLeaveResponse #### conversationsList(req) **Signature** ```java public Slack.ConversationsListResponse conversationsList(Slack.ConversationsListRequest req) ``` **Parameters** _req_ Type: Slack.ConversationsListRequest **Return Value** Type: Slack.ConversationsListResponse #### conversationsMark(req) **Signature** ```java public Slack.ConversationsMarkResponse conversationsMark(Slack.ConversationsMarkRequest req) ``` **Parameters** _req_ **Return Value** Type: Slack.ConversationsMarkResponse #### conversationsMembers(req) **Signature** ```java public Slack.ConversationsMembersResponse conversationsMembers(Slack.ConversationsMembersRequest req) ``` **Parameters** _req_ Type: Slack.ConversationsMembersRequest **Return Value** Type: Slack.ConversationsMembersResponse #### conversationsOpen(req) **Signature** ```java public Slack.ConversationsOpenResponse conversationsOpen(Slack.ConversationsOpenRequest req) ``` **Parameters** _req_ Type: Slack.ConversationsOpenRequest **Return Value** Type: Slack.ConversationsOpenResponse #### conversationsRename(req) **Signature** ```java public Slack.ConversationsRenameResponse conversationsRename(Slack.ConversationsRenameRequest req) ``` **Parameters** _req_ Type: Slack.ConversationsRenameRequest **Return Value** Type: Slack.ConversationsRenameResponse #### conversationsReplies(req) **Signature** ```java public Slack.ConversationsRepliesResponse conversationsReplies(Slack.ConversationsRepliesRequest req) ``` **Parameters** _req_ Type: Slack.ConversationsRepliesRequest **Return Value** Type: Slack.ConversationsRepliesResponse #### conversationsSetPurpose(req) **Signature** ```java public Slack.ConversationsSetPurposeResponse conversationsSetPurpose(Slack.ConversationsSetPurposeRequest req) ``` **Parameters** _req_ Type: Slack.ConversationsSetPurposeRequest **Return Value** Type: Slack.ConversationsSetPurposeResponse #### conversationsSetTopic(req) **Signature** ```java public Slack.ConversationsSetTopicResponse conversationsSetTopic(Slack.ConversationsSetTopicRequest req) ``` **Parameters** _req_ Type: Slack.ConversationsSetTopicRequest **Return Value** Type: Slack.ConversationsSetTopicResponse #### conversationsUnarchive(req) **Signature** ```java public Slack.ConversationsUnarchiveResponse conversationsUnarchive(Slack.ConversationsUnarchiveRequest req) ``` **Parameters** _req_ Type: Slack.ConversationsUnarchiveRequest **Return Value** Type: Slack.ConversationsUnarchiveResponse #### dndInfo(req) **Signature** ```java public Slack.DndInfoResponse dndInfo(Slack.DndInfoRequest req) ``` **Parameters** _req_ Type: Slack.DndInfoRequest **Return Value** Type: Slack.DndInfoResponse #### dndTeamInfo(req) **Signature** ```java public Slack.DndTeamInfoResponse dndTeamInfo(Slack.DndTeamInfoRequest req) ``` **Parameters** _req_ Type: Slack.DndTeamInfoRequest **Return Value** Type: Slack.DndTeamInfoResponse #### emojiList(req) **Signature** ```java public Slack.EmojiListResponse emojiList(Slack.EmojiListRequest req) ``` **Parameters** _req_ Type: Slack.EmojiListRequest **Return Value** Type: Slack.EmojiListResponse #### filesDelete(req) **Signature** ```java public Slack.FilesDeleteResponse filesDelete(Slack.FilesDeleteRequest req) ``` **Parameters** _req_ Type: Slack.FilesDeleteRequest **Return Value** Type: Slack.FilesDeleteResponse #### filesInfo(req) **Signature** ```java public Slack.FilesInfoResponse filesInfo(Slack.FilesInfoRequest req) ``` **Parameters** _req_ Type: Slack.FilesInfoRequest **Return Value** Type: Slack.FilesInfoResponse #### filesList(req) **Signature** ```java public Slack.FilesListResponse filesList(Slack.FilesListRequest req) ``` **Parameters** _req_ Type: Slack.FilesListRequest **Return Value** Type: Slack.FilesListResponse #### filesRemoteAdd(req) **Signature** ```java public Slack.FilesRemoteAddResponse filesRemoteAdd(Slack.FilesRemoteAddRequest req) ``` **Parameters** _req_ Type: Slack.FilesRemoteAddRequest **Return Value** Type: Slack.FilesRemoteAddResponse #### filesRemoteInfo(req) **Signature** ```java public Slack.FilesRemoteInfoResponse filesRemoteInfo(Slack.FilesRemoteInfoRequest req) ``` **Parameters** _req_ Type: Slack.FilesRemoteInfoRequest **Return Value** Type: Slack.FilesRemoteInfoResponse #### filesRemoteList(req) **Signature** ```java public Slack.FilesRemoteListResponse filesRemoteList(Slack.FilesRemoteListRequest req) ``` **Parameters** _req_ Type: Slack.FilesRemoteListRequest **Return Value** Type: Slack.FilesRemoteListResponse #### filesRemoteRemove(req) **Signature** ```java public Slack.FilesRemoteRemoveResponse filesRemoteRemove(Slack.FilesRemoteRemoveRequest req) ``` **Parameters** _req_ Type: Slack.FilesRemoteRemoveRequest **Return Value** Type: Slack.FilesRemoteRemoveResponse #### filesRemoteShare(req) **Signature** ```java public Slack.FilesRemoteShareResponse filesRemoteShare(Slack.FilesRemoteShareRequest req) ``` **Parameters** _req_ Type: Slack.FilesRemoteShareRequest **Return Value** Type: Slack.FilesRemoteShareResponse #### filesRemoteUpdate(req) **Signature** ```java public Slack.FilesRemoteUpdateResponse filesRemoteUpdate(Slack.FilesRemoteUpdateRequest req) ``` **Parameters** _req_ Type: Slack.FilesRemoteUpdateRequest #### migrationExchange(req) **Signature** ```java public Slack.MigrationExchangeResponse migrationExchange(Slack.MigrationExchangeRequest req) ``` **Parameters** _req_ Type: Slack.MigrationExchangeRequest **Return Value** Type: Slack.MigrationExchangeResponse #### pinsAdd(req) **Signature** ```java public Slack.PinsAddResponse pinsAdd(Slack.PinsAddRequest req) ``` **Parameters** _req_ Type: Slack.PinsAddRequest **Return Value** Type: Slack.PinsAddResponse #### pinsList(req) **Signature** ```java public Slack.PinsListResponse pinsList(Slack.PinsListRequest req) ``` **Parameters** _req_ Type: Slack.PinsListRequest **Return Value** Type: Slack.PinsListResponse #### pinsRemove(req) **Signature** ```java public Slack.PinsRemoveResponse pinsRemove(Slack.PinsRemoveRequest req) ``` **Parameters** _req_ Type: Slack.PinsRemoveRequest **Return Value** Type: Slack.PinsRemoveResponse #### reactionsAdd(req) **Signature** ```java public Slack.ReactionsAddResponse reactionsAdd(Slack.ReactionsAddRequest req) ``` **Parameters** _req_ Type: Slack.ReactionsAddRequest **Return Value** Type: Slack.ReactionsAddResponse #### reactionsGet(req) **Signature** ```java public Slack.ReactionsGetResponse reactionsGet(Slack.ReactionsGetRequest req) ``` **Parameters** _req_ Type: Slack.ReactionsGetRequest **Return Value** Type: Slack.ReactionsGetResponse #### reactionsList(req) **Signature** ```java public Slack.ReactionsListResponse reactionsList(Slack.ReactionsListRequest req) ``` **Parameters** _req_ Type: Slack.ReactionsListRequest **Return Value** Type: Slack.ReactionsListResponse #### reactionsRemove(req) **Signature** ```java public Slack.ReactionsRemoveResponse reactionsRemove(Slack.ReactionsRemoveRequest req) ``` **Parameters** _req_ Type: Slack.ReactionsRemoveRequest **Return Value** Type: Slack.ReactionsRemoveResponse #### starsAdd(req) **Signature** ```java public Slack.StarsAddResponse starsAdd(Slack.StarsAddRequest req) ``` **Parameters** _req_ Type: Slack.StarsAddRequest **Return Value** Type: Slack.StarsAddResponse #### teamInfo(req) **Signature** ``` public Slack.TeamInfoResponse teamInfo(Slack.TeamInfoRequest req) ``` **Parameters** _req_ Type: Slack.TeamInfoRequest **Return Value** Type: Slack.TeamInfoResponse #### teamProfileGet(req) **Signature** ```java public Slack.TeamProfileGetResponse teamProfileGet(Slack.TeamProfileGetRequest req) ``` **Parameters** _req_ Type: Slack.TeamProfileGetRequest **Return Value** Type: Slack.TeamProfileGetResponse #### usergroupsCreate(req) **Signature** ```java public Slack.UsergroupsCreateResponse usergroupsCreate(Slack.UsergroupsCreateRequest req) ``` **Parameters** _req_ Type: Slack.UsergroupsCreateRequest **Return Value** Type: Slack.UsergroupsCreateResponse #### usergroupsDisable(req) **Parameters** _req_ ```java public Slack.UsergroupsDisableResponse usergroupsDisable(Slack.UsergroupsDisableRequest req) ``` **Parameters** _req_ Type: Slack.UsergroupsDisableRequest **Return Value** Type: Slack.UsergroupsDisableResponse #### usergroupsEnable(req) **Signature** ```java public Slack.UsergroupsEnableResponse usergroupsEnable(Slack.UsergroupsEnableRequest req) ``` **Parameters** _req_ Type: Slack.UsergroupsEnableRequest **Return Value** Type: Slack.UsergroupsEnableResponse #### usergroupsList(req) **Signature** ```java public Slack.UsergroupsListResponse usergroupsList(Slack.UsergroupsListRequest req) ``` **Parameters** _req_ Type: Slack.UsergroupsListRequest **Return Value** Type: Slack.UsergroupsListResponse #### usergroupsUpdate(req) **Signature** ```java public Slack.UsergroupsUpdateResponse usergroupsUpdate(Slack.UsergroupsUpdateRequest req) ``` **Parameters** _req_ Type: Slack.UsergroupsUpdateRequest **Return Value** Type: Slack.UsergroupsUpdateResponse #### usergroupsUsersList(req) **Signature** ```java public Slack.UsergroupsUsersListResponse usergroupsUsersList(Slack.UsergroupsUsersListRequest req) ``` **Parameters** _req_ Type: Slack.UsergroupsUsersListRequest **Return Value** Type: Slack.UsergroupsUsersListResponse #### usergroupsUsersUpdate(req) **Signature** ```java public Slack.UsergroupsUsersUpdateResponse usergroupsUsersUpdate(Slack.UsergroupsUsersUpdateRequest req) ``` **Parameters** _req_ Type: Slack.UsergroupsUsersUpdateRequest **Return Value** Type: Slack.UsergroupsUsersUpdateResponse #### usersConversations(req) **Signature** ```java public Slack.UsersConversationsResponse usersConversations(Slack.UsersConversationsRequest req) ``` **Parameters** Type: Slack.UsersConversationsRequest #### usersGetPresence(req) **Signature** ```java public Slack.UsersGetPresenceResponse usersGetPresence(Slack.UsersGetPresenceRequest req) ``` **Parameters** _req_ Type: Slack.UsersGetPresenceRequest **Return Value** Type: Slack.UsersGetPresenceResponse #### usersInfo(req) **Signature** ```java public Slack.UsersInfoResponse usersInfo(Slack.UsersInfoRequest req) ``` **Return Value** Type: Slack.UsersInfoResponse #### usersList(req) **Signature** ```java public Slack.UsersListResponse usersList(Slack.UsersListRequest req) ``` **Return Value** _req_ Type: Slack.UsersListRequest #### usersLookupByEmail(req) **Signature** ```java public Slack.UsersLookupByEmailResponse usersLookupByEmail(Slack.UsersLookupByEmailRequest req) ``` **Parameters** _req_ Type: Slack.UsersLookupByEmailRequest **Return Value** Type: Slack.UsersLookupByEmailResponse #### usersProfileGet(req) **Signature** ```java public Slack.UsersProfileGetResponse usersProfileGet(Slack.UsersProfileGetRequest req) ``` **Parameters** _req_ Type: Slack.UsersProfileGetRequest **Return Value** Type: Slack.UsersProfileGetResponse #### usersSetActive(req) **Signature** ```java public Slack.UsersSetActiveResponse usersSetActive(Slack.UsersSetActiveRequest req) ``` **Parameters** _req_ Type: Slack.UsersSetActiveRequest **Return Value** Type: Slack.UsersSetActiveResponse #### usersSetPresence(req) **Signature** ```java public Slack.UsersSetPresenceResponse usersSetPresence(Slack.UsersSetPresenceRequest req) ``` **Parameters** _req_ Type: Slack.UsersSetPresenceRequest **Return Value** Type: Slack.UsersSetPresenceResponse #### viewsOpen(req) **Signature** ```java public Slack.ViewsOpenResponse viewsOpen(Slack.ViewsOpenRequest req) ``` **Parameters** _req_ Type: Slack.ViewsOpenRequest **Return Value** Type: Slack.ViewsOpenResponse #### viewsPublish(req) **Signature** ```java public Slack.ViewsPublishResponse viewsPublish(Slack.ViewsPublishRequest req) ``` **Parameters** _req_ Type: Slack.ViewsPublishRequest **Return Value** Type: Slack.ViewsPublishResponse #### viewsPush(req) **Signature** ```java public Slack.ViewsPushResponse viewsPush(Slack.ViewsPushRequest req) ``` **Parameters** _req_ Type: Slack.ViewsPushRequest **Return Value** Type: Slack.ViewsPushResponse #### viewsUpdate(req) **Signature** ```java public Slack.ViewsUpdateResponse viewsUpdate(Slack.ViewsUpdateRequest req) ``` **Parameters** _req_ Type: Slack.ViewsUpdateRequest **Return Value** Type: Slack.ViewsUpdateResponse #### workflowsStepCompleted(req) **Signature** ```java public Slack.WorkflowsStepCompletedResponse workflowsStepCompleted(Slack.WorkflowsStepCompletedRequest req) ``` **Parameters** _req_ Type: Slack.WorkflowsStepCompletedRequest **Return Value** Type: Slack.WorkflowsStepCompletedResponse #### workflowsStepFailed(req) **Signature** ```java public Slack.WorkflowsStepFailedResponse workflowsStepFailed(Slack.WorkflowsStepFailedRequest req) ``` **Parameters** _req_ Type: Slack.WorkflowsStepFailedRequest #### workflowsUpdateStep(req) **Signature** ```java public Slack.WorkflowsUpdateStepResponse workflowsUpdateStep(Slack.WorkflowsUpdateStepRequest req) ``` **Parameters** _req_ Type: Slack.WorkflowsUpdateStepRequest **Return Value** Type: Slack.WorkflowsUpdateStepResponse # Work with a Slack User Client Use these Apex classes to work with a Slack user client. ## UserClient Class Provides access to the Slack Web API with a user token to perform tasks as the associated user, such as sending messages to a channel. ### Get Started Before putting the Slack User Client to use, it’s important to note that the Slack Bot Client is the preferred alternative to confirm your app will work as expected. Don't assume that a user token exists for each user that interacts with your app, even if your app configuration defines user scopes. If you decide to use a bot client, you **can** expect a bot token to be available in the workspace where your app is installed. **Why Does This Happen?** There are multiple reasons why your workspace doesn't contain a user token for certain users. One of the reasons is that users are associated between Slack and Salesforce through a process that doesn’t involve authorizing a Slack app. Regardless of whether the app configuration includes the correct scopes, app developers can’t trust that a user mapping includes a token. For that reason, if you choose to use the User Client, verify that the user token exists. If it doesn't, write exceptions to trigger the OAuth flow between the Slack Application and the Salesforce Org. **Usage** Before you can work with a bot client, [register the action and get access to a Slack context](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/actions_register.md). To get access to a Slack client, use the [`Slack.App` class](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_client_access.md). ```java public void run () { Slack.App app = Slack.App.MySlackApp.get(); // Pass in the Slack UserId that matches the current Salesforce user Slack.UserClient userClient = app.getUserClientForTeam(context.getTeamId(), context.getUserId()); Slack.ViewReference viewReference = Slack.View.MyViewName.get(); // Specify your request/response objects } ``` Many Slack API methods require a token. `UserClient` automatically includes an appropriate token in your requests. For example, [ChatPostMessageRequest](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_chat.md#chatpostmessagerequest-class) calls [Slack's chat.postMessage method](https://api.slack.com/methods/chat.postMessage), which requires a token along with a few other arguments. This token is automatically included when you use `UserClient` to make a request. ### UserClient Methods The following are methods for `UserClient`. #### apiTest(req) **Signature** ```java public Slack.ApiTestResponse apiTest(Slack.ApiTestRequest req) ``` **Parameters** _req_ Type: Slack.ApiTestRequest **Return Value** Type: Slack.ApiTestResponse #### appsEventAuthorizationsList(req) **Signature** ```java public Slack.AppsEventAuthorizationsListResponse appsEventAuthorizationsList(Slack.AppsEventAuthorizationsListRequest req) ``` **Parameters** _req_ Type: Slack.AppsEventAuthorizationsListRequest **Return Value** Type: Slack.AppsEventAuthorizationsListResponse #### appsUninstall(req) **Signature** ```java public Slack.AppsUninstallResponse appsUninstall(Slack.AppsUninstallRequest req) ``` **Parameters** _req_ Type: Slack.AppsUninstallRequest **Return Value** Type: Slack.AppsUninstallResponse #### authRevoke(req) **Signature** ```java public Slack.AuthRevokeResponse authRevoke(Slack.AuthRevokeRequest req) ``` **Parameters** _req_ Type: Slack.AuthRevokeRequest **Return Value** Type: Slack.AuthRevokeResponse #### authTeamsList(req) **Signature** ```java public Slack.AuthTeamsListResponse authTeamsList(Slack.AuthTeamsListRequest req) ``` **Parameters** _req_ Type: Slack.AuthTeamsListRequest **Return Value** Type: Slack.AuthTeamsListResponse #### authTest(req) **Signature** ```java public Slack.AuthTestResponse authTest(Slack.AuthTestRequest req) ``` **Parameters** _req_ Type: Slack.AuthTestRequest **Return Value** Type: Slack.AuthTestResponse #### botsInfo(req) **Signature** ```java public Slack.BotsInfoResponse botsInfo(Slack.BotsInfoRequest req) ``` **Parameters** _req_ Type: Slack.BotsInfoRequest **Return Value** Type: Slack.BotsInfoResponse #### callsAdd(req) **Signature** ```java public Slack.CallsAddResponse callsAdd(Slack.CallsAddRequest req) ``` **Parameters** _req_ Type: Slack.CallsAddRequest **Return Value** Type: Slack.CallsAddResponse #### callsEnd(req) **Signature** ```java public Slack.CallsEndResponse callsEnd(Slack.CallsEndRequest req) ``` **Parameters** _req_ Type: Slack.CallsEndRequest **Return Value** Type: Slack.CallsEndResponse #### callsInfo(req) **Signature** ```java public Slack.CallsInfoResponse callsInfo(Slack.CallsInfoRequest req) ``` **Parameters** _req_ Type: Slack.CallsInfoRequest **Return Value** Type: Slack.CallsInfoResponse #### callsParticipantsAdd(req) **Signature** ```java public Slack.CallsParticipantsAddResponse callsParticipantsAdd(Slack.CallsParticipantsAddRequest req) ``` **Parameters** _req_ Type: Slack.CallsParticipantsAddRequest **Return Value** Type: Slack.CallsParticipantsAddResponse #### callsParticipantsRemove(req) **Signature** ```java public Slack.CallsParticipantsRemoveResponse callsParticipantsRemove(Slack.CallsParticipantsRemoveRequest req) ``` **Parameters** _req_ Type: Slack.CallsParticipantsRemoveRequest **Return Value** Type: Slack.CallsParticipantsRemoveResponse #### callsUpdate(req) **Signature** ```java public Slack.CallsUpdateResponse callsUpdate(Slack.CallsUpdateRequest req) ``` **Parameters** _req_ Type: Slack.CallsUpdateRequest **Return Value** Type: Slack.CallsUpdateResponse #### chatDelete(req) **Signature** ```java public Slack.ChatDeleteResponse chatDelete(Slack.ChatDeleteRequest req) ``` **Parameters** _req_ Type: Slack.ChatDeleteRequest **Return Value** Type: Slack.ChatDeleteResponse #### chatDeleteScheduledMessage(req) **Signature** ```java public Slack.ChatDeleteScheduledMessageResponse chatDeleteScheduledMessage(Slack.ChatDeleteScheduledMessageRequest req) ``` **Parameters** _req_ Type: Slack.ChatDeleteScheduledMessageRequest **Return Value** Type: Slack.ChatDeleteScheduledMessageResponse #### chatGetPermalink(req) **Signature** ```java public Slack.ChatGetPermalinkResponse chatGetPermalink(Slack.ChatGetPermalinkRequest req) ``` **Parameters** _req_ Type: Slack.ChatGetPermalinkRequest **Return Value** Type: Slack.ChatGetPermalinkResponse #### chatMeMessage(req) **Signature** ```java public Slack.ChatMeMessageResponse chatMeMessage(Slack.ChatMeMessageRequest req) ``` **Parameters** _req_ Type: Slack.ChatMeMessageRequest **Return Value** Type: Slack.ChatMeMessageResponse #### chatPostEphemeral(req) **Signature** ```java public Slack.ChatPostEphemeralResponse chatPostEphemeral(Slack.ChatPostEphemeralRequest req) ``` **Parameters** _req_ Type: Slack.ChatPostEphemeralRequest **Return Value** Type: Slack.ChatPostEphemeralResponse #### chatPostMessage(req) **Signature** ```java public Slack.ChatPostMessageResponse chatPostMessage(Slack.ChatPostMessageRequest req) ``` **Parameters** _req_ Type: Slack.ChatPostMessageRequest **Return Value** Type: Slack.ChatPostMessageResponse #### chatScheduleMessage(req) **Signature** ```java public Slack.ChatScheduleMessageResponse chatScheduleMessage( Slack.ChatScheduleMessageRequest req) ``` **Parameters** _req_ Type: Slack.ChatScheduleMessageRequest **Return Value** Type: Slack.ChatScheduleMessageResponse #### chatScheduledMessagesList(req) **Signature** ```java public Slack.ChatScheduledMessagesListResponse chatScheduledMessagesList( Slack.ChatScheduledMessagesListRequest req) ``` **Parameters** _req_ Type: Slack.ChatScheduledMessagesListRequest **Return Value** Type: Slack.ChatScheduledMessagesListResponse #### chatUpdate(req) **Signature** ```java public Slack.ChatUpdateResponse chatUpdate(Slack.ChatUpdateRequest req) ``` **Parameters** _req_ Type: Slack.ChatUpdateRequest **Return Value** Type: Slack.ChatUpdateResponse #### conversationsArchive(req) **Signature** ```java public Slack.ConversationsArchiveResponse conversationsArchive( Slack.ConversationsArchiveRequest req) ``` **Parameters** _req_ Type: Slack.ConversationsArchiveRequest **Return Value** Type: Slack.ConversationsArchiveResponse #### conversationsClose(req) **Signature** ```java public Slack.ConversationsCloseResponse conversationsClose( Slack.ConversationsCloseRequest req) ``` **Parameters** _req_ Type: Slack.ConversationsCloseRequest **Return Value** Type: Slack.ConversationsCloseResponse #### conversationsCreate(req) **Signature** ```java public Slack.ConversationsCreateResponse conversationsCreate( Slack.ConversationsCreateRequest req) ``` **Parameters** _req_ Type: Slack.ConversationsCreateRequest **Return Value** Type: Slack.ConversationsCreateResponse #### conversationsHistory(req) **Signature** ```java public Slack.ConversationsHistoryResponse conversationsHistory( Slack.ConversationsHistoryRequest req) ``` **Parameters** _req_ Type: Slack.ConversationsHistoryRequest **Return Value** Type: Slack.ConversationsHistoryResponse #### conversationsInfo(req) **Signature** ```java public Slack.ConversationsInfoResponse conversationsInfo(Slack.ConversationsInfoRequest req) ``` **Parameters** _req_ Type: Slack.ConversationsInfoRequest **Return Value** Type: Slack.ConversationsInfoResponse #### conversationsInvite(req) **Signature** ```java public Slack.ConversationsInviteResponse conversationsInvite( Slack.ConversationsInviteRequest req) ``` **Parameters** _req_ Type: Slack.ConversationsInviteRequest **Return Value** Type: Slack.ConversationsInviteResponse #### conversationsJoin(req) **Signature** ```java public Slack.ConversationsJoinResponse conversationsJoin( Slack.ConversationsJoinRequest req) ``` **Parameters** _req_ Type: Slack.ConversationsJoinRequest **Return Value** Type: Slack.ConversationsJoinResponse #### conversationsKick(req) **Signature** ```java public Slack.ConversationsKickResponse conversationsKick( Slack.ConversationsKickRequest req) ``` **Parameters** _req_ Type: Slack.ConversationsKickRequest **Return Value** Type: Slack.ConversationsKickResponse #### conversationsLeave(req) **Signature** public Slack.ConversationsLeaveResponse conversationsLeave(Slack.ConversationsLeaveRequest req) **Parameters** _req_ Type: Slack.ConversationsLeaveRequest **Return Value** Type: Slack.ConversationsLeaveResponse #### conversationsList(req) **Signature** ```java public Slack.ConversationsListResponse conversationsList(Slack.ConversationsListRequest req) ``` **Parameters** _req_ Type: Slack.ConversationsListRequest **Return Value** Type: Slack.ConversationsListResponse #### conversationsMark(req) **Signature** ```java public Slack.ConversationsMarkResponse conversationsMark(Slack.ConversationsMarkRequest req) ``` **Parameters** _req_ Type: Slack.ConversationsMarkRequest **Return Value** Type: Slack.ConversationsMarkResponse #### conversationsMembers(req) **Signature** ```java public Slack.ConversationsMembersResponse conversationsMembers( Slack.ConversationsMembersRequest req) ``` **Parameters** _req_ Type: Slack.ConversationsMembersRequest **Return Value** Type: Slack.ConversationsMembersResponse #### conversationsOpen(req) **Signature** ```java public Slack.ConversationsOpenResponse conversationsOpen(Slack.ConversationsOpenRequest req) ``` **Parameters** _req_ Type: Slack.ConversationsOpenRequest **Return Value** Type: Slack.ConversationsOpenResponse #### conversationsRename(req) **Signature** ```java public Slack.ConversationsRenameResponse conversationsRename( Slack.ConversationsRenameRequest req) ``` **Parameters** _req_ Type: Slack.ConversationsRenameRequest **Return Value** Type: Slack.ConversationsRenameResponse #### conversationsReplies(req) **Signature** ```java public Slack.ConversationsRepliesResponse conversationsReplies(Slack.ConversationsRepliesRequest req) ``` **Parameters** _req_ Type: Slack.ConversationsRepliesRequest **Return Value** Type: Slack.ConversationsRepliesResponse #### conversationsSetPurpose(req) **Signature** ```java public Slack.ConversationsSetPurposeResponse conversationsSetPurpose( Slack.ConversationsSetPurposeRequest req) ``` **Parameters** _req_ Type: Slack.ConversationsSetPurposeRequest **Return Value** Type: Slack.ConversationsSetPurposeResponse #### conversationsSetTopic(req) **Signature** ```java public Slack.ConversationsSetTopicResponse conversationsSetTopic( Slack.ConversationsSetTopicRequest req) ``` **Parameters** _req_ Type: Slack.ConversationsSetTopicRequest **Return Value** Type: Slack.ConversationsSetTopicResponse #### conversationsUnarchive(req) **Signature** ```java public Slack.ConversationsUnarchiveResponse conversationsUnarchive( Slack.ConversationsUnarchiveRequest req) ``` **Parameters** _req_ Type: Slack.ConversationsUnarchiveRequest **Return Value** Type: Slack.ConversationsUnarchiveResponse #### dndEndDnd(req) **Signature** ```java public Slack.DndEndDndResponse dndEndDnd(Slack.DndEndDndRequest req) ``` **Parameters** _req_ Type: Slack.DndEndDndRequest **Return Value** Type: Slack.DndEndDndResponse #### dndEndSnooze(req) **Signature** ```java public Slack.DndEndSnoozeResponse dndEndSnooze(Slack.DndEndSnoozeRequest req) ``` **Parameters** _req_ Type: Slack.DndEndSnoozeRequest **Return Value** Type: Slack.DndEndSnoozeResponse #### dndInfo(req) **Signature** ```java public Slack.DndInfoResponse dndInfo(Slack.DndInfoRequest req) ``` **Parameters** _req_ Type: Slack.DndInfoRequest **Return Value** Type: Slack.DndInfoResponse #### dndSetSnooze(req) **Signature** ```java public Slack.DndSetSnoozeResponse dndSetSnooze(Slack.DndSetSnoozeRequest req) ``` **Parameters** _req_ Type: Slack.DndSetSnoozeRequest **Return Value** Type: Slack.DndSetSnoozeResponse #### dndTeamInfo(req) **Signature** ```java public Slack.DndTeamInfoResponse dndTeamInfo(Slack.DndTeamInfoRequest req) ``` **Parameters** _req_ Type: Slack.DndTeamInfoRequest **Return Value** Type: Slack.DndTeamInfoResponse #### emojiList(req) **Signature** ```java public Slack.EmojiListResponse emojiList(Slack.EmojiListRequest req) ``` **Parameters** _req_ Type: Slack.EmojiListRequest **Return Value** Type: Slack.EmojiListResponse #### filesDelete(req) **Signature** ```java public Slack.FilesDeleteResponse filesDelete(Slack.FilesDeleteRequest req) ``` **Parameters** _req_ Type: Slack.FilesDeleteRequest **Return Value** Type: Slack.FilesDeleteResponse #### filesInfo(req) **Signature** ```java public Slack.FilesInfoResponse filesInfo(Slack.FilesInfoRequest req) ``` **Parameters** _req_ Type: Slack.FilesInfoRequest **Return Value** Type: Slack.FilesInfoResponse #### filesList(req) **Signature** ```java public Slack.FilesListResponse filesList(Slack.FilesListRequest req) ``` **Parameters** _req_ Type: Slack.FilesListRequest **Return Value** Type: Slack.FilesListResponse #### filesRemoteInfo(req) **Signature** ```java public Slack.FilesRemoteInfoResponse filesRemoteInfo(Slack.FilesRemoteInfoRequest req) ``` **Parameters** _req_ Type: Slack.FilesRemoteInfoRequest **Return Value** Type: Slack.FilesRemoteInfoResponse #### filesRemoteList(req) **Signature** ```java public Slack.FilesRemoteListResponse filesRemoteList(Slack.FilesRemoteListRequest req) ``` **Parameters** _req_ Type: Slack.FilesRemoteListRequest **Return Value** Type: Slack.FilesRemoteListResponse #### filesRemoteShare(req) **Signature** ```java public Slack.FilesRemoteShareResponse filesRemoteShare(Slack.FilesRemoteShareRequest req) ``` **Parameters** _req_ Type: Slack.FilesRemoteShareRequest **Return Value** Type: Slack.FilesRemoteShareResponse #### filesRevokePublicURL(req) **Signature** ```java public Slack.FilesRevokePublicURLResponse filesRevokePublicURL( Slack.FilesRevokePublicURLRequest req) ``` **Parameters** _req_ Type: Slack.FilesRevokePublicURLRequest **Return Value** Type: Slack.FilesRevokePublicURLResponse #### filesSharedPublicURL(req) **Signature** ```java public Slack.FilesSharedPublicURLResponse filesSharedPublicURL( Slack.FilesSharedPublicURLRequest req) ``` **Parameters** _req_ Type: Slack.FilesSharedPublicURLRequest **Return Value** Type: Slack.FilesSharedPublicURLResponse #### filesUpload(req) **Signature** ```java public Slack.FilesUploadResponse filesUpload(Slack.FilesUploadRequest req) ``` **Parameters** _req_ Type: Slack.FilesUploadRequest **Return Value** Type: Slack.FilesUploadResponse #### getErrors() **Signature** ```java public List getErrors() ``` **Return Value** Type: List\ #### migrationExchange(req) **Signature** ```java public Slack.MigrationExchangeResponse migrationExchange(Slack.MigrationExchangeRequest req) ``` **Parameters** _req_ Type: Slack.MigrationExchangeRequest **Return Value** Type: Slack.MigrationExchangeResponse #### pinsAdd(req) **Signature** ```java public Slack.PinsAddResponse pinsAdd(Slack.PinsAddRequest req) ``` **Parameters** _req_ Type: Slack.PinsAddRequest #### pinsList(req) **Signature** ```java public Slack.PinsListResponse pinsList(Slack.PinsListRequest req) ``` **Parameters** _req_ Type: Slack.PinsListRequest **Return Value** Type: Slack.PinsListResponse #### pinsRemove(req) **Signature** ```java public Slack.PinsRemoveResponse pinsRemove(Slack.PinsRemoveRequest req) ``` **Parameters** _req_ Type: Slack.PinsRemoveRequest **Return Value** Type: Slack.PinsRemoveResponse #### reactionsAdd(req) **Signature** ```java public Slack.ReactionsAddResponse reactionsAdd(Slack.ReactionsAddRequest req) ``` **Parameters** _req_ Type: Slack.ReactionsAddRequest **Return Value** Type: Slack.ReactionsAddResponse #### reactionsGet(req) **Signature** ```java public Slack.ReactionsGetResponse reactionsGet(Slack.ReactionsGetRequest req) ``` **Parameters** _req_ Type: Slack.ReactionsGetRequest **Return Value** Type: Slack.ReactionsGetResponse #### reactionsList(req) **Signature** ```java public Slack.ReactionsListResponse reactionsList(Slack.ReactionsListRequest req) ``` **Parameters** _req_ Type: Slack.ReactionsListRequest **Return Value** Type: Slack.ReactionsListResponse #### reactionsRemove(req) **Signature** ```java public Slack.ReactionsRemoveResponse reactionsRemove(Slack.ReactionsRemoveRequest req) ``` **Parameters** _req_ Type: Slack.ReactionsRemoveRequest **Return Value** Type: Slack.ReactionsRemoveResponse #### remindersAdd(req) **Signature** ```java public Slack.RemindersAddResponse remindersAdd(Slack.RemindersAddRequest req) ``` **Parameters** _req_ Type: Slack.RemindersAddRequest **Return Value** Type: Slack.RemindersAddResponse #### remindersComplete(req) **Signature** ```java public Slack.RemindersCompleteResponse remindersComplete(Slack.RemindersCompleteRequest req) ``` **Parameters** _req_ Type: Slack.RemindersCompleteRequest **Return Value** Type: Slack.RemindersCompleteResponse #### remindersDelete(req) **Signature** ```java public Slack.RemindersDeleteResponse remindersDelete(Slack.RemindersDeleteRequest req) ``` **Parameters** _req_ Type: Slack.RemindersDeleteRequest **Return Value** Type: Slack.RemindersDeleteResponse #### remindersInfo(req) **Signature** ```java public Slack.RemindersInfoResponse remindersInfo(Slack.RemindersInfoRequest req) ``` **Parameters** _req_ Type: Slack.RemindersInfoRequest **Return Value** Type: Slack.RemindersInfoResponse #### remindersList(req) **Signature** ```java public Slack.RemindersListResponse remindersList(Slack.RemindersListRequest req) ``` **Parameters** _req_ Type: Slack.RemindersListRequest **Return Value** Type: Slack.RemindersListResponse #### searchAll(req) **Signature** ```java public Slack.SearchAllResponse searchAll(Slack.SearchAllRequest req) ``` **Parameters** _req_ Type: Slack.SearchAllRequest **Return Value** Type: Slack.SearchAllResponse #### searchFiles(req) **Signature** ```java public Slack.SearchFilesResponse searchFiles(Slack.SearchFilesRequest req) ``` **Parameters** _req_ Type: Slack.SearchFilesRequest **Return Value** Type: Slack.SearchFilesResponse #### searchMessages(req) **Signature** ```java public Slack.SearchMessagesResponse searchMessages(Slack.SearchMessagesRequest req) ``` **Parameters** _req_ Type: Slack.SearchMessagesRequest **Return Value** Type: Slack.SearchMessagesResponse #### starsAdd(req) **Signature** ```java public Slack.StarsAddResponse starsAdd(Slack.StarsAddRequest req) ``` **Parameters** _req_ Type: Slack.StarsAddRequest **Return Value** Type: Slack.StarsAddResponse #### starsList(req) **Signature** ```java public Slack.StarsListResponse starsList(Slack.StarsListRequest req) ``` **Parameters** _req_ Type: Slack.StarsListRequest **Return Value** Type: Slack.StarsListResponse #### starsRemove(req) **Signature** ```java public Slack.StarsRemoveResponse starsRemove(Slack.StarsRemoveRequest req) ``` **Parameters** _req_ Type: Slack.StarsRemoveRequest **Return Value** Type: Slack.StarsRemoveResponse #### teamAccessLogs(req) **Signature** ```java public Slack.TeamAccessLogsResponse teamAccessLogs(Slack.TeamAccessLogsRequest req) ``` **Parameters** _req_ Type: Slack.TeamAccessLogsRequest **Return Value** Type: Slack.TeamAccessLogsResponse #### teamBillableInfo(req) **Signature** ```java public Slack.TeamBillableInfoResponse teamBillableInfo(Slack.TeamBillableInfoRequest req) ``` **Parameters** _req_ Type: Slack.TeamBillableInfoRequest **Return Value** Type: Slack.TeamBillableInfoResponse #### teamInfo(req) **Signature** ```java public Slack.TeamInfoResponse teamInfo(Slack.TeamInfoRequest req) ``` **Parameters** _req_ Type: Slack.TeamInfoRequest **Return Value** Type: Slack.TeamInfoResponse #### teamIntegrationLogs(req) **Signature** ```java public Slack.TeamIntegrationLogsResponse teamIntegrationLogs(Slack.TeamIntegrationLogsRequest req) ``` **Parameters** _req_ Type: Slack.TeamIntegrationLogsRequest **Return Value** Type: Slack.TeamIntegrationLogsResponse #### teamProfileGet(req) **Signature** ```java public Slack.TeamProfileGetResponse teamProfileGet(Slack.TeamProfileGetRequest req) ``` **Parameters** _req_ Type: Slack.TeamProfileGetRequest **Return Value** Type: Slack.TeamProfileGetResponse #### usergroupsCreate(req) **Signature** ```java public Slack.UsergroupsCreateResponse usergroupsCreate(Slack.UsergroupsCreateRequest req) ``` **Parameters** _req_ Type: Slack.UsergroupsCreateRequest **Return Value** Type: Slack.UsergroupsCreateResponse #### usergroupsDisable(req) **Signature** ```java public Slack.UsergroupsDisableResponse usergroupsDisable(Slack.UsergroupsDisableRequest req) ``` **Parameters** _req_ Type: Slack.UsergroupsDisableRequest **Return Value** Type: Slack.UsergroupsDisableResponse #### usergroupsEnable(req) **Signature** ```java public Slack.UsergroupsEnableResponse usergroupsEnable(Slack.UsergroupsEnableRequest req) ``` **Parameters** _req_ Type: Slack.UsergroupsEnableRequest **Return Value** Type: Slack.UsergroupsEnableResponse #### usergroupsList(req) **Signature** ```java public Slack.UsergroupsListResponse usergroupsList(Slack.UsergroupsListRequest req) ``` **Return Value** Type: Slack.UsergroupsListResponse #### usergroupsUpdate(req) **Signature** ```java public Slack.UsergroupsUpdateResponse usergroupsUpdate(Slack.UsergroupsUpdateRequest req) ``` **Parameters** _req_ Type: Slack.UsergroupsUpdateRequest **Return Value** Type: Slack.UsergroupsUpdateResponse #### usergroupsUsersList(req) **Signature** ```java public Slack.UsergroupsUsersListResponse usergroupsUsersList( Slack.UsergroupsUsersListRequest req ) ``` **Parameters** _req_ Type: Slack.UsergroupsUsersListRequest **Return Value** Type: Slack.UsergroupsUsersListResponse #### usergroupsUsersUpdate(req) **Signature** ```java public Slack.UsergroupsUsersUpdateResponse usergroupsUsersUpdate( Slack.UsergroupsUsersUpdateRequest req) ``` **Parameters** _req_ Type: Slack.UsergroupsUsersUpdateRequest **Return Value** Type: Slack.UsergroupsUsersUpdateResponse #### usersConversations(req) **Signature** ```java public Slack.UsersConversationsResponse usersConversations( Slack.UsersConversationsRequest req ) ``` **Parameters** _req_ Type: Slack.UsersConversationsRequest **Return Value** Type: Slack.UsersConversationsResponse #### usersDeletePhoto(req) **Signature** ```java public Slack.UsersDeletePhotoResponse usersDeletePhoto(Slack.UsersDeletePhotoRequest req) ``` **Parameters** _req_ Type: Slack.UsersDeletePhotoRequest **Return Value** Type: Slack.UsersDeletePhotoResponse #### usersGetPresence(req) **Signature** ```java public Slack.UsersGetPresenceResponse usersGetPresence(Slack.UsersGetPresenceRequest req) ``` **Parameters** _req_ Type: Slack.UsersGetPresenceRequest **Return Value** Type: Slack.UsersGetPresenceResponse #### usersIdentity(req) **Signature** ```java public Slack.UsersIdentityResponse usersIdentity(Slack.UsersIdentityRequest req) ``` **Parameters** _req_ Type: Slack.UsersIdentityRequest **Return Value** Type: Slack.UsersIdentityResponse #### usersInfo(req) **Signature** ```java public Slack.UsersInfoResponse usersInfo(Slack.UsersInfoRequest req) ``` **Parameters** _req_ Type: Slack.UsersInfoRequest **Return Value** Type: Slack.UsersInfoResponse #### usersList(req) **Signature** ```java public Slack.UsersListResponse usersList(Slack.UsersListRequest req) ``` **Parameters** _req_ Type: Slack.UsersListRequest **Return Value** Type: Slack.UsersListResponse #### usersLookupByEmail(req) **Signature** ```java public Slack.UsersLookupByEmailResponse usersLookupByEmail( Slack.UsersLookupByEmailRequest req) ``` **Parameters** _req_ Type: Slack.UsersLookupByEmailRequest **Return Value** Type: Slack.UsersLookupByEmailResponse #### usersProfileGet(req) **Signature** ```java public Slack.UsersProfileGetResponse usersProfileGet(Slack.UsersProfileGetRequest req) ``` **Parameters** _req_ Type: Slack.UsersProfileGetRequest **Return Value** Type: Slack.UsersProfileGetResponse #### usersProfileSet(req) **Signature** ```java public Slack.UsersProfileSetResponse usersProfileSet(Slack.UsersProfileSetRequest req) ``` **Parameters** _req_ Type: Slack.UsersProfileSetRequest **Return Value** Type: Slack.UsersProfileSetResponse #### usersSetActive(req) **Signature** ```java public Slack.UsersSetActiveResponse usersSetActive(Slack.UsersSetActiveRequest req) ``` **Parameters** _req_ Type: Slack.UsersSetActiveRequest **Return Value** Type: Slack.UsersSetActiveResponse #### usersSetPresence(req) **Signature** ```java public Slack.UsersSetPresenceResponse usersSetPresence(Slack.UsersSetPresenceRequest req) ``` **Parameters** _req_ Type: Slack.UsersSetPresenceRequest **Return Value** Type: Slack.UsersSetPresenceResponse #### viewsOpen(req) **Signature** ```java public Slack.ViewsOpenResponse viewsOpen(Slack.ViewsOpenRequest req) ``` **Parameters** _req_ Type: Slack.ViewsOpenRequest **Return Value** Type: Slack.ViewsOpenResponse #### viewsPush(req) **Signature** ```java public Slack.ViewsPushResponse viewsPush(Slack.ViewsPushRequest req) ``` **Parameters** _req_ Type: Slack.ViewsPushRequest **Return Value** Type: Slack.ViewsPushResponse #### viewsUpdate(req) **Signature** ```java public Slack.ViewsUpdateResponse viewsUpdate(Slack.ViewsUpdateRequest req) ``` **Parameters** _req_ Type: Slack.ViewsUpdateRequest **Return Value** Type: Slack.ViewsUpdateResponse # Work with Action Result ## ActionResult Class ### error(\_exception, errorReport) **Signature** ```java public static Slack.ActionResult error(Exception _exception, Slack.ErrorReport errorReport) ``` **Parameters** _exception_ Type: Exception _errorReport_ Type: Slack.ErrorReport **Return Value** Type: Slack.ActionResult ### error(\_exception) **Signature** ```java public static Slack.ActionResult error(Exception _exception) ``` **Parameters** _exception_ Type: Exception **Return Value** Type: Slack.ActionResult ### getException() **Signature** ```java public Exception getException() ``` **Return Value** Type: Exception ### isOk() **Signature** ```java public Boolean isOk() ``` **Return Value** Type: Boolean ### ok() **Signature** ```java public static Slack.ActionResult ok() ``` **Return Value** Type: Slack.ActionResult # Work with App Requests The following are Apex classes to work with an app request. ## AppIcons Class Represents an app icon image in different sizes. ### AppIcons Methods The following are methods for `AppIcons`. #### getImage32() Gets the URL of the image in 32px by 32px size. **Signature** ```java public String getImage32() ``` **Return Value** Type: String #### getImage36() Gets the URL of the image in 36px by 36px size. **Signature** ```java public String getImage36() ``` **Return Value** Type: String #### getImage48() Gets the URL of the image in 48px by 48px size. **Signature** ```java public String getImage48() ``` **Return Value** Type: String #### getImage64() Gets the URL of the image in 64px by 64px size. **Signature** ```java public String getImage64() ``` **Return Value** Type: String #### getImage72() Gets the URL of the image in 72px by 72px size. **Signature** ```java public String getImage72() ``` **Return Value** Type: String #### getImage96() **Signature** Gets the URL of the image in 96px by 96px size. ```java public String getImage96() ``` **Return Value** Type: String #### getImage128() Gets the URL of the image in 128px by 128px size. **Signature** ```java public String getImage128() ``` **Return Value** Type: String #### getImage192() Gets the URL of the image in 192px by 192px size. **Signature** ```java public String getImage192() ``` **Return Value** Type: String #### getImage512() Gets the URL of the image in 512px by 512px size. **Signature** ```java public String getImage512() ``` **Return Value** Type: String #### getImage1024() Gets the URL of the image in 1024px by 1024px size. **Signature** ```java public String getImage1024() ``` **Return Value** Type: String #### getImageOriginal() Gets the URL of the original image. **Signature** ```java public String getImageOriginal() ``` **Return Value** Type: String #### setImage32(image32) Sets the URL of the image in 32px by 32px size. **Signature** ```java public void setImage32(String image32) ``` **Parameters** _image32_ Type: String **Return Value** Type: void #### setImage36(image36) Sets the URL of the image in 36px by 36px size. **Signature** ```java public void setImage36(String image36) ``` **Parameters** _image36_ Type: String **Return Value** Type: void #### setImage48(image48) Sets the URL of the image in 48px by 48px size. **Signature** ```java public void setImage48(String image48) ``` **Parameters** _image48_ Type: String **Return Value** Type: void #### setImage64(image64) Sets the URL of the image in 64px by 64px size. **Signature** ```java public void setImage64(String image64) ``` **Parameters** _image64_ Type: String **Return Value** Type: void #### setImage72(image72) Sets the URL of the image in 72px by 72px size. **Signature** ```java public void setImage72(String image72) ``` **Parameters** _image72_ Type: String **Return Value** Type: void #### setImage96(image96) Sets the URL of the image in 96px by 96px size. **Signature** ```java public void setImage96(String image96) ``` **Parameters** _image96_ Type: String **Return Value** Type: void #### setImage128(image128) Sets the URL of the image in 128px by 128px size. **Signature** ```java public void setImage128(String image128) ``` **Parameters** _image128_ Type: String **Return Value** Type: void #### setImage192(image192) Sets the URL of the image in 192px by 192px size. **Signature** ```java public void setImage192(String image192) ``` **Parameters** _image192_ Type: String **Return Value** Type: void #### setImage512(image512) Sets the URL of the image in 512px by 512px size. **Signature** ```java public void setImage512(String image512) ``` **Parameters** _image512_ Type: String **Return Value** Type: void #### setImage1024(image1024) Sets the URL of the image in 1024px by 1024px size. **Signature** ```java public void setImage1024(String image1024) ``` **Parameters** _image1024_ Type: String **Return Value** Type: void #### setImageOriginal(imageOriginal) **Signature** ```java public void setImageOriginal(String imageOriginal) ``` **Parameters** _imageOriginal_ Type: String **Return Value** Type: void --- ## AppRequest Class Represents an app request. ### AppRequest Methods The following are methods for `AppRequest`. #### getApp() **Signature** ```java public Slack.RequestedApp getApp() ``` **Return Value** Type: [Slack.RequestedApp](#requestedapp-class) #### getDateCreated() **Signature** ```java public Integer getDateCreated() ``` **Return Value** Type: Integer #### getId() **Signature** ```java public String getId() ``` **Return Value** Type: String #### getIsUserAppCollaborator() **Signature** ```java public Boolean getIsUserAppCollaborator() ``` **Return Value** Type: Boolean #### getMessage() **Signature** ```java public String getMessage() ``` **Return Value** Type: String #### getPreviousResolution() **Signature** ```java public Slack.AppRequest.PreviousResolution getPreviousResolution() ``` **Return Value** Type: Slack.AppRequest.PreviousResolution #### getScopes() **Signature** ```java public List getScopes() ``` **Return Value** Type: List<[Slack.AppScope](#appscope-class)> #### getTeam() **Signature** ```java public Slack.AppRequest.Team getTeam() ``` **Return Value** Type: Slack.AppRequest.Team #### getUser() **Signature** ```java public Slack.AppRequest.User getUser() ``` **Return Value** Type: Slack.AppRequest.User #### setApp(app) **Signature** ```java public void setApp(Slack.RequestedApp app) ``` **Parameters** _app_ Type: [Slack.RequestedApp](#requestedapp-class) **Return Value** Type: void #### setDateCreated(dateCreated) **Signature** ```java public void setDateCreated(Integer dateCreated) ``` **Parameters** _dateCreated_ Type: Integer **Return Value** Type: void #### setId(id) **Signature** ```java public void setId(String id) ``` **Parameters** _id_ Type: String **Return Value** Type: void #### setIsUserAppCollaborator(isUserAppCollaborator) **Signature** ```java public void setIsUserAppCollaborator(Boolean isUserAppCollaborator) ``` **Parameters** _isUserAppCollaborator_ Type: Boolean **Return Value** Type: void #### setMessage(message) **Signature** ```java public void setMessage(String message) ``` **Parameters** _message_ Type: String **Return Value** Type: void #### setPreviousResolution(previousResolution) **Signature** ```java public void setPreviousResolution(Slack.AppRequest.PreviousResolution previousResolution) ``` **Parameters** _previousResolution_ Type: Slack.AppRequest.PreviousResolution **Return Value** Type: void #### setScopes(scopes) **Signature** ```java public void setScopes(List scopes) ``` **Parameters** _scopes_ Type: List<[Slack.AppScope](#appscope-class)> **Return Value** Type: void #### setTeam(team) **Signature** ```java public void setTeam(Slack.AppRequest.Team team) ``` **Parameters** _team_ Type: Slack.AppRequest.Team **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(Slack.AppRequest.User user) ``` **Parameters** _user_ Type: Slack.AppRequest.User **Return Value** Type: void --- ## AppRequest.PreviousResolution Class ### AppRequest.PreviousResolution Methods The following are methods for `AppRequest.PreviousResolution`. #### getScopes() **Signature** ```java public List getScopes() ``` **Return Value** Type: List<[Slack.AppScope](#appscope-class)> #### getStatus() **Signature** ```java public String getStatus() ``` **Return Value** Type: String #### setScopes(scopes) **Signature** ```java public void setScopes(List scopes) ``` **Parameters** _scopes_ Type: List<[Slack.AppScope](#appscope-class)> **Return Value** Type: void #### setStatus(status) **Signature** ```java public void setStatus(String status) ``` **Parameters** _status_ Type: String **Return Value** Type: void --- ## AppRequest.Team Class ### AppRequest.Team Methods The following are methods for `AppRequest.Team`. #### getDomain() **Signature** ```java public String getDomain() ``` **Return Value** Type: String #### getId() **Signature** ```java public String getId() ``` **Return Value** Type: String #### getName() **Signature** ```java public String getName() ``` **Return Value** Type: String #### setDomain(domain) **Signature** ```java public void setDomain(String domain) ``` **Parameters** _domain_ Type: String **Return Value** Type: void #### setId(id) **Signature** ```java public void setId(String id) ``` **Parameters** _id_ Type: String **Return Value** Type: void #### setName(name) **Signature** ```java public void setName(String name) ``` **Parameters** _name_ Type: String **Return Value** Type: void --- ## AppRequest.User Class ### AppRequest.User Methods The following are methods for `AppRequest.User`. #### getEmail() **Signature** ```java public String getEmail() ``` **Return Value** Type: String #### getId() **Signature** ```java public String getId() ``` **Return Value** Type: String #### getName() **Signature** ```java public String getName() ``` **Return Value** Type: String #### setEmail(email) **Signature** ```java public void setEmail(String email) ``` **Parameters** _email_ Type: String **Return Value** Type: void #### setId(id) **Signature** ```java public void setId(String id) ``` **Parameters** _id_ Type: String **Return Value** Type: void #### setName(name) **Signature** ```java public void setName(String name) ``` **Parameters** _name_ Type: String **Return Value** Type: void --- ## AppScope Class ### AppScope Methods The following are methods for `AppScope`. #### getDescription() **Signature** ```java public String getDescription() ``` **Return Value** Type: String #### getName() **Signature** ```java public String getName() ``` **Return Value** Type: String #### getTokenType() **Signature** ```java public String getTokenType() ``` **Return Value** Type: String #### isSensitive() **Signature** ```java public Boolean isSensitive() ``` **Return Value** Type: Boolean #### setDescription(description) **Signature** ```java public void setDescription(String description) ``` **Parameters** _description_ Type: String **Return Value** Type: void #### setName(name) **Signature** ```java public void setName(String name) ``` **Parameters** _name_ Type: String **Return Value** Type: void #### setSensitive(sensitive) **Signature** ```java public void setSensitive(Boolean sensitive) ``` **Parameters** _sensitive_ Type: Boolean **Return Value** Type: void #### setTokenType(tokenType) **Signature** ```java public void setTokenType(String tokenType) ``` **Parameters** _tokenType_ Type: String **Return Value** Type: void --- ## RequestedApp Class Represents a requested app. ### RequestedApp Methods The following are methods for `RequestedApp`. #### getAdditionalInfo() **Signature** ```java public String getAdditionalInfo() ``` **Return Value** Type: String #### getAppDirectoryUrl() **Signature** ```java public String getAppDirectoryUrl() ``` **Return Value** Type: String #### getAppHomepageUrl() **Signature** ```java public String getAppHomepageUrl() ``` **Return Value** Type: String #### getDescription() **Signature** ```java public String getDescription() ``` **Return Value** Type: String #### getHelpUrl() **Signature** ```java public String getHelpUrl() ``` **Return Value** Type: String #### getIcons() **Signature** ```java public Slack.AppIcons getIcons() ``` **Return Value** Type: [Slack.AppIcons](#appicons-class) #### getId() **Signature** ```java public String getId() ``` **Return Value** Type: String #### getName() **Signature** ```java public String getName() ``` **Return Value** Type: String #### getPrivacyPolicyUrl() **Signature** ```java public String getPrivacyPolicyUrl() ``` **Return Value** Type: String #### isAppDirectoryApproved() **Signature** ```java public Boolean isAppDirectoryApproved() ``` **Return Value** Type: Boolean #### isInternal() **Signature** ```java public Boolean isInternal() ``` **Return Value** Type: Boolean #### setAdditionalInfo(additionalInfo) **Signature** ```java public void setAdditionalInfo(String additionalInfo) ``` **Parameters** _additionalInfo_ Type: String **Return Value** Type: void #### setAppDirectoryApproved(appDirectoryApproved) **Signature** ```java public void setAppDirectoryApproved(Boolean appDirectoryApproved) setAppDirectoryUrl() ``` **Parameters** _appDirectoryApproved_ Type: Boolean **Return Value** Type: void #### setAppHomepageUrl(appHomepageUrl) **Signature** ```java public void setAppHomepageUrl(String appHomepageUrl) ``` **Parameters** _appHomepageUrl_ Type: String **Return Value** Type: void #### setDescription(description) **Signature** ```java public void setDescription(String description) ``` **Parameters** _description_ Type: String **Return Value** Type: void #### setHelpUrl(helpUrl) **Signature** ```java public void setHelpUrl(String helpUrl) ``` **Parameters** _helpUrl_ Type: String **Return Value** Type: void #### setIcons(icons) **Signature** ```java public void setIcons(Slack.AppIcons icons) ``` **Parameters** _icons_ Type: [Slack.AppIcons](#appicons-class) **Return Value** Type: void #### setId(id) **Signature** ```java public void setId(String id) ``` **Parameters** _id_ Type: String **Return Value** Type: void #### setInternal(internal) **Signature** ```java public void setInternal(Boolean internal) ``` **Parameters** _internal_ Type: Boolean **Return Value** Type: void #### setName(name) **Signature** ```java public void setName(String name) ``` **Parameters** _name_ Type: String **Return Value** Type: void #### setPrivacyPolicyUrl(privacyPolicyUrl) **Signature** ```java public void setPrivacyPolicyUrl(String privacyPolicyUrl) ``` **Parameters** _privacyPolicyUrl_ Type: String **Return Value** Type: void # Work with Apps The following are Apex classes for the Slack `apps` [API methods](https://api.slack.com/methods?filter=apps). ## AppsEventAuthorizationsListRequest Class Sends a request to get a list of authorizations for the given event context. Each authorization represents an app installation that the event is visible to. **Usage** See Slack’s [apps.event.authorizations.list method](https://api.slack.com/methods/apps.event.authorizations.list). ### AppsEventAuthorizationsListRequest Methods The following are methods for `AppsEventAuthorizationsListRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.AppsEventAuthorizationsListRequest.Builder builder() ``` **Return Value** Type: Slack.AppsEventAuthorizationsListRequest.Builder --- ## AppsEventAuthorizationsListRequest.Builder Class Contains methods to build an instance of the `Slack.AppsEventAuthorizationsListRequest` class. A Builder object is obtained by invoking one of the `AppsEventAuthorizationsListRequest.Builder` methods defined by the `AppsEventAuthorizationsListRequest` class. ### AppsEventAuthorizationsListRequest.Builder Methods The following are methods for `AppsEventAuthorizationsListRequest.Builder`. These methods are optional unless specified otherwise. #### build() **Signature** ```java public Slack.AppsEventAuthorizationsListRequest build() ``` **Return Value** Type: Slack.AppsEventAuthorizationsListRequest #### cursor(cursor) **Signature** ```java public Slack.AppsEventAuthorizationsListRequest.Builder cursor(String cursor) ``` **Parameters** _cursor_ Type: String **Return Value** Type: Slack.AppsEventAuthorizationsListRequest.Builder #### eventContext(eventContext) Required. The event context identifies an event in each event payload sent to your app. **Signature** ```java public Slack.AppsEventAuthorizationsListRequest.Builder eventContext(String eventContext) ``` **Parameters** _eventContext_ Type: String **Return Value** Type: Slack.AppsEventAuthorizationsListRequest.Builder #### limitValue(limitValue) **Signature** ```java public Slack.AppsEventAuthorizationsListRequest.Builder limitValue(Integer limitValue) ``` **Parameters** _limitValue_ Type: Integer **Return Value** Type: Slack.AppsEventAuthorizationsListRequest.Builder --- ## AppsEventAuthorizationsListResponse Class Gets a list of authorizations for the given event context. Each authorization represents an app installation that the event is visible to. ### AppsEventAuthorizationsListResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `AppsEventAuthorizationsListResponse`. #### getAuthorizations() **Signature** ```java public List getAuthorizations() ``` **Return Value** Type: List #### getCursorNext() **Signature** ```java public String getCursorNext() ``` **Return Value** Type: String #### setAuthorizations(authorizations) **Signature** ```java public void setAuthorizations(List authorizations) ``` **Parameters** _authorization_ Type: ListAdd link. **Return Value** Type: void #### setCursorNext(cursorNext) **Signature** ```java public void setCursorNext(String cursorNext) ``` **Parameters** Type: String **Return Value** Type: void --- ## AppsEventAuthorizationsListResponse.Authorization Class Call these methods to see all the installations of your app than an event is visible to. ### AppsEventAuthorizationsListResponse.Authorization Methods The following are methods for `AppsEventAuthorizationsListResponse.Authorization`. #### getEnterpriseId() **Signature** ```java public String getEnterpriseId() ``` **Return Value** Type: String #### getIsBot() **Signature** ```java public Boolean getIsBot() ``` **Return Value** Type: Boolean #### getIsEnterpriseInstall() **Signature** ```java public Boolean getIsEnterpriseInstall() ``` **Return Value** Type: Boolean #### getTeamId() Gets the workspace ID. **Signature** ```java public String getTeamId() ``` **Return Value** Type: String #### getUserId() Gets the ID of the Slack user. **Signature** ```java public String getUserId() ``` **Return Value** Type: String #### setEnterpriseId(enterpriseId) Sets the enterprise ID. **Signature** ```java public void setEnterpriseId(String enterpriseId) ``` **Parameters** _enterpriseId_ Type: String **Return Value** Type: void #### setIsBot(isBot) **Signature** ```java public void setIsBot(Boolean isBot) ``` **Parameters** _isBot_ Type: Boolean **Return Value** Type: void #### setIsEnterpriseInstall(isEnterpriseInstall) **Signature** ```java public void setIsEnterpriseInstall(Boolean isEnterpriseInstall) ``` **Parameters** _isEnterpriseInstall_ Type: Boolean **Return Value** Type: void #### setTeamId(teamId) Sets the workspace ID. **Signature** ```java public void setTeamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: void #### setUserId(userId) Sets the ID of the Slack user. **Signature** ```java public void setUserId(String userId) ``` **Parameters** _userId_ Type: String **Return Value** Type: void --- ## AppsUninstallRequest Class Sends a request to uninstall your app from a workspace. ### AppsUninstallRequest Methods The following are methods for `AppsUninstallRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.AppsUninstallRequest.Builder builder() ``` **Return Value** Type: Slack.AppsUninstallRequest.Builder --- ## AppsUninstallRequest.Builder Class Contains methods to build an instance of the `Slack.AppsUninstallRequest` class. A Builder object is obtained by invoking one of the `AppsUninstallRequest.Builder` methods defined by the `AppsUninstallRequest` class. ### AppsUninstallRequest.Builder Methods The following are methods for `AppsUninstallRequest.Builder`. #### build() Required. Builds an instance of the `Slack.AppsUninstallRequest` class. **Signature** ```java public Slack.AppsUninstallRequest build() ``` **Return Value** Type: Slack.AppsUninstallRequest #### clientId(clientId) Required. The client ID that's issued when you created your Slack app. **Signature** ```java public Slack.AppsUninstallRequest.Builder clientId(String clientId) ``` **Parameters** _clientId_ Type: String **Return Value** Type: Slack.AppsUninstallRequest.Builder #### clientSecret(clientSecret) Required. The client secret that's issued when you created your Slack app. **Signature** ```java public Slack.AppsUninstallRequest.Builder clientSecret(String clientSecret) ``` **Parameters** _clientSecret_ Type: String **Return Value** Type: Slack.AppsUninstallRequest.Builder --- ## AppsUninstallResponse Class Uninstall your app from a workspace. ### AppsUninstallResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). # Work with Bot Users The following are Apex classes for the Slack `bots` [API methods](https://api.slack.com/methods/bots.info). ## BotIcons Class Represents icons for a bot user. ### BotIcons Methods The following are methods for `BotIcons`. #### getImage36() **Signature** ```java public String getImage36() ``` **Return Value** Type: String #### getImage48() **Signature** ```java public String getImage48() ``` **Return Value** Type: String #### getImage72() **Signature** ```java public String getImage72() ``` **Return Value** Type: String #### setImage36(image36) **Signature** ```java public void setImage36(String image36) ``` **Parameters** _image36_ Type: String **Return Value** Type: void #### setImage48(image48) **Signature** ```java public void setImage48(String image48) ``` **Parameters** _image48_ Type: String **Return Value** Type: void #### setImage72(image72) **Signature** ```java public void setImage72(String image72) ``` **Parameters** _image72_ Type: String **Return Value** Type: void --- ## BotProfile Class Represents the profile information for a bot. ### BotProfile Methods The following are methods for `BotProfile`. #### getAppId() **Signature** ```java public String getAppId() ``` **Return Value** Type: String #### getIcons() **Signature** ```java public Slack.BotProfile.Icons getIcons() ``` **Return Value** Type: Slack.BotProfile.Icons #### getId() **Signature** ```java public String getId() ``` **Return Value** Type: String #### getName() **Signature** ```java public String getName() ``` **Return Value** Type: String #### getTeamId() **Signature** ```java public String getTeamId() ``` **Return Value** Type: String #### getUpdated() **Signature** ```java public Integer getUpdated() ``` **Return Value** Type: Integer #### isDeleted() **Signature** ```java public Boolean isDeleted() ``` **Return Value** Type: Boolean #### setAppId(appId) **Signature** ```java public void setAppId(String appId) ``` **Parameters** _appId_ Type: String **Return Value** Type: void #### setDeleted(deleted) **Signature** ```java public void setDeleted(Boolean deleted) ``` **Parameters** _deleted_ Type: Boolean **Return Value** Type: void #### setIcons(icons) **Signature** ```java public void setIcons(Slack.BotProfile.Icons icons) ``` **Parameters** _icons_ Type: Slack.BotProfile.Icons **Return Value** Type: void #### setId(id) **Signature** ```java public void setId(String id) ``` **Parameters** _id_ Type: String **Return Value** Type: void #### setName(name) **Signature** ```java public void setName(String name) ``` **Parameters** _name_ Type: String **Return Value** Type: void #### setTeamId(teamId) **Signature** ```java public void setTeamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: void #### setUpdated(updated) **Signature** ```java public void setUpdated(Integer updated) ``` **Parameters** _updated_ Type: Integer **Return Value** Type: void --- ## BotProfile.Icons Class Represents icons on a bot's profile information. ### BotProfile.Icons Methods The following are methods for `BotProfile.Icons`. #### getImage36() **Signature** ```java public String getImage36() ``` **Return Value** Type: String #### getImage48() **Signature** ```java public String getImage48() ``` **Return Value** Type: String #### getImage72() **Signature** ```java public String getImage72() ``` **Return Value** Type: String #### setImage36(image36) **Signature** ```java public void setImage36(String image36) ``` **Parameters** _image36_ Type: String **Return Value** Type: void #### setImage48(image48) **Signature** ```java public void setImage48(String image48) ``` **Parameters** _image48_ Type: String **Return Value** Type: void #### setImage72(image72) **Signature** ```java public void setImage72(String image72) ``` **Parameters** _image72_ Type: String **Return Value** Type: void --- ## BotsInfoRequest Class Sends a request to get information about a bot user. ### BotsInfoRequest Methods The following are methods for `BotsInfoRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.BotsInfoRequest.Builder builder() ``` **Return Value** Type: Slack.BotsInfoRequest.Builder --- ## BotsInfoRequest.Builder Class Contains methods to build an instance of the `Slack.BotsInfoRequest` class. A Builder object is obtained by invoking one of the `BotsInfoRequest.Builder` methods defined by the `BotsInfoRequest` class. ### BotsInfoRequest.Builder Methods The following are methods for `BotsInfoRequest.Builder`. These methods are optional unless specified otherwise. #### bot(bot) The bot user to get information on. **Signature** ```java public Slack.BotsInfoRequest.Builder bot(String bot) ``` **Parameters** _bot_ Type: String **Return Value** Type: Slack.BotsInfoRequest.Builder #### build() Required. Builds an instance of the `Slack.BotsInfoRequest` class. **Signature** ```java public Slack.BotsInfoRequest build() ``` **Return Value** Type: Slack.BotsInfoRequest #### teamId(teamId) Encoded team ID or enterprise ID where the bot exists, required if org token is used. **Signature** ```java public Slack.BotsInfoRequest.Builder teamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: Slack.BotsInfoRequest.Builder --- ## BotsInfoResponse Class Gets information about a bot user. ### BotsInfoResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `BotsInfoResponse`. #### getBot() **Signature** ```java public Slack.BotsInfoResponse.Bot getBot() ``` **Return Value** Type: Slack.BotsInfoResponse.Bot #### setBot(bot) **Signature** ```java public void setBot(Slack.BotsInfoResponse.Bot bot) ``` **Parameters** _bot_ Type: Slack.BotsInfoResponse.Bot **Return Value** Type: void --- ## BotsInfoResponse.Bot Class ### BotsInfoResponse.Bot Methods The following are methods for `BotsInfoResponse.Bot`. #### `getAppId()` Returns the app ID, for example, `A161CLERW`. **Signature** ```java public String getAppId() ``` **Return Value** Type: String #### getIcons() Gets the icons for a bot user. **Signature** ```java public Slack.BotIcons getIcons() ``` **Return Value** Type: Slack.BotIcons #### getId() Returns the bot ID, for example, `B061F7JD2`. **Signature** ```java public String getId() ``` **Return Value** Type: String #### getName() Returns the name of the bot. **Signature** ```java public String getName() ``` **Return Value** Type: String #### getUpdated() **Signature** ```java public Integer getUpdated() ``` **Return Value** Type: Integer #### getUserId() Returns the user ID, for example, `U012ABCDEF`. **Signature** public String getUserId() **Return Value** Type: String #### isDeleted() Returns `true` if a bot user is deleted or `false` if the bot user is still active. **Signature** `public Boolean isDeleted()` **Return Value** Type: Boolean #### setAppId(appId) Specifies the app ID for the bot. **Signature** ```java public void setAppId(String appId) ``` **Parameters** _appId_ Type: String **Return Value** Type: void #### setIcons(icons) Sets the icon on a bot user. **Signature** ```java public void setIcons(Slack.BotIcons icons) ``` **Parameters** _icons_ Type: Slack.BotIcons **Return Value** Type: void #### setDeleted(deleted) Specifies whether the bot user is deleted. **Signature** ```java public void setDeleted(Boolean deleted) ``` **Parameters** _deleted_ Type: Boolean **Return Value** Type: void #### setId(id) Specifies the bot ID. **Signature** ```java public void setId(String id) ``` **Parameters** _id_ Type: String **Return Value** Type: void #### setName(name) Specifies the bot name. **Signature** ```java public void setName(String name) ``` **Parameters** _name_ Type: String **Return Value** Type: void #### setUpdated(updated) **Signature** ```java public void setUpdated(Integer updated) ``` **Parameters** _updated_ Type: Integer **Return Value** Type: void #### setUserId(userId) **Signature** ```java public void setUserId(String userId) ``` **Parameters** _userId_ Type: String **Return Value** Type: void # Work with Callable Handler Use the Callable Action Handler to return an `ActionResult`. The CallableHandler class is preferred over [RunnableHandler](https://uisf-docs.herokuapp.com/salesforce-slack-sdk/guide/apex_ref_runnablehandler.html) because it returns ActionResult. By using the `CallableHandler`, consumers provide improved error handling while the framework provides metrics. ## CallableHandler Class ### Call Method This method is for `Call`. #### call() **Signature** ```java public Slack.ActionResult call() ``` **Return Value** Type: Slack.ActionResult # Work with Calls The following are Apex classes for the Slack `calls` [API methods](https://api.slack.com/methods?filter=calls). These classes enable you to integrate your calls with Slack using the [Calls API](https://api.slack.com/apis/calls). ## Call Class Represents a call on Slack. ### Call Methods The following are methods for `Call`. #### getChannels() Gets the channel that initiated the call. **Signature** ```java public List getChannels() ``` **Return Value** Type: List\ #### getDateEnd() Gets the call end time in UTC UNIX timestamp format. **Signature** ```java public Integer getDateEnd() ``` **Return Value** Type: Integer #### getDateStart() Gets the call start time in UTC UNIX timestamp format. **Signature** ```java public Integer getDateStart() ``` **Return Value** Type: Integer #### getDesktopAppJoinUrl() Gets the Slack clients that launched the call. For example, `callapp://join/0987654321`. **Signature** ```java public String getDesktopAppJoinUrl() ``` **Return Value** Type: String #### getExternalDisplayId() Gets the external display ID. For example, `705-292-868`. **Signature** ```java public String getExternalDisplayId() ``` **Return Value** Type: String #### getExternalUniqueId() Gets the unique ID created by your app for your users. **Signature** ```java public String getExternalUniqueId() ``` **Return Value** Type: String #### getId() Gets the call ID. **Signature** ```java public String getId() ``` **Return Value** Type: String #### getJoinUrl() Gets the URL required for a client to join the call. **Signature** ```java public String getJoinUrl() ``` **Return Value** Type: String #### getTitle() Gets the name of the call. **Signature** ```java public String getTitle() ``` **Return Value** Type: String #### getUsers() Gets a list of call participants. **Signature** ```java public List getUsers() ``` **Return Value** Type: List<[Slack.CallParticipant](#callparticipant-class)> #### setChannels(channels) Sets the channel that initiates the call. **Signature** ```java public void setChannels(List channels) ``` **Parameters** _channels_ Type: List\ **Return Value** Type: void #### setDateEnd(dateEnd) Sets the call end time in UTC UNIX timestamp format. **Signature** ```java public void setDateEnd(Integer dateEnd) ``` **Parameters** _dateEnd_ Type: Integer **Return Value** Type: void #### setDateStart(dateStart) Sets the call start time in UTC UNIX timestamp format. **Signature** ```java public void setDateStart(Integer dateStart) ``` **Parameters** _dateStart_ Type: Integer **Return Value** Type: void #### setDesktopAppJoinUrl(desktopAppJoinUrl) Sets the Slack clients that launched the call. For example, `callapp://join/0987654321`. **Signature** ```java public void setDesktopAppJoinUrl(String desktopAppJoinUrl) ``` **Parameters** _desktopAppJoinUrl_ Type: String **Return Value** Type: void #### setExternalDisplayId(externalDisplayId) Sets the external display ID. **Signature** ```java public void setExternalDisplayId(String externalDisplayId) ``` **Parameters** _externalDisplayId_ Type: String **Return Value** Type: void #### setExternalUniqueId(externalUniqueId) Sets the unique ID created by your app for your users. **Signature** ```java public void setExternalUniqueId(String externalUniqueId) ``` **Parameters** _externalUniqueId_ Type: String **Return Value** Type: void #### setId(id) Sets the call ID. **Signature** ```java public void setId(String id) ``` **Parameters** _id_ Type: String **Return Value** Type: void #### setJoinUrl(joinUrl) Sets the URL required for a client to join the call. **Signature** ```java public void setJoinUrl(String joinUrl) ``` **Parameters** _joinUrl_ Type: String **Return Value** Type: void #### setTitle(title) Sets the name of the call. **Signature** ```java public void setTitle(String title) ``` **Parameters** _title_ Type: String **Return Value** Type: void #### setUsers(users) Sets the call participants. **Signature** ```java public void setUsers(List users) ``` **Parameters** _users_ Type: List<[Slack.CallParticipant](#callparticipant-class)> **Return Value** Type: void --- ## CallParticipant Class Represent a user on a call. ### CallParticipant Class The following are methods for `CallParticipant`. #### getAvatarUrl() Gets the URL for the call participant's avatar. **Signature** ```java public String getAvatarUrl() ``` **Return Value** Type: String #### getDisplayName() Gets the display name for the call participant. **Signature** ```java public String getDisplayName() ``` **Return Value** Type: String #### getExternalId() Gets the external ID for the call participant. The external ID is a unique ID that your app creates for your users. **Signature** ```java public String getExternalId() ``` **Return Value** Type: String #### getSlackId() Gets the Slack ID for the call participant. **Signature** ```java public String getSlackId() ``` **Return Value** Type: String #### setAvatarUrl(avatarUrl) Sets the URL for the call participant's avatar. **Signature** ```java public void setAvatarUrl(String avatarUrl) ``` **Parameters** _avatarUrl_ Type: String **Return Value** Type: void #### setDisplayName(displayName) Sets the display name for the call participant. **Signature** ```java public void setDisplayName(String displayName) ``` **Parameters** _displayName_ Type: String **Return Value** Type: void #### setExternalId(externalId) Sets the external ID for the call participant. **Signature** ```java public void setExternalId(String externalId) ``` **Parameters** _externalId_ Type: String **Return Value** Type: void #### setSlackId(slackId) Sets the Slack ID for the call participant. **Signature** ```java public void setSlackId(String slackId) ``` **Parameters** _slackId_ Type: String **Return Value** Type: void --- ## CallsAddRequest Class Sends a request to register a new call. **Usage** See Slack's [calls.add method](https://api.slack.com/methods/calls.add). ### CallsAddRequest Methods The following are methods for `CallsAddRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.CallsAddRequest.Builder builder() ``` **Return Value** Type: Slack.CallsAddRequest.Builder --- ## CallsAddRequest.Builder Class Contains methods to build an instance of the `Slack.CallsAddRequest` class. A Builder object is obtained by invoking one of the `CallsAddRequest.Builder` methods defined by the `CallsAddRequest` class. ### CallsAddRequest.Builder Methods The following are methods for `CallsAddRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Builds an instance of the `Slack.CallsAddRequest` class. **Signature** ```java public Slack.CallsAddRequest build() ``` **Return Value** Type: Slack.CallsAddRequest #### createdBy(createdBy) The Slack user ID of the user who created the call. When this method is called with a user token, `createdBy` is optional and defaults to the authenticated user of the token. Otherwise, the field is required. **Signature** ```java public Slack.CallsAddRequest.Builder createdBy(String createdBy) ``` **Parameters** _createdBy_ Type: String **Return Value** Type: Slacks.CallsAddRequest.Builder #### dateStart(dateStart) Call start time in UTC UNIX timestamp format. **Signature** ```java public Slack.CallsAddRequest.Builder dateStart(Integer dateStart) ``` **Parameters** _dateStart_ Type: Integer **Return Value** Type: Slack.CallsAddRequest.Builder #### desktopAppJoinUrl(desktopAppJoinUrl) The URL that's used to launch the 3rd-party call for the Slack clients. **Signature** ```java public Slack.CallsAddRequest.Builder desktopAppJoinUrl(String desktopAppJoinUrl) ``` **Parameters** _desktopAppJoinUrl_ Type: String **Return Value** Type: Slack.CallsAddRequest.Builder #### externalDisplayId(externalDisplayId) An optional ID supplied by the 3rd-party call provider. This ID is displayed in the call object. **Signature** ```java public Slack.CallsAddRequest.Builder externalDisplayId(String externalDisplayId) ``` **Parameters** _externalDisplayId_ Type: String **Return Value** Type: Slack.CallsAddRequest.Builder #### externalUniqueId(externalUniqueId) Required. An ID supplied by the 3rd-party call provider. It must be unique across all calls from that service. **Signature** ```java public Slack.CallsAddRequest.Builder externalUniqueId(String externalUniqueId) ``` **Parameters** _externalUniqueId_ Type: String **Return Value** Type: Slack.CallsAddRequest.Builder #### joinUrl(joinUrl) Required. The URL required for a client to join the call. **Signature** _joinUrl_ Type: String **Return Value** Type: Slack.CallsAddRequest.Builder #### title(title) The name for the call, which can be a short description. **Signature** ```java public Slack.CallsAddRequest.Builder title(String title) ``` **Parameters** _title_ Type: String **Return Value** Type: Slack.CallsAddRequest.Builder #### users(users) The list of call participants. **Signature** ```java public Slack.CallsAddRequest.Builder users(List users) ``` **Parameters** _users_ Type: List<[Slack.CallParticipant](#callparticipant-class)> **Return Value** Type: Slack.CallsAddRequest.Builder --- ## CallsAddResponse Class Registers a new call. ### CallsAddResponse Method This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `CallsAddResponse`. #### getCall() Gets information about the call. **Signature** ```java public Slack.Call getCall() ``` **Return Value** Type: Slack.Call #### getResponseMetadata() **Signature** ```java public Slack.ResponseMetadata getResponseMetadata() ``` **Return Value** Type: [Slack.ResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#responsemetadata-class) #### setCall(call) Sets a call to be registered. `setCall` registers the details of the call with Slack. **Signature** ```java public void setCall(Slack.Call call) ``` **Parameters** _call_ Type: Slack.Call **Return Value** Type: void #### setResponseMetadata(responseMetadata) **Signature** ```java public void setResponseMetadata(Slack.ResponseMetadata responseMetadata) ``` **Parameters** _responseMetadata_ Type: [Slack.ResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#responsemetadata-class) **Return Value** Type: void --- ## CallsEndRequest Class Sends a request to end a call. **Usage** See Slack's [calls.add method](https://api.slack.com/methods/calls.end). ### CallsEndRequest Methods The following are methods for `CallsEndRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.CallsEndRequest.Builder builder() ``` **Return Value** Type: Slack.CallsEndRequest.Builder --- ## CallsEndRequest.Builder Class Contains methods to build an instance of the `Slack.CallsEndRequest` class. A Builder object is obtained by invoking one of the `CallsEndRequest.Builder` methods defined by the `CallsEndRequest` class. ### CallsEndRequest.Builder Methods The following are methods for `CallsEndRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of the `Slack.CallsEndRequest` object. **Signature** ```java public Slack.CallsEndRequest build() ``` **Return Value** Type: Slack.CallsEndRequest #### duration(duration) Call duration in seconds. **Signature** ```java public Slack.CallsEndRequest.Builder duration(Integer duration) ``` **Parameters** _duration_ Type: Integer **Return Value** Type: Slack.CallsEndRequest.Builder #### id(id) Required. The ID that's returned when registering a call using `CallsAddRequest`. **Signature** ```java public Slack.CallsEndRequest.Builder id(String id) ``` **Parameters** _id_ Type: String **Return Value** Type: Slack.CallsEndRequest.Builder --- ## CallsEndResponse Class Ends a call. ### CallsEndResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `CallsEndResponse`. #### getCall() Gets information about the call. **Signature** ```java public Slack.Call getCall() ``` **Return Value** Type: [Slack.Call](#call-class) #### getResponseMetadata() **Signature** ```java public Slack.ResponseMetadata getResponseMetadata() ``` **Return Value** Type: [Slack.ResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#responsemetadata-class) #### setCall(call) Sets the call to be terminated. **Signature** ```java public void setCall(Slack.Call call) ``` **Parameters** _call_ Type: Slack.Call **Return Value** Type: void #### setResponseMetadata(responseMetadata) **Signature** ```java public void setResponseMetadata(Slack.ResponseMetadata responseMetadata) ``` **Parameters** _responseMetadata_ Type: [Slack.ResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#responsemetadata-class) **Return Value** Type: void --- ## CallsInfoRequest Class Sends a request to return information about a call. **Usage** See Slack's [calls.info method](https://api.slack.com/methods/calls.info). ### CallsInfoRequest Methods The following are methods for `CallsInfoRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.CallsInfoRequest.Builder builder() ``` **Return Value** Type: Slack.CallsInfoRequest.Builder --- ## CallsInfoRequest.Builder Class Contains methods to build an instance of the `Slack.CallsInfoRequest` class. A Builder object is obtained by invoking one of the `CallsInfoRequest.Builder` methods defined by the `CallsInfoRequest` class. ### CallsInfoRequest.Builder Methods The following are methods for `CallsInfoRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of the `Slack.CallsInfoRequesxt` object. **Signature** ```java public Slack.CallsInfoRequest build() ``` **Return Value** Type: Slack.CallsInfoRequest #### id(id) Required. The ID of the call that's returned by `CallsAddRequest`. **Signature** ```java public Slack.CallsInfoRequest.Builder id(String id) ``` **Parameters** _id_ Type: String **Return Value** Type: Slack.CallsInfoRequest.Builder --- ## CallsInfoResponse Class Returns information about a call. ### CallsInfoResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `CallsInfoResponse`. #### getCall() Gets information about the call. **Signature** ```java public Slack.Call getCall() ``` **Return Value** Type: Slack.Call #### getResponseMetadata() **Signature** ```java public Slack.ResponseMetadata getResponseMetadata() ``` **Return Value** Type: [Slack.ResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#responsemetadata-class) #### setCall(call) Sets the call from which to get information. **Signature** ```java public void setCall(Slack.Call call) ``` **Parameters** _call_ Type: Slack.Call **Return Value** Type: void #### setResponseMetadata(responseMetadata) **Signature** ```java public void setResponseMetadata(Slack.ResponseMetadata responseMetadata) ``` **Parameters** _responseMetadata_ Type: [Slack.ResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#responsemetadata-class) **Return Value** Type: void --- ## CallsParticipantsAddRequest Class Sends a request to register new participants that are added to a call. **Usage** See Slack's [calls.participants.add method](https://api.slack.com/methods/calls.participants.add). ### CallsParticipantsAddRequest Methods The following are methods for` CallsParticipantsAddRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.CallsParticipantsAddRequest.Builder builder() ``` **Return Value** Type: Slack.CallsParticipantsAddRequest.Builder --- ## CallsParticipantsAddRequest.Builder Class Contains methods to build an instance of the `Slack.CallsParticipantsAddRequest` class. A Builder object is obtained by invoking one of the `CallsParticipantsAddRequest.Builder` methods defined by the `CallsParticipantsAddRequest` class. ### CallsParticipantsAddRequest.Builder Methods The following are methods for `CallsParticipantsAddRequest.Builder`. #### build() Required. Returns an instance of the `Slack.CallsParticipantsAddRequest` object. **Signature** ```java public Slack.CallsParticipantsAddRequest build() ``` **Return Value** Type: Slack.CallsParticipantsAddRequest #### id(id) Required. The ID that's returned by `CallsAddRequest`. **Signature** ```java public Slack.CallsParticipantsAddRequest.Builder id(String id) ``` **Parameters** _id_ Type: String **Return Value** Type: Slack.CallsParticipantsAddRequest.Builder #### users(users) Required. The list of users to add as participants in the call. **Signature** ```java public Slack.CallsParticipantsAddRequest.Builder users(List users) ``` **Parameters** _users_ Type: List<[Slack.CallParticipant](#callparticipant-class)> **Return Value** Type: Slack.CallsParticipantsAddRequest.Builder --- ## CallsParticipantsAddResponse Class Registers new participants that are added to a call. ### CallsParticipantsAddResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `CallsParticipantsAddResponse`. #### getCall() Gets information about the call. **Signature** ```java public Slack.Call getCall() ``` **Return Value** Type: Slack.Call #### getResponseMetadata() **Signature** ```java public Slack.ResponseMetadata getResponseMetadata() ``` **Return Value** Type: [Slack.ResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#responsemetadata-class) #### setCall(call) Sets the call for which to register new participants. **Signature** ```java public void setCall(Slack.Call call) ``` **Parameters** _call_ Type: Slack.Call **Return Value** Type: void #### setResponseMetadata(responseMetadata) **Signature** ```java public void setResponseMetadata(Slack.ResponseMetadata responseMetadata) ``` **Parameters** _responseMetadata_ Type: [Slack.ResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#responsemetadata-class) **Return Value** Type: void --- ## CallsParticipantsRemoveRequest Class Sends a request to remove participants in the call. **Usage** See Slack's [calls.participants.remove method](https://api.slack.com/methods/calls.participants.remove). ### CallsParticipantsRemoveRequest Methods The following are methods for `CallsParticipantsRemoveRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.CallsParticipantsRemoveRequest.Builder builder() ``` **Return Value** Type: Type: Slack.CallsParticipantsRemoveRequest.Builder --- ## CallsParticipantsRemoveRequest.Builder Class Contains methods to build an instance of the `Slack.CallsParticipantsRemoveRequest` class. A Builder object is obtained by invoking one of the `CallsParticipantsRemoveRequest.Builder` methods defined by the `CallsParticipantsRemoveRequest` class. ### CallsParticipantsRemoveRequest.Builder Methods The following are methods for `CallsParticipantsRemoveRequest.Builder`. #### build() Required. Returns an instance of the `Slack.CallsParticipantsRemoveRequest` object. **Signature** ```java public Slack.CallsParticipantsRemoveRequest build() ``` **Return Value** Type: Slack.CallsParticipantsRemoveRequest #### id(id) Required. The ID that's returned by `CallsAddRequest`. **Signature** ```java public Slack.CallsParticipantsRemoveRequest.Builder id(String id) ``` **Parameters** _id_ Type: String **Return Value** Type: Type: Slack.CallsParticipantsRemoveRequest.Builder #### users(users) Required. The list of users to remove as participants in the call. **Signature** ```java public Slack.CallsParticipantsRemoveRequest.Builder users(List users) ``` **Parameters** _users_ Type: List<[Slack.CallParticipant](#callparticipant-class)> **Return Value** Type: Slack.CallsParticipantsRemoveRequest.Builder --- ## CallsParticipantsRemoveResponse Class Registers participants removed from a Call. ### CallsParticipantsRemoveResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `CallsParticipantsRemoveResponse`. #### getCall() Gets information about the call. **Signature** ```java public Slack.Call getCall() ``` **Return Value** Type: Slack.Call #### getResponseMetadata() **Signature** ```java public Slack.ResponseMetadata getResponseMetadata() ``` **Return Value** Type: [Slack.ResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#responsemetadata-class) #### setCall(call) Sets the call from which to remove participants. **Signature** ```java public void setCall(Slack.Call call) ``` **Parameters** _call_ Type: Slack.Call **Return Value** Type: void #### setResponseMetadata(responseMetadata) **Signature** ```java public void setResponseMetadata(Slack.ResponseMetadata responseMetadata) ``` **Parameters** _responseMetadata_ Type: [Slack.ResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#responsemetadata-class) **Return Value** Type: void --- ## CallsUpdateRequest Class Sends a request to update information about a call. ### CallsUpdateRequest Methods The following are methods for `CallsUpdateRequest`. #### builder() **Signature** ```java public static Slack.CallsUpdateRequest.Builder builder() ``` **Return Value** Type: Slack.CallsUpdateRequest.Builder --- ## CallsUpdateRequest.Builder Class Contains methods to build an instance of the `Slack.CallsUpdateRequest` class. A Builder object is obtained by invoking one of the `CallsUpdateRequest.Builder` methods defined by the `CallsUpdateRequest` class. ### CallsUpdateRequest.Builder Methods The following are methods for `CallsUpdateRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of the `Slack.CallsUpdateRequest` object. **Signature** ```java public Slack.CallsUpdateRequest build() ``` **Return Value** Type: Slack.CallsUpdateRequest #### desktopAppJoinUrl(desktopAppJoinUrl) **Signature** ```java public Slack.CallsUpdateRequest.Builder desktopAppJoinUrl(String desktopAppJoinUrl) ``` **Parameters** _desktopAppJoinUrl_ Type: String **Return Value** Type: Slack.CallsUpdateRequest.Builder #### id(id) Required. The ID that's returned by `CallsAddRequest`. **Signature** ```java public Slack.CallsUpdateRequest.Builder id(String id) ``` **Parameters** _id_ Type: String **Return Value** Type: Slack.CallsUpdateRequest.Builder #### joinUrl(joinUrl) **Signature** ```java public Slack.CallsUpdateRequest.Builder joinUrl(String joinUrl) ``` **Parameters** _joinUrl_ Type: String **Return Value** Type: Slack.CallsUpdateRequest.Builder #### title(title) **Signature** ```java public Slack.CallsUpdateRequest.Builder title(String title) ``` **Parameters** _title_ Type: String **Return Value** Type: Slack.CallsUpdateRequest.Builder ## CallsUpdateResponse Class Updates information about a call. ### CallsUpdateResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `CallsUpdateResponse`. #### getCall() Gets information about the call. **Signature** ```java public Slack.Call getCall() ``` **Return Value** Type: [Slack.Call](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_calls.md#call-class) #### getResponseMetadata() **Signature** ```java public Slack.ResponseMetadata getResponseMetadata() ``` **Return Value** Type: [Slack.ResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#responsemetadata-class) #### setCall(call) Sets the call for which to update information. **Signature** ```java public void setCall(Slack.Call call) ``` **Parameters** _call_ Type: [Slack.Call](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_calls.md#call-class) **Return Value** Type: void #### setResponseMetadata(responseMetadata) **Signature** ```java public void setResponseMetadata(Slack.ResponseMetadata responseMetadata) ``` **Parameters** _responseMetadata_ Type: [Slack.ResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#responsemetadata-class) **Return Value** Type: void # Work with Channels Use the `Channel` class for working with conversations between two or more users. ## Channel Class Represents information about a workspace channel. **Usage** See [Slack's channel object type](https://api.slack.com/types/channel). ### Channel Methods The following are methods for `Channel`. #### getCreated() **Signature** ```java public Integer getCreated() ``` **Return Value** Type: Integer #### getCreator() **Signature** ```java public String getCreator() ``` **Return Value** Type: String #### getEnterpriseId() **Signature** ```java public String getEnterpriseId() ``` **Return Value** Type: String #### getId() **Signature** ```java public String getId() ``` **Return Value** Type: String #### getIsMoved() **Signature** ```java public Integer getIsMoved() ``` **Return Value** Type: Integer #### getLastRead() **Signature** ```java public String getLastRead() ``` **Return Value** Type: String #### getLatest() **Signature** ```java public Slack.Latest getLatest() ``` **Return Value** Type: [Slack.Latest](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_latest.md) #### getMembers() **Signature** ```java public List getMembers() ``` **Return Value** Type: List\ #### getName() **Signature** ```java public String getName() ``` **Return Value** Type: String #### getNameNormalized() **Signature** ```java public String getNameNormalized() ``` **Return Value** Type: String #### getNumMembers() **Signature** ```java public Integer getNumMembers() ``` **Return Value** Type: Integer #### getPendingShared() **Signature** ```java public List getPendingShared() ``` **Return Value** Type: List\ #### getPreviousNames() **Signature** ```java public List getPreviousNames() ``` **Return Value** Type: List\ #### getPriority() **Signature** ```java public Double getPriority() ``` **Return Value** Type: Double #### getPurpose() **Signature** ```java public Slack.Purpose getPurpose() ``` **Return Value** Type: [Slack.Purpose](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_purpose.md) #### getTopic() **Signature** ```java public Slack.Topic getTopic() ``` **Return Value** Type: [Slack.Topic](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_topics.md) #### getUnlinked() **Signature** ```java public Integer getUnlinked() ``` **Return Value** Type: Integer #### getUnreadCount() **Signature** ```java public Integer getUnreadCount() ``` **Return Value** Type: Integer #### getUnreadCountDisplay() **Signature** ```java public Integer getUnreadCountDisplay() ``` **Return Value** Type: Integer #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### isArchived() **Signature** ```java public Boolean isArchived() ``` **Return Value** Type: Boolean #### isChannel() **Signature** ```java public Boolean isChannel() ``` **Return Value** Type: Boolean #### isExtShared() **Signature** ```java public Boolean isExtShared() ``` **Return Value** Type: Boolean #### isGeneral() **Signature** ```java public Boolean isGeneral() ``` **Return Value** Type: Boolean #### isGlobalShared() **Signature** ```java public Boolean isGlobalShared() ``` **Return Value** Type: Boolean #### isGroup() **Signature** ```java public Boolean isGroup() ``` **Return Value** Type: Boolean #### isIm() **Signature** ```java public Boolean isIm() ``` **Return Value** Type: Boolean #### isMember() **Signature** ```java public Boolean isMember() ``` **Return Value** Type: Boolean #### isMpim() Returns true for a private channel or a group DM channel. **Signature** ```java public Boolean isMpim() ``` **Return Value** Type: Boolean #### isOrgDefault() **Signature** ```java public Boolean isOrgDefault() ``` **Return Value** Type: Boolean #### isOrgMandatory() **Signature** ```java public Boolean isOrgMandatory() ``` **Return Value** Type: Boolean #### isOrgShared() **Signature** ```java public Boolean isOrgShared() ``` **Return Value** Type: Boolean #### isPendingExtShared() **Signature** ```java public Boolean isPendingExtShared() ``` **Return Value** Type: Boolean #### isPrivateChannel() **Signature** ```java public Boolean isPrivateChannel() ``` **Return Value** Type: Boolean #### isReadOnly() **Signature** ```java public Boolean isReadOnly() ``` **Return Value** Type: Boolean #### isShared() **Signature** ```java public Boolean isShared() ``` **Return Value** Type: Boolean #### isThreadOnly() **Signature** ```java public Boolean isThreadOnly() ``` **Return Value** Type: Boolean #### setArchived(archived) **Signature** ```java public void setArchived(Boolean archived) ``` **Parameters** _archived_ Type: Boolean **Return Value** Type: void #### setChannel(channel) **Signature** ```java public void setChannel(Boolean channel) ``` **Parameters** _channel_ Type: Boolean **Return Value** Type: void #### setCreated(created) **Signature** ```java public void setCreated(Integer created) ``` **Parameters** _created_ Type: Integer **Return Value** Type: void #### setCreator(creator) **Signature** ```java public void setCreator(String creator) ``` **Parameters** _creator_ Type: String **Return Value** Type: void #### setEnterpriseId(enterpriseId) **Signature** ```java public void setEnterpriseId(String enterpriseId) ``` **Parameters** _enterpriseId_ Type: String **Return Value** Type: void #### setExtShared(extShared) **Signature** ```java public void setExtShared(Boolean extShared) ``` **Parameters** _extShared_ Type: Boolean **Return Value** Type: void #### setGeneral(general) **Signature** ```java public void setGeneral(Boolean general) ``` **Parameters** _general_ Type: Boolean **Return Value** Type: void #### setGlobalShared(globalShared) **Signature** ```java public void setGlobalShared(Boolean globalShared) ``` **Parameters** _globalShared_ Type: Boolean **Return Value** Type: vpod #### setGroup(groupValue) **Signature** ```java public void setGroup(Boolean groupValue) ``` **Parameters** _groupValue_ Type: Boolean **Return Value** Type: void #### setId(id) **Signature** ```java public void setId(String id) ``` **Parameters** _id_ Type: String **Return Value** Type: void #### setIm(im) **Signature** ```java public void setIm(Boolean im) ``` **Parameters** _im_ Type: Boolean **Return Value** Type: void #### setIsMoved(isMoved) **Signature** ```java public void setIsMoved(Integer isMoved) ``` **Parameters** _isMoved_ Type: Integer **Return Value** Type: void #### setLastRead(lastRead) **Signature** ```java public void setLastRead(String lastRead) ``` **Parameters** _lastRead_ Type: String **Return Value** Type: void #### setLatest(latest) **Signature** ```java public void setLatest(Slack.Latest latest) ``` **Parameters** _latest_ Type: [Slack.Latest](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_latest.md) **Return Value** Type: void #### setMember(member) **Signature** ```java public void setMember(Boolean member) ``` **Parameters** _member_ Type: Boolean **Return Value** Type: void #### setMembers(members) **Signature** ```java public void setMembers(List members) ``` **Parameters** _members_ Type: List\ **Return Value** Type: void #### setMpim(mpim) **Signature** ```java public void setMpim(Boolean mpim) ``` **Parameters** _mpim_ Type: Boolean **Return Value** Type: void #### setName(name) **Signature** ```java public void setName(String name) ``` **Parameters** _name_ Type: String **Return Value** Type: void #### setNameNormalized(nameNormalized) **Signature** ```java public void setNameNormalized(String nameNormalized) ``` **Parameters** _nameNormalized_ Type: String **Return Value** Type: void #### setNumMembers(numMembers) **Signature** ```java public void setNumMembers(Integer numMembers) ``` **Parameters** _numMembers_ Type: Integer **Return Value** Type: void #### setOrgDefault(orgDefault) **Signature** ```java public void setOrgDefault(Boolean orgDefault) ``` **Parameters** _orgDefault_ Type: Boolean **Return Value** Type: void #### setOrgMandatory(orgMandatory) **Signature** ```java public void setOrgMandatory(Boolean orgMandatory) ``` **Parameters** _orgMandatory_ Type: Boolean **Return Value** Type: void #### setOrgShared(orgShared) **Signature** ```java public void setOrgShared(Boolean orgShared) ``` **Parameters** _orgShared_ Type: Boolean **Return Value** Type: void #### setPendingExtShared(pendingExtShared) **Signature** ```java public void setPendingExtShared(Boolean pendingExtShared) ``` **Parameters** _pendingExtShared_ Type: Boolean **Return Value** Type: void #### setPendingShared(pendingShared) **Signature** ```java public void setPendingShared(List pendingShared) ``` **Parameters** _pendingShared_ Type: List\ **Return Value** Type: void #### setPreviousNames(previousNames) **Signature** ```java public void setPreviousNames(List previousNames) ``` **Parameters** _previousNames_ Type: List\ **Return Value** Type: void #### setPriority(priority) **Signature** ```java public void setPriority(Double priority) ``` **Parameters** _priority_ Type: Double **Return Value** Type: void #### setPrivateChannel(privateChannel) **Signature** ```java public void setPrivateChannel(Boolean privateChannel) ``` **Parameters** _privateChannel_ Type: Boolean **Return Value** Type: void #### setPurpose(purpose) **Signature** ```java public void setPurpose(Slack.Purpose purpose) ``` **Parameters** _purpose_ Type: [Slack.Purpose](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_purpose.md) **Return Value** Type: void #### setReadOnly(readOnly) **Signature** ```java public void setReadOnly(Boolean readOnly) ``` **Parameters** _readOnly_ Type: Boolean **Return Value** Type: void #### setShared(shared) **Signature** ```java public void setShared(Boolean shared) ``` **Parameters** _shared_ Type: Boolean **Return Value** Type: void #### setThreadOnly(threadOnly) **Signature** ```java public void setThreadOnly(Boolean threadOnly) ``` **Parameters** _threadOnly_ Type: Boolean **Return Value** Type: void #### setTopic(topic) **Signature** ```java public void setTopic(Slack.Topic topic) ``` **Parameters** _topic_ Type: [Slack.Topic](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_topics.md) **Return Value** Type: void #### setUnlinked(unlinked) **Signature** ```java public void setUnlinked(Integer unlinked) ``` **Parameters** _unlinked_ Type: Integer **Return Value** Type: void #### setUnreadCount(unreadCount) **Signature** ```java public void setUnreadCount(Integer unreadCount) ``` **Parameters** _unreadCount_ Type: Integer **Return Value** Type: void #### setUnreadCountDisplay(unreadCountDisplay) **Signature** ```java public void setUnreadCountDisplay(Integer unreadCountDisplay) ``` **Parameters** _unreadCountDisplay_ Type: Integer **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void # Work with Chat Messages The following are Apex classes for the Slack `chat` [API methods](https://api.slack.com/methods?filter=chat). **tip:** Many of these classes enable your Slack app to post a message using the bot token or user token based on the scopes required on the [Slack API methods](https://api.slack.com/methods?filter=chat). See [Bot Token and User Token Scopes](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/scopes.md#bot-token-and-user-token-scopes). ## ChatDeleteRequest Class Sends a request to delete a message. **Usage** See Slack’s [chat.delete method](https://api.slack.com/methods/chat.delete). ### ChatDeleteRequest Methods The following are methods for `ChatDeleteRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.ChatDeleteRequest.Builder builder() ``` **Return Value** Type: Slack.ChatDeleteRequest.Builder --- ## ChatDeleteResponse Class Deletes a message. **Usage** See Slack’s [chat.delete method](https://api.slack.com/methods/chat.delete). ### ChatDeleteResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `ChatDeleteResponse`. #### getChannel() The channel containing the message to be deleted. **Signature** ```java public String getChannel() ``` **Return Type** Type: String #### getDeprecatedArgument() **Signature** ```java public String getDeprecatedArgument() ``` **Return Value** Type: String #### getTs() Gets the timestamp of the message to be deleted. **Signature** ```java public String getTs() ``` **Return Value** Type: String #### setChannel(channel) **Signature** ```java public void setChannel(String channel) ``` **Parameters** _channel_ Type: String The channel containing the message to be deleted. **Return Value** Type: void #### setDeprecatedArgument(deprecatedArgument) **Signature** ```java public void setDeprecatedArgument(String deprecatedArgument) ``` **Parameters** _deprecatedArgument_ Type: String **Return Value** Type: void #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void --- ## ChatDeleteScheduledMessageRequest Class Sends a request to delete a pending scheduled message from the queue. **Usage** See Slack’s [chat.deleteScheduledMessage method](https://api.slack.com/methods/chat.deleteScheduledMessage). ### ChatDeleteScheduledMessageRequest Methods The following are methods for `ChatDeleteScheduledMessageRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.ChatDeleteScheduledMessageRequest.Builder builder() ``` **Return Value** Type: Slack.ChatDeleteScheduledMessageRequest.Builder --- ## ChatDeleteScheduledMessageRequest.Builder Class Contains methods to build an instance of the `Slack.ChatDeleteScheduledMessageRequest` class. A Builder object is obtained by invoking one of the `ChatDeleteScheduledMessageRequest.Builder` methods defined by the `ChatDeleteScheduledMessageRequest` class. ### ChatDeleteScheduledMessageRequest.Builder Methods The following are methods for `ChatDeleteScheduledMessageRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Builds an instance of `Slack.ChatDeleteScheduledMessageRequest`. **Signature** ```java public Slack.ChatDeleteScheduledMessageRequest build() ``` **Return Value** Type: Slack.ChatDeleteScheduledMessageRequest #### channel(channel) Required. The channel that the scheduled message is posting to. **Signature** ```java public Slack.ChatDeleteScheduledMessageRequest.Builder channel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: Slack.ChatDeleteScheduledMessageRequest.Builder #### scheduledMessageId(scheduledMessageId) Required. The ID that's returned from a call to [ChatScheduleMessageRequest](#chatschedulemessagerequest-class). **Signature** ```java public Slack.ChatDeleteScheduledMessageRequest.Builder scheduledMessageId(String scheduledMessageId) ``` **Parameters** _scheduledMessageId_ Type: String **Return Value** Type: Slack.ChatDeleteScheduledMessageRequest.Builder --- ## ChatDeleteScheduledMessageResponse Class Deletes a pending scheduled message from the queue. **Usage** See Slack’s [chat.deleteScheduledMessage method](https://api.slack.com/methods/chat.deleteScheduledMessage). ### ChatDeleteScheduledMessageResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). --- ## ChatGetPermalinkRequest Class Sends a request to retrieve a permalink URL. **Usage** See Slack’s [chat.getPermalink method](https://api.slack.com/methods/chat.getPermalink). ### ChatGetPermalinkRequest Methods The following are methods for `ChatGetPermalinkRequest`. #### builder() **Signature** ```java public static Slack.ChatGetPermalinkRequest.Builder builder() ``` **Return Value** Type: Slack.ChatGetPermalinkRequest.Builder --- ## ChatGetPermalinkRequest.Builder Class Contains methods to build an instance of the `Slack.ChatGetPermalinkRequest` class. A Builder object is obtained by invoking one of the `ChatGetPermalinkRequest.Builder` methods defined by the `ChatGetPermalinkRequest` class. These classes are optional unless specified otherwise. ### ChatGetPermalinkRequest.Builder Methods The following are methods for `ChatGetPermalinkRequest.Builder`. #### build() Required. Builds an instance of `Slack.ChatGetPermalinkRequest`. **Signature** ```java public Slack.ChatGetPermalinkRequest build() ``` **Return Value** Type: Slack.ChatGetPermalinkRequest #### channel(channel) Required. The ID of the conversation or channel containing the message. **Signature** ```java public Slack.ChatGetPermalinkRequest.Builder channel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: Slack.ChatGetPermalinkRequest.Builder #### messageTs(messageTs) Required. The message's timestamp value, uniquely identifying it within a channel. **Signature** ```java public Slack.ChatGetPermalinkRequest.Builder messageTs(String messageTs) ``` **Parameters** _messageTs_ Type: String **Return Value** Type: Slack.ChatGetPermalinkRequest.Builder --- ## ChatGetPermalinkResponse Class Retrieves a permalink URL. **Usage** See Slack’s [chat.getPermalink method](https://api.slack.com/methods/chat.getPermalink). ### ChatGetPermalinkResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `ChatGetPermalinkResponse`. #### getChannel() **Signature** ```java public String getChannel() ``` **Return Value** Type: String #### getPermalink() **Signature** ```java public String getPermalink() ``` **Return Value** Type: String #### setChannel() **Signature** ```java public void setChannel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: void #### setPermalink() **Signature** ```java public void setPermalink(String permalink) ``` **Parameters** _permalink_ Type: String **Return Value** Type: void --- ## ChatMeMessageRequest Class Sends a request to share a me message into a channel. **Usage** See Slack’s [chat.meMessage method](https://api.slack.com/methods/chat.meMessage). **note:** Consider using `chat:write` scope on the user token only in response to an inciting user action and inform users that a message will be posted on their behalf. See [Sending messages as other entities](https://api.slack.com/methods/chat.postMessage#authorship). ### ChatMeMessageRequest Methods The following are methods for `ChatMeMessageRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.ChatMeMessageRequest.Builder builder() ``` **Return Value** Type: Slack.ChatMeMessageRequest.Builder --- ## ChatMeMessageRequest.Builder Class Contains methods to build an instance of the `Slack.ChatMeMessageRequest` class. A Builder object is obtained by invoking one of the `ChatMeMessageRequest.Builder` methods defined by the `ChatMeMessageRequest` class. ### ChatMeMessageRequest.Builder Methods The following are methods for `ChatMeMessageRequest.Builder`. #### build() Required. Builds an instance of `Slack.ChatMeMessageRequest`. **Signature** ```java public Slack.ChatMeMessageRequest build() ``` **Return Value** Type: Slack.ChatMeMessageRequest #### channel(channel) Required. The ID or name of the channel to send message to, which can be a public channel, private group or IM channel. **Signature** ```java public Slack.ChatMeMessageRequest.Builder channel(String channel) ``` **Return Value** Type: Slack.ChatMeMessageRequest.Builder #### text(text) Required. Text of the message to send. **Signature** ```java public Slack.ChatMeMessageRequest.Builder text(String text) ``` **Parameters** _text_ Type: String **Return Value** Type: Slack.ChatMeMessageRequest.Builder --- ## ChatMeMessageResponse Class Shares a me message into a channel. **Usage** See Slack’s [chat.meMessage method](https://api.slack.com/methods/chat.meMessage). ### ChatMeMessageResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `ChatMeMessageResponse`. #### getChannel() The channel ID or name where the me message is shared. **Signature** ```java public String getChannel() ``` **Return Value** Type: String #### getTs() Gets the timestamp of the me message. **Signature** ```java public String getTs() ``` **Return Value** Type: String #### setChannel(channel) Sets the channel ID or name to send the message to, which can be a public or private group or IM channel. **Signature** ```java public void setChannel(String channel) ``` **Return Value** Type: void #### setTs(ts) Sets the timestamp on the me message. **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void --- ## ChatPostEphemeralRequest Class Sends a request to send an ephemeral message to a user in a channel. **Usage** See Slack’s [chat.postEphemeral method](https://api.slack.com/methods/chat.postEphemeral). **note:** Consider using `chat:write` scope on the user token only in response to an inciting user action inform users that a message will be posted on their behalf. See [Sending messages as other entities](https://api.slack.com/methods/chat.postMessage#authorship). ### ChatPostEphemeralRequest Methods The following are methods for `ChatPostEphemeralRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.ChatPostEphemeralRequest.Builder builder() ``` **Return Value** Type: Slack.ChatPostEphemeralRequest.Builder --- ## ChatPostEphemeralRequest.Builder Class Contains methods to build an instance of the `Slack.ChatPostEphemeralRequest` class. A Builder object is obtained by invoking one of the `ChatPostEphemeralRequest.Builder` methods defined by the `ChatPostEphemeralRequest` class. ### ChatPostEphemeralRequest.Builder Methods The following are methods for `ChatPostEphemeralRequest.Builder`. These methods are optional unless specified otherwise. #### attachmentsAsString(attachmentsAsString) **Signature** ```java public Slack.ChatPostEphemeralRequest.Builder attachmentsAsString(String attachmentsAsString) ``` **Parameters** _attachmentsAsString_ Type: String **Return Value** Type: Slack.ChatPostEphemeralRequest.Builder #### build() Required. Builds an instance of `Slack.ChatPostEphemeralRequest`. **Signature** ```java public Slack.ChatPostEphemeralRequest build() ``` **Return Value** Type: Slack.ChatPostEphemeralRequest #### channel(channel) Required. The ID or name of the channel, private group, or IM channel to send message to. **Signature** ```java public Slack.ChatPostEphemeralRequest.Builder channel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: Slack.ChatPostEphemeralRequest.Builder #### iconEmoji(iconEmoji) The emoji to use the icon for this message. Overrides the icon URL. Use an icon emoji with the `chat:write:bot` scope only. Otherwise, this is ignored. **Signature** ```java public Slack.ChatPostEphemeralRequest.Builder iconEmoji(String iconEmoji) ``` **Parameters** _iconEmoji_ Type: String **Return Value** Type: Slack.ChatPostEphemeralRequest.Builder #### iconUrl(iconUrl) URL to an image to use as the icon for this message. Use an icon URL with the `chat:write:bot` scope only. Otherwise, this is ignored. **Signature** ```java public Slack.ChatPostEphemeralRequest.Builder iconUrl(String iconUrl) ``` **Parameters** _iconUrl_ Type: String **Return Value** Type: Slack.ChatPostEphemeralRequest.Builder #### linkNames(linkNames) Find and link channel names and usernames. **Signature** ```java public Slack.ChatPostEphemeralRequest.Builder linkNames(Boolean linkNames) ``` **Parameters** _linkNames_ Type: Boolean **Return Value** Type: Slack.ChatPostEphemeralRequest.Builder #### parse(parse) Changes how messages are treated. Defaults to `none`. See [Formatting](https://api.slack.com/methods/chat.postEphemeral#formatting). **Signature** ```java public Slack.ChatPostEphemeralRequest.Builder parse(String parse) ``` **Parameters** _parse_ Type: String **Return Value** Type: Slack.ChatPostEphemeralRequest.Builder #### text(text) Required. Text of the message. See [Using text with blocks or attachments](https://api.slack.com/methods/chat.postEphemeral#text_usage). **Signature** ```java public Slack.ChatPostEphemeralRequest.Builder text(String text) ``` **Parameters** _text_ Type: String **Return Value** Type: Slack.ChatPostEphemeralRequest.Builder #### threadTs(threadTs) **Signature** ```java public Slack.ChatPostEphemeralRequest.Builder threadTs(String threadTs) ``` **Parameters** _threadTs_ Type: String **Return Value** Type: Slack.ChatPostEphemeralRequest.Builder #### user(user) Required. The ID of the user receiving the ephemeral message. This user belongs in the channel specified by `channel(channel)`. **Signature** ```java public Slack.ChatPostEphemeralRequest.Builder user(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: Slack.ChatPostEphemeralRequest.Builder #### username(username) The bot’s username. Must be used with the `chat:write:bot` scope. **Signature** ```java public Slack.ChatPostEphemeralRequest.Builder username(String username) ``` **Parameters** _username_ Type: String **Return Value** Type: Slack.ChatPostEphemeralRequest.Builder #### viewReference(viewReference) **Signature** ```java public Slack.ChatPostEphemeralRequest.Builder viewReference(Slack.ViewReference viewReference) ``` **Parameters** _viewReference_ Type: Slack.ViewReference **Return Value** Type: Slack.ChatPostEphemeralRequest.Builder --- ## ChatPostEphemeralResponse Class Sends an ephemeral message to a user in a channel. **Usage** See Slack’s [chat.postEphemeral method](https://api.slack.com/methods/chat.postEphemeral). ### ChatPostEphemeralResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `ChatPostEphemeralResponse`. ```java getDeprecatedArgument() ``` **Signature** ```java public String getDeprecatedArgument() ``` **Return Value** Type: String #### getMessageTs() **Signature** ```java public String getMessageTs() ``` **Return Value** Type: String #### setDeprecatedArgument(deprecatedArgument) **Signature** ```java public void setDeprecatedArgument(String deprecatedArgument) ``` **Parameters** _deprecatedArgument_ Type: String **Return Value** Type: void #### setMessageTs(messageTs) Sets the timestamp on the message. **Signature** ```java public void setMessageTs(String messageTs) ``` **Parameters** _messageTs_ Type: String **Return Value** Type: void --- ## ChatPostMessageRequest Class Sends a request to post a message to a channel. **Usage** See Slack’s [chat.postMessage method](https://api.slack.com/methods/chat.postMessage). In this example, the `PostMessage` action runs when a user enters your slash command. The `ViewReference` gets the `selection` view to display a select menu. When the value on the select menu changes, it calls an Apex `slackHomeViewSelectChanged` action that's specified on its onchange `definition` key. Finally, the `apphome` view is published with the selected value. ```java public class PostMessage extends Slack.SlashCommandDispatcher { public override Slack.ActionHandler invoke(Slack.SlashCommandParameters parameters, Slack.RequestContext context) { return Slack.ActionHandler.ack(new Handler(parameters, context)); } public class Handler implements Slack.RunnableHandler { Slack.SlashCommandParameters parameters; Slack.RequestContext context; public Handler(Slack.SlashCommandParameters parameters, Slack.RequestContext context){ this.parameters = parameters; this.context = context; } public void run () { Slack.App app = Slack.App.MySlackApp.get(); Slack.BotClient client = app.getBotClientForTeam(context.getTeamId()); Slack.ViewReference viewReference = Slack.View.selection.get(); String channel = context.getChannelId(); Slack.ChatPostMessageRequest req = new Slack.ChatPostMessageRequest.builder() .channel(channel) .viewReference(viewReference) .build(); Slack.ChatPostMessageResponse response = client.chatPostMessage(req); if (response.getError() != null) { System.debug(response.getError()); } else { System.debug('success'); } } } } ``` The `selection` view looks like this. ```yaml description: "Notifier Message" components: - definition: message properties: title: "Notifier" components: - definition: input name: "input_block" properties: label: "Select an option" components: - definition: select properties: name: "select_options" value: "option_1" placeholder: "Please select an option." options: - identifier: "option_1" label: "Option 1" - identifier: "option_2" label: "Option 2" events: onchange: definition: "apex__action__slackHomeViewSelectChanged" ``` Changing the value on the select menu calls the `slackHomeViewSelectChanged` Apex action, which extends [ActionDispatcher](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_dispatchers.md#actiondispatcher-class). ```java public class slackHomeViewSelectChanged extends Slack.ActionDispatcher { public override Slack.ActionHandler invoke(Map parameters, Slack.RequestContext context) { return Slack.ActionHandler.ack(new Handler(parameters, context)); } public class Handler implements Slack.RunnableHandler { Map parameters; Slack.RequestContext context; public Handler (Map parameters, Slack.RequestContext context){ this.parameters = parameters; this.context = context; } public void run () { Slack.App app = Slack.App.MySlackApp.get(); Slack.BotClient botClient = app.getBotClientForTeam(context.getTeamId()); Slack.ViewReference viewReference = Slack.View.apphome.get(); Slack.ActionPayload actionPayload = context.getActionPayload(); if (actionPayload != null) { String name = actionPayload.getName(); if (name == 'select_options') { Object value = actionPayload.getValue(); viewReference.setParameter('selected', value.toString()); } } Slack.HomeView homeView = new Slack.HomeView.builder() .viewReference(viewReference) .build(); Slack.ViewsPublishRequest req = new Slack.ViewsPublishRequest.builder() .userId(context.getUserId()) .view(homeView) .build(); Slack.ViewsPublishResponse response = botClient.viewsPublish(req); if (response.getError() != null) { System.debug(response.getError()); } } } } ``` The `apphome` view looks like this. ```yaml description: "Home page" schema: properties: selected: type: string defaultValue: "no option has been selected" components: - definition: home properties: title: "Sample Home" components: - definition: section properties: text: "This is the App Home page!!!" - definition: section properties: text: "Selected: {!view.properties.selected}" ``` **note:** Consider using `chat:write` scope on the user token only in response to an inciting user action and inform users that a message will be posted on their behalf. See [Sending messages as other entities](https://api.slack.com/methods/chat.postMessage#authorship). ### ChatPostMessageRequest Methods The following are methods for `ChatPostMessageRequest`. #### builder() **Signature** ```java public static Slack.ChatPostMessageRequest.Builder builder() ``` **Return Value** Type: `Slack.ChatPostMessageRequest.Builder` --- ## ChatPostMessageRequest.Builder Class Contains methods to build an instance of the `Slack.ChatPostMessageRequest` class. A Builder object is obtained by invoking one of the `ChatPostMessageRequest.Builder` methods defined by the `ChatPostMessageRequest` class. ### ChatPostMessageRequest.Builder Methods The following are methods for `ChatPostMessageRequest.Builder`. These methods are optional unless specified otherwise. #### attachmentsAsString(attachmentsAsString) Required if `text(text)` isn't used. Describes the content of the message. A JSON-based array of structured attachments, presented as a URL-encoded string. If this method is used, `text(text)` is fallback text for notifications only. **Signature** ```java public Slack.ChatPostMessageRequest.Builder attachmentsAsString(String attachmentsAsString) ``` **Parameters** _attachmentsAsString_ Type: String **Return Value** Type: Slack.ChatPostMessageRequest.Builder #### build() Required. Builds an instance of `Slack.ChatPostMessageRequest`. **Signature** ```java public Slack.ChatPostMessageRequest build() ``` **Return Value** Type: Slack.ChatPostMessageRequest #### channel(channel) Required. The ID or name of the channel, private group, or IM channel to send the message to. See [Slack's channels usage info](https://api.slack.com/methods/chat.postMessage#channels). **Signature** ```java public Slack.ChatPostMessageRequest.Builder channel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: Slack.ChatPostMessageRequest.Builder #### iconEmoji(iconEmoji) The emoji to use the icon for this message. Overrides the icon URL. Use an icon emoji with the `chat:write:customize` scope only. Otherwise, this is ignored. **Signature** ```java public Slack.ChatPostMessageRequest.Builder iconEmoji(String iconEmoji) ``` **Parameters** _iconEmoji_ Type: String **Return Value** Type: Slack.ChatPostMessageRequest.Builder #### iconUrl(iconUrl) URL to an image to use as the icon for this message. Use an icon URL with the `chat:write:customize` scope only. Otherwise, this is ignored. **Parameters** _iconUrl_ Type: String **Return Value** Type: Slack.ChatPostMessageRequest.Builder #### linkNames(linkNames) **Signature** ```java public Slack.ChatPostMessageRequest.Builder linkNames(Boolean linkNames) ``` **Parameters** _linkNames_ Type: Boolean **Return Value** Type: Slack.ChatPostMessageRequest.Builder #### mrkdwn(mrkdwn) Specifies whether Slack markup parsing is enabled. Defaults to enabled (true). **Signature** ```java public Slack.ChatPostMessageRequest.Builder mrkdwn(Boolean mrkdwn) ``` **Parameters** _mrkdwn_ Type: Boolean **Return Value** Type: Slack.ChatPostMessageRequest.Builder #### parse(parse) Changes how messages are treated. See [Formatting messages](https://api.slack.com/methods/chat.postMessage#formatting). **Signature** ```java public Slack.ChatPostMessageRequest.Builder parse(String parse) ``` **Parameters** _parse_ Type: String **Return Value** Type: Slack.ChatPostMessageRequest.Builder #### replyBroadcast(replyBroadcast) **Signature** ```java public Slack.ChatPostMessageRequest.Builder replyBroadcast(Boolean replyBroadcast) ``` **Parameters** _replyBroadcast_ Type: Boolean **Return Value** Type: Slack.ChatPostMessageRequest.Builder #### text(text) Required only if `attachmentsAsString()` isn't used. If `attachmentsAsString()` is used, `text(text)` is fallback text for notifications only. **Signature** ```java public Slack.ChatPostMessageRequest.Builder text(String text) ``` **Parameters** _text_ Type: String **Return Value** Type: Slack.ChatPostMessageRequest.Builder #### threadTs(threadTs) **Signature** ```java public Slack.ChatPostMessageRequest.Builder threadTs(String threadTs) ``` **Parameters** _threadTs_ Type: String **Return Value** Type: Slack.ChatPostMessageRequest.Builder #### unfurlLinks(unfurlLinks) **Signature** ```java public Slack.ChatPostMessageRequest.Builder unfurlLinks(Boolean unfurlLinks) ``` **Parameters** _unfurlLinks_ Type: Boolean **Return Value** Type: Slack.ChatPostMessageRequest.Builder #### unfurlMedia(unfurlMedia) **Signature** ```java public Slack.ChatPostMessageRequest.Builder unfurlMedia(Boolean unfurlMedia) ``` **Parameters** _unfurlMedia_ Type: Boolean **Return Value** Type: Slack.ChatPostMessageRequest.Builder #### username(username) **Signature** ```java public Slack.ChatPostMessageRequest.Builder username(String username) ``` **Parameters** _username_ Type: String **Return Value** Type: Slack.ChatPostMessageRequest.Builder #### viewReference(viewReference) **Signature** ```java public Slack.ChatPostMessageRequest.Builder viewReference(Slack.ViewReference viewReference) ``` **Parameters** _viewReference_ Type: Slack.ViewReference **Return Value** Type: Slack.ChatPostMessageRequest.Builder --- ## ChatPostMessageResponse Class Posts a message to a channel. **Usage** See Slack’s [chat.](https://api.slack.com/methods/chat.postMessage)[postMessage method](https://api.slack.com/methods/chat.postMessage). ### ChatPostMessageResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `ChatPostMessageResponse`. #### getChannel() Gets the ID or name of the channel, private group, or IM channel to send the message to. **Signature** ```java public String getChannel() ``` **Return Value** Type: String #### getDeprecatedArgument() **Signature** ```java public String getDeprecatedArgument() ``` **Return Value** Type: String #### getMessage() **Signature** ```java public Slack.Message getMessage() ``` **Return Value** Type: [Slack.Message](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_messages.md) #### getResponseMetadata() **Signature** ```java public Slack.ErrorResponseMetadata getResponseMetadata() ``` **Return Value** Type: [Slack.ErrorResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#errorresponsemetadata-class) #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### setChannel(channel) **Signature** ```java public void setChannel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: void #### setDeprecatedArgument(deprecatedArgument) **Signature** ```java public void setDeprecatedArgument(String deprecatedArgument) ``` **Parameters** _deprecatedArgument_ Type: String **Return Value** Type: void #### setMessage(message) **Signature** ```java public void setMessage(Slack.Message message) ``` **Parameters** _message_ Type: [Slack.Message](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_messages.md) **Return Value** Type: void #### setResponseMetadata(responseMetadata) **Signature** ```java public void setResponseMetadata(Slack.ErrorResponseMetadata responseMetadata) ``` **Parameters** _responseMetadata_ Type: [Slack.ErrorResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#errorresponsemetadata-class) **Return Value** Type: void #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void --- ## ChatScheduledMessagesListRequest Class Sends a request to return a list of scheduled messages. **Usage** See Slack’s [chat.scheduleMessages.list method](https://api.slack.com/methods/chat.scheduledMessages.list). ### ChatScheduledMessagesListRequest Methods The following are methods for `ChatScheduledMessagesListRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.ChatScheduledMessagesListRequest.Builder builder() ``` **Return Value** Type: Slack.ChatScheduledMessagesListRequest.Builder --- ## ChatScheduledMessagesListRequest.Builder Class Contains methods to build an instance of the `Slack.ChatScheduledMessagesListRequest` class. A Builder object is obtained by invoking one of the `ChatScheduledMessagesListRequest.Builder` methods defined by the `ChatScheduledMessagesListRequest` class. ### ChatScheduledMessagesListRequest.Builder Methods The following are methods for `ChatScheduledMessagesListRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Builds an instance of `Slack.ChatScheduledMessagesListRequest`. **Signature** ```java public Slack.ChatScheduledMessagesListRequest build() ``` **Return Value** Type: Type: Slack.ChatScheduledMessagesListRequest #### channel(channel) **Signature** ```java public Slack.ChatScheduledMessagesListRequest.Builder channel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: Slack.ChatScheduledMessagesListRequest.Builder #### cursor(cursor) **Signature** ```java public Slack.ChatScheduledMessagesListRequest.Builder cursor(String cursor) ``` **Parameters** _cursor_ Type: String **Return Value** Type: Slack.ChatScheduledMessagesListRequest.Builder #### latest(latest) **Signature** ```java public Slack.ChatScheduledMessagesListRequest.Builder latest(String latest) ``` **Parameters** _latest_ Type: String **Return Value** Type: Slack.ChatScheduledMessagesListRequest.Builder #### limitValue(limitValue) **Signature** ```java public Slack.ChatScheduledMessagesListRequest.Builder limitValue(Integer limitValue) ``` **Parameters** _limitValue_ Type: Integer **Return Value** Type: Slack.ChatScheduledMessagesListRequest.Builder #### oldest(oldest) **Signature** ```java public Slack.ChatScheduledMessagesListRequest.Builder oldest(String oldest) ``` **Parameters** _oldest_ Type: String **Return Value** Type: Slack.ChatScheduledMessagesListRequest.Builder #### teamId(teamId) **Signature** ```java public Slack.ChatScheduledMessagesListRequest.Builder teamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: Slack.ChatScheduledMessagesListRequest.Builder --- ## ChatScheduledMessagesListResponse Class Returns a list of scheduled messages. ### ChatScheduledMessagesListResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `ChatScheduledMessagesListResponse`. #### getResponseMetadata() **Signature** ```java public Slack.ResponseMetadata getResponseMetadata() ``` **Return Value** Type: [Slack.ResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#responsemetadata-class) #### getScheduledMessages() **Signature** ```java public List getScheduledMessages() ``` **Return Value** Type: List #### setResponseMetadata(responseMetadata() **Signature** ```java public void setResponseMetadata(Slack.ResponseMetadata responseMetadata) ``` **Parameters** _responseMetadata_ Type: [Slack.ResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#responsemetadata-class) **Return Value** Type: void #### setScheduledMessages(scheduledMessages) **Signature** ```java public void setScheduledMessages(List scheduledMessages) ``` **Parameters** _scheduledMessages_ Type: List **Return Value** Type: void --- ## ChatScheduledMessagesListResponse.ScheduledMessage Class ### ChatScheduledMessagesListResponse.ScheduledMessage Methods The following are methods for `ChatScheduledMessagesListResponse.ScheduledMessage`. #### getChannelId() Gets the ID of the channel where the scheduled messages are posted to. **Signature** ```java public String getChannelId() ``` **Return Value** Type: String #### getDateCreated() Gets the timestamp of when the scheduled message was created. **Signature** ```java public Integer getDateCreated() ``` **Return Value** Type: Integer #### getId() Gets the ID of the scheduled message. **Signature** ```java public String getId() ``` **Return Value** Type: String #### getPostAt() Gets the timestamp of when the message is to be posted. **Signature** ```java public Integer getPostAt() ``` **Return Value** Type: Integer #### getText() Gets the content of the message. **Signature** ```java public String getText() ``` **Return Value** Type: String #### setChannelId(channelId) Sets the ID of the channel for which to post the scheduled message. **Signature** ```java public void setChannelId(String channelId) ``` **Parameters** _channelId_ Type: String **Return Value** Type: void #### setDateCreated(dateCreated) Sets the timestamp for when the scheduled message was created. **Signature** ```java public void setDateCreated(Integer dateCreated) ``` **Parameters** _dateCreated_ Type: Integer **Return Value** Type: void #### setId(id) **Signature** ```java public void setId(String id) ``` **Parameters** _id_ Type: String **Return Value** Type: void #### setPostAt(postAt) Sets the timestamp for when the message is scheduled to be posted. **Signature** ```java public void setPostAt(Integer postAt) ``` **Parameters** _postAt_ Type: Integer **Return Value** Type: void #### setText(text) **Signature** ```java public void setText(String text) ``` **Parameters** _text_ Type: String **Return Value** Type: void --- ## ChatScheduleMessageRequest Class Sends a request to schedule a message to be sent to a channel. **Usage** See Slack’s [chat.scheduleMessage method](https://api.slack.com/methods/chat.scheduleMessage). **note:** Consider using `chat:write` scope on the user token only in response to an inciting user action and inform users that a message will be posted on their behalf. See [Sending messages as other entities](https://api.slack.com/methods/chat.postMessage#authorship). ### ChatScheduleMessageRequest Methods The following are methods for `ChatScheduleMessageRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.ChatScheduleMessageRequest.Builder builder() ``` **Return Value** Type: Slack.ChatScheduleMessageRequest.Builder --- ## ChatScheduleMessageRequest.Builder Class Contains methods to build an instance of the `Slack.ChatScheduleMessageRequest` class. A Builder object is obtained by invoking one of the `ChatScheduleMessageRequest.Builder` methods defined by the `ChatScheduleMessageRequest` class. ### ChatScheduleMessageRequest.Builder Methods The following are methods for `ChatScheduleMessageRequest.Builder`. These methods are optional unless specified otherwise. #### attachmentsAsString(attachmentsAsString) **Signature** ```java public Slack.ChatScheduleMessageRequest.Builder attachmentsAsString(String attachmentsAsString) ``` **Parameters** _attachmentsAsString_ Type: String **Return Value** Type: Slack.ChatScheduleMessageRequest.Builder #### build() Required. Builds an instance of `Slack.ChatScheduleMessageRequest`. **Signature** ```java public Slack.ChatScheduleMessageRequest build() ``` **Return Value** Type: Slack.ChatScheduleMessageRequest #### channel(channel) Required. The ID or name of the channel, private group, or DM channel to send the message to. See [Slack's channels usage info](https://api.slack.com/methods/chat.scheduleMessage#channels). **Signature** ```java public Slack.ChatScheduleMessageRequest.Builder channel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: Slack.ChatScheduleMessageRequest.Builder #### linkNames(linkNames) **Signature** ```java public Slack.ChatScheduleMessageRequest.Builder linkNames(Boolean linkNames) ``` **Parameters** _linkNames_ Type: Boolean **Return Value** Type: Slack.ChatScheduleMessageRequest.Builder #### parse(parse) Changes how messages are treated. See [chat.postMessage](https://api.slack.com/methods/chat.postMessage#formatting). **Signature** ```java public Slack.ChatScheduleMessageRequest.Builder parse(String parse) ``` **Parameters** _parse_ Type: String **Return Value** Type: Slack.ChatScheduleMessageRequest.Builder #### setPostAt(postAt) Required. Sets the Unix EPOCH timestamp for when the message is scheduled to be posted. **Signature** ```java public Slack.ChatScheduleMessageRequest.Builder setPostAt(Integer postAt) ``` **Parameters** _postAt_ Type: Integer **Return Value** Type: Slack.ChatScheduleMessageRequest.Builder #### replyBroadcast(replyBroadcast) **Signature** ```java public Slack.ChatScheduleMessageRequest.Builder replyBroadcast(Boolean replyBroadcast) ``` **Parameters** _replyBroadcast_ Type: Boolean **Return Value** Type: Slack.ChatScheduleMessageRequest.Builder #### text(text) Required. The text for the message. If you include an optional viewReference to render the message, Slack will use "text" as a fallback string. See [Slack's text usage info](https://api.slack.com/methods/chat.scheduleMessage#arg_text). **Signature** ```java public Slack.ChatScheduleMessageRequest.Builder text(String text) ``` **Parameters** _text_ Type: String **Return Value** Type: Slack.ChatScheduleMessageRequest.Builder #### threadTs(threadTs) **Signature** ```java public Slack.ChatScheduleMessageRequest.Builder threadTs(String threadTs) ``` **Parameters** _threadTs_ Type: String **Return Value** Type: Slack.ChatScheduleMessageRequest.Builder #### unfurlLinks(unfurlLinks) **Signature** ```java public Slack.ChatScheduleMessageRequest.Builder unfurlLinks(Boolean unfurlLinks) ``` **Parameters** _unfurlLinks_ Type: Boolean **Return Value** Type: Slack.ChatScheduleMessageRequest.Builder #### unfurlMedia(unfurlMedia) **Signature** ```java public Slack.ChatScheduleMessageRequest.Builder unfurlMedia(Boolean unfurlMedia) ``` **Parameters** _unfurlMedia_ Type: Boolean **Return Value** Type: Slack.ChatScheduleMessageRequest.Builder #### viewReference(viewReference) **Signature** ```java public Slack.ChatScheduleMessageRequest.Builder viewReference(Slack.ViewReference viewReference) ``` **Parameters** _viewReference_ Type: Slack.ViewReference **Return Value** Type: Slack.ChatScheduleMessageRequest.Builder --- ## ChatScheduleMessageResponse Class Schedules a message to be sent to a channel. **Usage** See Slack’s [chat.scheduleMessage method](https://api.slack.com/methods/chat.scheduleMessage). ### ChatScheduleMessageResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `ChatScheduleMessageResponse`. #### getChannel() **Signature** ```java public String getChannel() ``` **Return Value** Type: String #### getMessage() **Signature** ```java public Slack.ChatScheduleMessageResponse.ScheduledMessage getMessage() ``` **Return Value** Type: Slack.ChatScheduleMessageResponse.ScheduledMessage #### getPostAt() **Signature** ```java public Integer getPostAt() ``` **Return Value** Type: Integer #### getScheduledMessageId() **Signature** ```java public String getScheduledMessageId() ``` **Return Value** Type: String #### setChannel(channel) **Signature** ```java public void setChannel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: void #### setMessage(message) **Signature** ```java public void setMessage(Slack.ChatScheduleMessageResponse.ScheduledMessage message) ``` **Parameters** _message_ Type: Slack.ChatScheduleMessageResponse.ScheduledMessage **Return Value** Type: void #### postAt(postAt) **Signature** ```java public void postAt(Integer postAt) ``` **Parameters** _postAt_ Type: Integer **Return Value** Type: void #### setScheduledMessageId(scheduledMessageId) **Signature** ```java public void setScheduledMessageId(String scheduledMessageId) ``` **Parameters** _scheduledMessageId_ Type: String **Return Value** Type: void --- ## ChatScheduleMessageResponse.ScheduledMessage Class ### ChatScheduleMessageResponse.ScheduledMessage Methods The following are methods for `ChatScheduleMessageResponse.ScheduledMessage`. #### getBotId() **Signature** ```java public String getBotId() ``` **Return Value** Type: String #### getBotProfile() **Signature** ```java public Slack.BotProfile getBotProfile() ``` **Return Value** Type: [Slack.BotProfile](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_bot.md#botprofile-class) #### getTeam() **Signature** ```java public String getTeam() ``` **Return Value** Type: String #### getText() **Signature** ```java public String getText() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### setBotId(botId) **Signature** ```java public void setBotId(String botId) ``` **Parameters** _botId_ Type: String **Return Value** Type: void #### setBotProfile(botProfile) **Signature** ```java public void setBotProfile(Slack.BotProfile botProfile) ``` **Parameters** _botProfile_ Type: [Slack.BotProfile](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_bot.md#botprofile-class) **Return Value** Type: void #### setTeam(team) **Signature** ```java public void setTeam(String team) ``` **Parameters** _team_ Type: String **Return Value** Type: void #### setText(text) **Signature** ```java public void setText(String text) ``` **Parameters** _text_ Type: String **Return Value** Type: void #### setType(type) **Signature** ```java public void setType(String type) ``` **Parameters** _type_ Type: String **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void --- ## ChatUpdateRequest Class Sends a request to update a message. **Usage** See Slack’s [chat.update method](https://api.slack.com/methods/chat.update). **note:** Consider using `chat:write` scope on the user token only in response to an inciting user action and give users a heads up that the message will be updated on their behalf. See [Sending messages as other entities](https://api.slack.com/methods/chat.postMessage#authorship). ### ChatUpdateRequest Methods The following are methods for `ChatUpdateRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.ChatUpdateRequest.Builder builder() ``` **Return Value** Type: Slack.ChatUpdateRequest.Builder --- ## ChatUpdateRequest.Builder Class Contains methods to build an instance of the `Slack.ChatUpdateRequest` class. A Builder object is obtained by invoking one of the `ChatUpdateRequest.Builder` methods defined by the `ChatUpdateRequest` class. ### ChatUpdateRequest.Builder Methods The following are methods for `ChatUpdateRequest.Builder`. These methods are optional unless specified otherwise. #### attachmentsAsString(attachmentsAsString) **Signature** ```java public Slack.ChatUpdateRequest.Builder attachmentsAsString(String attachmentsAsString) ``` **Parameters** _attachmentsAsString_ Type: String **Return Value** Type: Slack.ChatUpdateRequest.Builder #### build() Required. Builds an instance of `Slack.ChatUpdateRequest`. **Signature** ```java public Slack.ChatUpdateRequest build() ``` **Return Value** Type: Slack.ChatUpdateRequest #### channel(channel) Required. The channel containing the message to be updated. **Signature** ```java public Slack.ChatUpdateRequest.Builder channel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: Slack.ChatUpdateRequest.Builder #### linkNames(linkNames) **Signature** ```java public Slack.ChatUpdateRequest.Builder linkNames(Boolean linkNames) ``` **Parameters** _linkNames_ Type: Boolean **Return Value** Type: Slack.ChatUpdateRequest.Builder #### parse(parse) **Signature** ```java public Slack.ChatUpdateRequest.Builder parse(String parse) ``` **Parameters** _parse_ Type: String **Return Value** Type: Slack.ChatUpdateRequest.Builder #### text(text) **Signature** ```java public Slack.ChatUpdateRequest.Builder text(String text) ``` **Parameters** _text_ Type: String **Return Value** Type: Slack.ChatUpdateRequest.Builder #### ts(ts) Required. The timestamp of the message to be updated. **Signature** ```java public Slack.ChatUpdateRequest.Builder ts(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: Slack.ChatUpdateRequest.Builder #### viewReference(viewReference) **Signature** ```java public Slack.ChatUpdateRequest.Builder viewReference(Slack.ViewReference viewReference) ``` **Parameters** _viewReference_ Type: Slack.ViewReference **Return Value** Type: Slack.ChatUpdateRequest.Builder --- ## ChatUpdateResponse Class Updates a message. ### ChatUpdateResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `ChatUpdateResponse`. #### getChannel() The channel containing the message to be updated. **Signature** ```java public String getChannel() ``` **Return Type** Type: String #### getDeprecatedArgument() **Signature** ```java public String getDeprecatedArgument() ``` **Return Value** Type: String #### getMessage() **Signature** ```java public Slack.Message getMessage() ``` **Return Value** Type: [Slack.Message](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_messages.md) #### getText() The text of the message. **Signature** ```java public string getText() ``` **Return Type** Type: String #### getTs() Gets the timestamp of the message to be updated. **Signature** ```java public String getTs() ``` **Return Value** Type: String #### setChannel(channel) **Signature** ```java public void setChannel(String channel) ``` **Parameters** _channel_ Type: String The channel containing the message to be deleted. **Return Value** Type: void #### setDeprecatedArgument(deprecatedArgument) **Signature** ```java public void setDeprecatedArgument(String deprecatedArgument) ``` **Parameters** _deprecatedArgument_ Type: String **Return Value** Type: void #### setMessage(message) **Signature** ```java public void setMessage(Slack.Message message) ``` **Parameters** _message_ Type: [Slack.Message](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_messages.md) **Return Value** Type: void #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void # Work with Conversations The following are Apex classes for the Slack `conversations` [API methods](https://api.slack.com/methods?filter=conversations). ## Conversation Class Represents information about a channel, which can be a public channel, private channel, direct message (DM), or a multi-person direct message (Mpim). **Usage** See [Slack's `conversation` object type](https://api.slack.com/types/conversation). ### Conversation Methods The following are methods for `Conversation`. #### getConnectedLimitedTeamIds() **Signature** ```java public List getConnectedLimitedTeamIds() ``` **Return Value** Type: List\ #### getConnectedTeamIds() **Signature** ```java public List getConnectedTeamIds() ``` **Return Value** Type: List\ #### getConversationHostId() **Signature** ```java public String getConversationHostId() ``` **Return Value** Type: String #### getCreated() **Signature** ```java public String getCreated() ``` **Return Value** Type: String #### getCreator() **Signature** ```java public String getCreator() ``` **Return Value** Type: String #### getDateConnected() **Signature** ```java public Integer getDateConnected() ``` **Return Value** Type: Integer #### getEnterpriseId() **Signature** ```java public String getEnterpriseId() ``` **Return Value** Type: String #### getId() **Signature** ```java public String getId() ``` **Return Value** Type: String #### getInternalTeamIds() **Signature** ```java public List getInternalTeamIds() ``` **Return Value** Type: List\ #### getIsMoved() **Signature** ```java public Integer getIsMoved() ``` **Return Value** Type: Integer #### getIsUserDeleted() **Signature** ```java public Boolean getIsUserDeleted() ``` **Return Value** Type: Boolean #### getLastRead() **Signature** ```java public String getLastRead() ``` **Return Value** Type: String #### getLatest() **Signature** ```java public Slack.Latest getLatest() ``` **Return Value** Type: [Slack.Latest](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_latest.md) #### getLocale() **Signature** ```java public String getLocale() ``` **Return Value** Type: String #### getName() **Signature** ```java public String getName() ``` **Return Value** Type: String #### getNameNormalized() **Signature** ```java public String getNameNormalized() ``` **Return Value** Type: String #### getNumOfMembers() **Signature** ```java public Integer getNumOfMembers() ``` **Return Value** Type: Integer #### getParentConversation() **Signature** ```java public String getParentConversation() ``` **Return Value** Type: String #### getPendingConnectedTeamIds() **Signature** ```java public List getPendingConnectedTeamIds() ``` **Return Value** Type: List\ #### getPendingShared() **Signature** ```java public List getPendingShared() ``` **Return Value** Type: List\ #### getPreviousNames() **Signature** ```java public List getPreviousNames() ``` **Return Value** Type: List\ #### getPriority() **Signature** ```java public Double getPriority() ``` **Return Value** Type: Double #### getPurpose() **Signature** ```java public Slack.Purpose getPurpose() ``` **Return Value** Type: [Slack.Purpose](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_purpose.md) #### getSharedTeamIds() **Signature** ```java public List getSharedTeamIds() ``` **Return Value** Type: List\ #### getTopic() **Signature** ```java public Slack.Topic getTopic() ``` **Return Value** Type: [Slack.Topic](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_topics.md) #### getUnlinked() **Signature** ```java public Integer getUnlinked() ``` **Return Value** Type: Integer #### getUnreadCount() **Signature** ```java public Integer getUnreadCount() ``` **Return Value** Type: Integer #### getUnreadCountDisplay() **Signature** ```java public Integer getUnreadCountDisplay() ``` **Return Value** Type: Integer #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### isArchived() **Signature** ```java public Boolean isArchived() ``` **Return Value** Type: Boolean #### isChannel() **Signature** ```java public Boolean isChannel() ``` **Return Value** Type: Boolean #### isExtShared() **Signature** ```java public Boolean isExtShared() ``` **Return Value** Type: Boolean #### isGeneral() **Signature** ```java public Boolean isGeneral() ``` **Return Value** Type: Boolean #### isGlobalShared() **Signature** ```java public Boolean isGlobalShared() ``` **Return Value** Type: Boolean #### isGroup() **Signature** ```java public Boolean isGroup() ``` **Return Value** Type: Boolean #### isIm() **Signature** ```java public Boolean isIm() ``` **Return Value** Type: Boolean #### isMember() **Signature** ```java public Boolean isMember() ``` **Return Value** Type: Boolean #### isMpim() **Signature** ```java public Boolean isMpim() ``` **Return Value** Type: Boolean #### isNonThreadable() **Signature** ```java public Boolean isNonThreadable() ``` **Return Value** Type: Boolean #### isOpen() **Signature** ```java public Boolean isOpen() ``` **Return Value** Type: Boolean #### isOrgDefault() **Signature** ```java public Boolean isOrgDefault() ``` **Return Value** Type: Boolean #### isOrgMandatory() **Signature** ```java public Boolean isOrgMandatory() ``` **Return Value** Type: Boolean #### isOrgShared() **Signature** ```java public Boolean isOrgShared() ``` **Return Value** Type:Boolean #### isPendingExtShared() **Signature** ```java public Boolean isPendingExtShared() ``` **Return Value** Type: Boolean #### isPrivate() **Signature** ```java public Boolean isPrivate() ``` **Return Value** Type: Boolean #### isReadOnly() **Signature** ```java public Boolean isReadOnly() ``` **Return Value** Type: Boolean #### isShared() **Signature** ```java public Boolean isShared() ``` **Return Value** Type: Boolean #### isStarred() **Signature** ```java public Boolean isStarred() ``` **Return Value** Type: Boolean #### isThreadOnly() **Signature** ```java public Boolean isThreadOnly() ``` **Return Value** Type: Boolean #### setIsUserDeleted(isUserDeleted) **Signature** ```java public void setIsUserDeleted(Boolean isUserDeleted) ``` **Parameters** isUserDeleted Type: Boolean **Return Value** Type: void #### setArchived(isArchived) **Signature** ```java public void setArchived(Boolean isArchived) ``` **Parameters** _isArchived_ Type: Boolean **Return Value** Type: void #### setChannel(isChannel) **Signature** ```java public void setChannel(Boolean isChannel) ``` **Parameters** _isChannel_ Type: Boolean **Return Value** Type: void #### setConnectedLimitedTeamIds(connectedLimitedTeamIds) **Signature** ```java public void setConnectedLimitedTeamIds(List connectedLimitedTeamIds) ``` **Parameters** connectedLimitedTeamIds Type: List\ **Return Value** Type: void #### setConnectedTeamIds(connectedTeamIds) **Signature** ```java public void setConnectedTeamIds(List connectedTeamIds) ``` **Parameters** _connectedTeamIds_ Type: List\ **Return Value** Type: void #### setConversationHostId(conversationHostId) **Signature** ```java public void setConversationHostId(String conversationHostId) ``` **Parameters** _conversationHostId_ Type: String **Return Value** Type: void #### setCreated(created) **Signature** ```java public void setCreated(String created) ``` **Parameters** _created_ Type: String **Return Value** Type: void #### setCreator(creator) **Signature** ```java public void setCreator(String creator) ``` **Parameters** _creator_ Type: String **Return Value** Type: void #### setDateConnected(dateConnected) **Signature** ```java public void setDateConnected(Integer dateConnected) ``` **Parameters** _dateConnected_ Type: Integer **Return Value** Type: void #### setEnterpriseId() **Signature** ```java public void setEnterpriseId(String enterpriseId) ``` **Parameters** _enterpriseId_ Type: String **Return Value** Type: void #### setExtShared(isExtShared) **Signature** ```java public void setExtShared(Boolean isExtShared) ``` **Parameters** _isExtShared_ Type: Boolean **Return Value** Type: void #### setGeneral(isGeneral) **Signature** ```java public void setGeneral(Boolean isGeneral) ``` **Parameters** _isGeneral_ Type: Boolean **Return Value** Type: void #### setGlobalShared(globalShared) **Signature** ```java public void setGlobalShared(Boolean globalShared) ``` **Parameters** _globalShared_ Type: Boolean **Return Value** Type: void #### setGroup(isGroup) **Signature** ```java public void setGroup(Boolean isGroup) ``` **Parameters** _isGroup_ Type: Boolean **Return Value** Type: void #### setId(id) **Signature** ```java public void setId(String id) ``` **Parameters** _id_ Type: String **Return Value** Type: void #### setIm(isIm) **Signature** ```java public void setIm(Boolean isIm) ``` **Parameters** _isIm_ Type: Boolean **Return Value** Type: void #### setInternalTeamIds(internalTeamIds) **Signature** ```java public void setInternalTeamIds(List internalTeamIds) ``` **Parameters** _internalTeamIds_ Type: List\ **Return Value** Type: void #### setIsMoved(isMoved) **Signature** ```java public void setIsMoved(Integer isMoved) ``` **Parameters** _isMoved_ Type: Integer **Return Value** Type: void #### setLastRead(lastRead) **Signature** ```java public void setLastRead(String lastRead) ``` **Parameters** _lastRead_ Type: String **Return Value** Type: void #### setLatest(latest) **Signature** ```java public void setLatest(Slack.Latest latest) ``` **Parameters** _latest_ Type: [Slack.Latest](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_latest.md) **Return Value** Type: void #### setLocale(locale) **Signature** ```java public void setLocale(String locale) ``` **Parameters** _locale_ Type: String **Return Value** Type: void #### setMember(isMember) **Signature** ```java public void setMember(Boolean isMember) ``` **Parameters** _isMember_ Type: Boolean **Return Value** Type: void #### setMpim(isMpim) **Signature** ```java public void setMpim(Boolean isMpim) ``` **Parameters** _isMpim_ Type: Boolean **Return Value** Type: void #### setName(name) **Signature** ```java public void setName(String name) ``` **Parameters** _name_ Type: String **Return Value** Type: void #### setNameNormalized(nameNormalized) **Signature** ```java public void setNameNormalized(String nameNormalized) ``` **Parameters** _nameNormalized_ Type: String **Return Value** Type: void #### setNonThreadable(isNonThreadable) **Signature** ```java public void setNonThreadable(Boolean isNonThreadable) ``` **Parameters** _isNonThreadable_ Type: Boolean **Return Value** Type: void #### setNumOfMembers(numOfMembers) **Signature** ```java public void setNumOfMembers(Integer numOfMembers) ``` **Parameters** _numOfMembers_ Type: Integer **Return Value** Type: void #### setOpen(open) **Signature** ```java public void setOpen(Boolean open) ``` **Parameters** _open_ Type: Boolean **Return Value** Type: void #### setOrgDefault(orgDefault) **Signature** ```java public void setOrgDefault(Boolean orgDefault) ``` **Parameters** _orgDefault_ Type: Boolean **Return Value** Type: void #### setOrgMandatory(orgMandatory) **Signature** ```java public void setOrgMandatory(Boolean orgMandatory) ``` **Parameters** _orgMandatory_ Type: Boolean **Return Value** Type: void #### setOrgShared(isOrgShared) **Signature** ```java public void setOrgShared(Boolean isOrgShared) ``` **Parameters** _isOrgShared_ Type: Boolean **Return Value** Type: void #### setParentConversation(parentConversation) **Signature** ```java public void setParentConversation(String parentConversation) ``` **Parameters** _parentConversation_ Type: String **Return Value** Type: void #### setPendingConnectedTeamIds(pendingConnectedTeamIds) **Signature** ```java public void setPendingConnectedTeamIds(List pendingConnectedTeamIds) ``` **Parameters** _pendingConnectedTeamIds_ Type: List\ **Return Value** Type: void #### setPendingExtShared(isPendingExtShared) **Signature** ```java public void setPendingExtShared(Boolean isPendingExtShared) ``` **Parameters** _isPendingExtShared_ Type: Boolean **Return Value** Type: void #### setPendingShared(pendingShared) **Signature** ```java public void setPendingShared(List pendingShared) ``` **Parameters** _pendingShared_ Type: List\ **Return Value** Type: void #### setPreviousNames(previousNames) **Signature** ```java public void setPreviousNames(List previousNames) ``` **Parameters** _previousNames_ Type: List\ **Return Value** Type: void #### setPriority(priority) **Signature** ```java public void setPriority(Double priority) ``` **Parameters** _priority_ Type: Double **Return Value** Type: void #### setPrivate(isPrivate) **Signature** ```java public void setPrivate(Boolean isPrivate) ``` **Parameters** _isPrivate_ Type: Boolean **Return Value** Type: void #### setPurpose(purpose) **Signature** ```java public void setPurpose(Slack.Purpose purpose) ``` **Parameters** _purpose_ Type: [Slack.Purpose](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_purpose.md) **Return Value** Type: void #### setReadOnly(isReadOnly) **Signature** ```java public void setReadOnly(Boolean isReadOnly) ``` **Parameters** _isReadOnly_ Type: Boolean **Return Value** Type: void #### setShared(isShared) **Signature** ```java public void setShared(Boolean isShared) ``` **Parameters** _isShared_ Type: Boolean **Return Value** Type: void #### setSharedTeamIds(sharedTeamIds) **Signature** ```java public void setSharedTeamIds(List sharedTeamIds) ``` **Parameters** _sharedTeamIds_ Type: List\ **Return Value** Type: void #### setStarred(isStarred) **Signature** ```java public void setStarred(Boolean isStarred) ``` **Parameters** isStarred Type: Boolean **Return Value** Type: void #### setThreadOnly(isThreadOnly) **Signature** ```java public void setThreadOnly(Boolean isThreadOnly) ``` **Parameters** _isThreadOnly_ Type: Boolean **Return Value** Type: void #### setTopic(topic) **Signature** ```java public void setTopic(Slack.Topic topic) ``` **Parameters** _topic_ Type: [Slack.Topic](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_topics.md) **Return Value** Type:void #### setUnlinked(unlinked) **Signature** ```java public void setUnlinked(Integer unlinked) ``` **Parameters** _unlinked_ Type: Integer **Return Value** Type: void #### setUnreadCount(unreadCount) **Signature** ```java public void setUnreadCount(Integer unreadCount) ``` **Parameters** _unreadCount_ Type: Integer **Return Value** Type: void #### setUnreadCountDisplay(unreadCountDisplay) **Signature** ```java public void setUnreadCountDisplay(Integer unreadCountDisplay) ``` **Parameters** _unreadCountDisplay_ Type: Integer **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void --- ## ConversationsArchiveRequest Class Sends a request to archive a conversation. **Usage** See Slack’s [conversations.archive method](https://api.slack.com/methods/conversations.archive). ### ConversationsArchiveRequest Methods The following are methods for `ConversationsArchiveRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.ConversationsArchiveRequest.Builder builder() ``` **Return Value** Type: Slack.ConversationsArchiveRequest.Builder --- ## ConversationsArchiveRequest.Builder Class Contains methods to build an instance of the `Slack.ConversationsArchiveRequest` class. A Builder object is obtained by invoking one of the `ConversationsArchiveRequest.Builder` methods defined by the `ConversationsArchiveRequest` class. ### ConversationsArchiveRequest.Builder Methods The following are methods for `ConversationsArchiveRequest.Builder`. #### build() Required. Builds an instance of `Slack.ConversationsArchiveRequest`. **Signature** ```java public Slack.ConversationsArchiveRequest build() ``` **Return Value** Type: Slack.ConversationsArchiveRequest #### channel(channel) Required. The ID of the conversation to archive. **Signature** ```java public Slack.ConversationsArchiveRequest.Builder channel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: Slack.ConversationsArchiveRequest.Builder --- ## ConversationsArchiveResponse Class Archives a conversation. **Usage** See Slack’s [conversations.archive method](https://api.slack.com/methods/conversations.archive). ### ConversationsArchiveResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). --- ## ConversationsCloseRequest Class Sends a request to close a direct message or multi-person direct message. **Usage** See Slack’s [conversations.close method](https://api.slack.com/methods/conversations.close). ### ConversationsCloseRequest Methods #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.ConversationsCloseRequest.Builder builder() ``` **Return Value** Type: Slack.ConversationsCloseRequest.Builder --- ## ConversationsCloseRequest.Builder Class Contains methods to build an instance of the `Slack.ConversationsCloseRequest` class. A Builder object is obtained by invoking one of the `ConversationsCloseRequest.Builder` methods defined by the `ConversationsCloseRequest` class. ### ConversationsCloseRequest.Builder Methods The following are methods for `ConversationsCloseRequest.Builder`. #### build() Required. Builds an instance of `Slack.ConversationsCloseRequest`. **Signature** ```java public Slack.ConversationsCloseRequest build() ``` **Return Value** Type: Slack.ConversationsCloseRequest #### channel(channel) Required. The ID of the conversation to close. **Signature** ```java public Slack.ConversationsCloseRequest.Builder channel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: Slack.ConversationsCloseRequest.Builder --- ## ConversationsCloseResponse Class Closes a direct message or multi-person direct message. ### ConversationsCloseResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `ConversationsCloseResponse`. #### getAlreadyClosed() Specifies whether the conversation is already closed. **Signature** ```java public Boolean getAlreadyClosed() ``` **Return Value** Type: Boolean #### getNoOp() **Signature** ```java public Boolean getNoOp() ``` **Return Value** Type: Boolean #### setAlreadyClosed(alreadyClosed) **Signature** ```java public void setAlreadyClosed(Boolean alreadyClosed) ``` **Parameters** _alreadyClosed_ Type: Boolean **Return Value** Type: void #### setNoOp(noOp) **Signature** ```java public void setNoOp(Boolean noOp) ``` **Parameters** _noOp_ Type: Boolean **Return Value** Type: void --- ## ConversationsCreateRequest Class Sends a request to initiate a public or private channel-based conversation. **Usage** ```java Slack.App app = Slack.App.ApexSlackApp.get(); Slack.BotClient botClient = app.getBotClientForTeam(context.getTeamId()); Slack.ConversationsCreateRequest req = new Slack.ConversationsCreateRequest.builder() .name(channelToCreate) .isprivate(false) .build(); Slack.ConversationsCreateResponse response = BotClient.conversationsCreate(req); ``` For example, you can enable users to create a channel by issuing a message by [subscribing and handling the `message` event](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/events_examples.md). See Slack’s [conversations.create method](https://api.slack.com/methods/conversations.create). ### ConversationsCreateRequest Methods The following are methods for `ConversationsCreateRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.ConversationsCreateRequest.Builder builder() ``` **Return Value** Type: Slack.ConversationsCreateRequest.Builder --- ## ConversationsCreateRequest.Builder Class Contains methods to build an instance of the `Slack.ConversationsCreateRequest` class. A Builder object is obtained by invoking one of the `ConversationsCreateRequest.Builder` methods defined by the `ConversationsCreateRequest` class. ### ConversationsCreateRequest.Builder Methods The following are methods for `ConversationsCreateRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Builds an instance of `Slack.ConversationsCreateRequest`. **Signature** ```java public Slack.ConversationsCreateRequest build() ``` **Return Value** Type: Slack.ConversationsCreateRequest #### isPrivate(isPrivate) **Signature** ```java public Slack.ConversationsCreateRequest.Builder isPrivate(Boolean isPrivate) ``` **Parameters** _isPrivate_ Type: Boolean **Return Value** Type: Slack.ConversationsCreateRequest.Builder #### name(name) Required. The name of the public or private channel to create. **Signature** ```java public Slack.ConversationsCreateRequest.Builder name(String name) ``` **Parameters** _name_ Type: String **Return Value** Type: Slack.ConversationsCreateRequest.Builder #### teamId(teamId) **Signature** ```java public Slack.ConversationsCreateRequest.Builder teamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: Slack.ConversationsCreateRequest.Builder --- ## ConversationsCreateResponse Class Initiates a public or private channel-based conversation. **Usage** See Slack’s [conversations.create method](https://api.slack.com/methods/conversations.create). ### ConversationsCreateResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `ConversationsCreateResponse`. #### getChannel() **Signature** ```java public Slack.Conversation getChannel() ``` **Return Value** Type: Slack.Conversation #### getDetail() **Signature** ```java public String getDetail() ``` **Return Value** Type: String #### setChannel(channel) **Signature** ```java public void setChannel(Slack.Conversation channel) ``` **Parameters** _channel_ Type: Slack.Conversation **Return Value** Type: void #### setDetail(detail) **Signature** ```java public void setDetail(String detail) ``` **Parameters** _detail_ Type: String **Return Value** Type: void --- ## ConversationsHistoryRequest Class Sends a request to fetch a conversation’s history of messages and events. **Usage** See Slack’s [conversations.history method](https://api.slack.com/methods/conversations.history). ### ConversationsHistoryRequest Methods The following are methods for `ConversationsHistoryRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.ConversationsHistoryRequest.Builder builder() ``` **Return Value** Type: Slack.ConversationsHistoryRequest.Builder --- ## ConversationsHistoryRequest.Builder Class Contains methods to build an instance of the `Slack.ConversationsHistoryRequest` class. A Builder object is obtained by invoking one of the `ConversationsHistoryRequest.Builder` methods defined by the `ConversationsHistoryRequest` class. ### ConversationsHistoryRequest.Builder Methods The following are methods for `ConversationsHistoryRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Builds an instance of `Slack.ConversationsHistoryRequest`. **Signature** ```java public Slack.ConversationsHistoryRequest build() ``` **Return Value** Type: Slack.ConversationsHistoryRequest #### channel(channel) Required. The ID of the conversation to fetch history for. **Signature** ```java public Slack.ConversationsHistoryRequest.Builder channel(String channel) ``` **Parameters** _channel_ Type:String **Return Value** Type: Slack.ConversationsHistoryRequest.Builder #### cursor(cursor) **Signature** ```java public Slack.ConversationsHistoryRequest.Builder cursor(String cursor) ``` **Parameters** _cursor_ Type: String **Return Value** Type: Slack.ConversationsHistoryRequest.Builder #### inclusive(inclusive) **Signature** ```java public Slack.ConversationsHistoryRequest.Builder inclusive(Boolean inclusive) ``` **Parameters** _inclusive_ Type: Boolean **Return Value** Type: Slack.ConversationsHistoryRequest.Builder #### latest(latest) **Signature** ```java public Slack.ConversationsHistoryRequest.Builder latest(String latest) ``` **Parameters** _latest_ Type: String **Return Value** Type: Slack.ConversationsHistoryRequest.Builder #### limitValue(limitValue) **Signature** ```java public Slack.ConversationsHistoryRequest.Builder limitValue(Integer limitValue) ``` **Parameters** _limitValue_ Type: Integer **Return Value** Type: Slack.ConversationsHistoryRequest.Builder #### oldest(oldest) **Signature** ```java public Slack.ConversationsHistoryRequest.Builder oldest(String oldest) ``` **Parameters** _oldest_ Type: String **Return Value** Type: Slack.ConversationsHistoryRequest.Builder --- ## ConversationsHistoryResponse Class Fetches a conversation’s history of messages and events. **Usage** See Slack’s [conversations.history method](https://api.slack.com/methods/conversations.history). ### ConversationsHistoryResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `ConversationsHistoryResponse`. #### getChannelActionsCount() **Signature** ```java public Integer getChannelActionsCount() ``` **Return Value** Type: Integer #### getChannelActionsTs() **Signature** ```java public String getChannelActionsTs() ``` **Return Value** Type: String #### getLatest() **Signature** ```java public String getLatest() ``` **Return Value** Type: String #### getMessages() **Signature** ```java public List getMessages() ``` **Return Value** Type: List<[Slack.Message](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_messages.md)> #### getPinCount() **Signature** ```java public Integer getPinCount() ``` **Return Value** Type: Integer #### getResponseMetadata() **Signature** ```java public Slack.ResponseMetadata getResponseMetadata() ``` **Return Value** Type: [Slack.ResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#responsemetadata-class) #### isHasMore() **Signature** ```java public Boolean isHasMore() ``` **Return Value** Type: Boolean #### setChannelActionsCount(channelActionsCount) **Signature** ```java public void setChannelActionsCount(Integer channelActionsCount) ``` **Parameters** _channelActionsCount_ Type: Integer **Return Value** Type: void #### setChannelActionsTs(channelActionsTs) **Signature** ```java public void setChannelActionsTs(String channelActionsTs) ``` **Parameters** _channelActionsTs_ Type: String **Return Value** Type: void #### setHasMore(hasMore) **Signature** ```java public void setHasMore(Boolean hasMore) ``` **Parameters** _hasMore_ Type: Boolean **Return Value** Type: void #### setLatest(latest) **Signature** ```java public void setLatest(String latest) ``` **Parameters** _latest_ Type: String **Return Value** Type: void #### setMessages(messages) **Signature** ```java public void setMessages(List messages) ``` **Parameters** _messages_ Type: List<[Slack.Message](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_messages.md)> **Return Value** Type: void #### setPinCount(pinCount) **Signature** ```java public void setPinCount(Integer pinCount) ``` **Parameters** _pinCount_ Type: Integer **Return Value** Type: void #### setResponseMetadata(responseMetadata) **Signature** ` ```java public void setResponseMetadata(Slack.ResponseMetadata responseMetadata) ``` **Parameters** _responseMetadata_ Type: [Slack.ResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#responsemetadata-class) **Return Value** Type: void --- ## ConversationsInfoRequest Class Sends a request to retrieve information about a conversation. **Usage** See Slack’s [conversations.info method](https://api.slack.com/methods/conversations.info). ### ConversationsInfoRequest Methods The following are methods for `ConversationsInfoRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.ConversationsInfoRequest.Builder builder() ``` **Return Value** Type: Slack.ConversationsInfoRequest.Builder --- ## ConversationsInfoRequest.Builder Class Contains methods to build an instance of the `Slack.ConversationsInfoRequest` class. A Builder object is obtained by invoking one of the `ConversationsInfoRequest.Builder` methods defined by the `ConversationsInfoRequest` class. ### ConversationsInfoRequest.Builder Methods The following are methods for `ConversationsInfoRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Builds an instance of `Slack.ConversationsInfoRequest`. **Signature** ```java public Slack.ConversationsInfoRequest build() ``` **Return Value** Type: Slack.ConversationsInfoRequest #### channel(channel) Required. The ID of the conversation to learn more about. **Signature** ```java public Slack.ConversationsInfoRequest.Builder channel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: Slack.ConversationsInfoRequest.Builder #### includeLocale(includeLocale) **Signature** ```java public Slack.ConversationsInfoRequest.Builder includeLocale(Boolean includeLocale) ``` **Parameters** _includeLocale_ Type: Boolean **Return Value** Type: Slack.ConversationsInfoRequest.Builder #### includeNumMembers(includeNumMembers) **Signature** ```java public Slack.ConversationsInfoRequest.Builder includeNumMembers(Boolean includeNumMembers) ``` **Parameters** _includeNumMembers_ Type: Boolean **Return Value** Type: Slack.ConversationsInfoRequest.Builder --- ## ConversationsInfoResponse Class Retrieves information about a conversation. ### ConversationsInfoResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `ConversationsInfoResponse`. #### getChannel() **Signature** ```java public Slack.Conversation getChannel() ``` **Return Value** Type: Slack.Conversation #### setChannel(channel) **Signature** ```java public void setChannel(Slack.Conversation channel) ``` **Parameters** _channel_ Type: Slack.Conversation **Return Value** Type: void --- ## ConversationsInviteRequest Class Sends a request to invite users to a channel. The calling user must be a member of the channel. **Usage** See Slack’s [conversations.invite method](https://api.slack.com/methods/conversations.invite). ### ConversationsInviteRequest Methods The following are methods for `ConversationsInviteRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.ConversationsInviteRequest.Builder builder() ``` **Return Value** Type: Slack.ConversationsInviteRequest.Builder --- ## ConversationsInviteRequest.Builder Class Contains methods to build an instance of the `Slack.ConversationsInviteRequest` class. A Builder object is obtained by invoking one of the `ConversationsInviteRequest.Builder` methods defined by the `ConversationsInviteRequest` class. ### ConversationsInviteRequest.Builder Methods The following are methods for `ConversationsInviteRequest.Builder`. #### build() Required. Builds an instance of `Slack.ConversationsInviteRequest`. **Signature** ```java public Slack.ConversationsInviteRequest build() ``` **Return Value** Type: Slack.ConversationsInviteRequest #### channel(channel) Required. The ID of the public or private channel to invite users to. **Signature** ```java public Slack.ConversationsInviteRequest.Builder channel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: Slack.ConversationsInviteRequest.Builder #### users(users) Required. A comma-separated list of user IDs. Up to 1000 users may be listed. **Signature** ```java public Slack.ConversationsInviteRequest.Builder users(List users) ``` **Parameters** _users_ Type: List\ **Return Value** Type: Slack.ConversationsInviteRequest.Builder --- ## ConversationsInviteResponse Class Invites users to a channel. **Usage** See Slack’s [conversations.invite method](https://api.slack.com/methods/conversations.invite). ### ConversationsInviteResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `ConversationsInviteResponse`. #### getChannel() **Signature** ```java public Slack.Conversation getChannel() ``` **Return Value** Type: Slack.Conversation #### getErrors() **Signature** ```java public List getErrors() ``` **Return Value** Type: List #### setChannel(channel) **Signature** ```java public void setChannel(Slack.Conversation channel) ``` **Parameters** _channel_ Type: Slack.Conversation **Return Value** Type: void #### setErrors(errors) **Signature** ```java public void setErrors(List errors) ``` **Parameters** _errors_ Type: List **Return Value** Type: void --- ## ConversationsInviteResponse.Error Class ### ConversationsInviteResponse.Error Methods The following are methods for `ConversationsInviteResponse.Error`. #### getError() Gets the error on the response. See the [conversations.invite method’s list of errors](https://api.slack.com/methods/conversations.invite#errors). **Signature** ```java public String getError() ``` **Return Value** Type: String #### isOk() Specifies whether the users are invited to the channel successfully. **Signature** ```java public Boolean isOk() ``` **Return Value** Type: Boolean #### setError(error) Sets the error message in the response. **Signature** ```java public void setError(String error) ``` **Parameters** _error_ Type: String **Return Value** Type: void #### setOk(ok) Specifies whether the users are invited to the channel successfully. **Signature** ```java public void setOk(Boolean ok) ``` **Parameters** _ok_ Type: Boolean **Return Value** Type: void --- ## ConversationsJoinRequest Class Sends a request to join an existing conversation **Usage** See Slack’s [conversations.join method](https://api.slack.com/methods/conversations.join). ### ConversationsJoinRequest Methods The following are methods for `ConversationsJoinRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.ConversationsJoinRequest.Builder builder() ``` **Return Value** Type: Slack.ConversationsJoinRequest.Builder --- ## ConversationsJoinRequest.Builder Class Contains methods to build an instance of the `Slack.ConversationsJoinRequest` class. A Builder object is obtained by invoking one of the `ConversationsJoinRequest.Builder` methods defined by the `ConversationsJoinRequest` class. ### ConversationsJoinRequest.Builder Methods The following are methods for `ConversationsJoinRequest.Builder`. #### build() Required. Builds an instance of `Slack.ConversationsJoinRequest`. **Signature** ```java public Slack.ConversationsJoinRequest build() ``` **Return Value** Type: Slack.ConversationsJoinRequest #### channel(channel) Required. The ID of the conversation to join. **Signature** ```java public Slack.ConversationsJoinRequest.Builder channel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: Slack.ConversationsJoinRequest.Builder --- ## ConversationsJoinResponse Class Joins an existing conversation. **Usage** See Slack’s [conversations.join method](https://api.slack.com/methods/conversations.join). ### ConversationsJoinResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `ConversationsJoinResponse`. #### getChannel() **Signature** ` ```java public Slack.Conversation getChannel() ``` **Return Value** Type: Slack.Conversation #### getResponseMetadata() **Signature** ```java public Slack.WarningResponseMetadata getResponseMetadata() ``` **Return Value** Type: [Slack.WarningResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#warningresponsemetadata-class) #### setChannel(channel) **Signature** ```java public void setChannel(Slack.Conversation channel) ``` **Parameters** _channel_ Type: Slack.Conversation **Return Value** Type: void #### setResponseMetadata(responseMetadata) **Signature** ```java public void setResponseMetadata(Slack.WarningResponseMetadata responseMetadata) ``` **Parameters** _responseMetadata_ Type: [Slack.WarningResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#warningresponsemetadata-class) **Return Value** Type: void --- ## ConversationsKickRequest Class Sends a request to remove a user from a conversation. **Usage** See Slack’s [conversations.kick method](https://api.slack.com/methods/conversations.kick). ### ConversationsKickRequest Methods The following are methods for `ConversationsKickRequest`. #### builder() **Signature** ```java public static Slack.ConversationsKickRequest.Builder builder() ``` **Return Value** Type: Slack.ConversationsKickRequest.Builder --- ## ConversationsKickRequest.Builder Class Contains methods to build an instance of the `Slack.ConversationsKickRequest` class. A Builder object is obtained by invoking one of the `ConversationsKickRequest.Builder` methods defined by the `ConversationsKickRequest` class. ### ConversationsKickRequest.Builder Methods The following are methods for `ConversationsKickRequest.Builder`. #### build() Required. Builds an instance of `Slack.ConversationsKickRequest`. **Signature** ```java public Slack.ConversationsKickRequest build() ``` **Return Value** Type: Slack.ConversationsKickRequest #### channel(channel) Required. The ID of conversation to remove user from. **Signature** ```java public Slack.ConversationsKickRequest.Builder channel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: Slack.ConversationsKickRequest.Builder #### user(user) Required. The ID of the user to be removed. **Signature** ```java public Slack.ConversationsKickRequest.Builder user(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: Slack.ConversationsKickRequest.Builder --- ## ConversationsKickResponse Class Removes a user from a conversation. **Usage** See Slack’s [conversations.kick method](https://api.slack.com/methods/conversations.kick). ### ConversationsKickResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). --- ## ConversationsLeaveRequest Class Sends a request to leave a conversation. **Usage** See Slack’s [conversations.leave method](https://api.slack.com/methods/conversations.leave). ### ConversationsLeaveRequest Methods The following are methods for `ConversationsLeaveRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.ConversationsLeaveRequest.Builder builder() ``` **Return Value** Type: Slack.ConversationsLeaveRequest.Builder --- ## ConversationsLeaveRequest.Builder Class Contains methods to build an instance of the `Slack.ConversationsLeaveRequest` class. A Builder object is obtained by invoking one of the `ConversationsLeaveRequest.Builder` methods defined by the `ConversationsLeaveRequest` class. ### ConversationsLeaveRequest.Builder Methods The following are methods for `ConversationsLeaveRequest.Builder`. #### build() Required. Builds an instance of `Slack.ConversationsLeaveRequest`. **Signature** ```java public Slack.ConversationsLeaveRequest build() ``` **Return Value** Type: Slack.ConversationsLeaveRequest #### channel(channel) Required. The ID of the conversation to leave. **Signature** ```java public Slack.ConversationsLeaveRequest.Builder channel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: Slack.ConversationsLeaveRequest.Builder --- ## ConversationsLeaveResponse Class Leaves a conversation. **Usage** See Slack’s [conversations.leave method](https://api.slack.com/methods/conversations.leave). ### ConversationsLeaveResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `ConversationsLeaveResponse`. #### isNotInChannel() **Signature** ```java public Boolean isNotInChannel() ``` **Return Value** Type: Boolean #### setNotInChannel(notInChannel) **Signature** ```java public void setNotInChannel(Boolean notInChannel) ``` **Parameters** _notInChannel_ Type: Boolean **Return Value** Type: void --- ## ConversationsListRequest Class Sends a request to list all channels in a Slack team. **Usage** See Slack’s [conversations.list method](https://api.slack.com/methods/conversations.list). ### ConversationsListRequest Methods The following are methods for `ConversationsListRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.ConversationsListRequest.Builder builder() ``` **Return Value** Type: Slack.ConversationsListRequest.Builder --- ## ConversationsListRequest.Builder Class Contains methods to build an instance of the `Slack.ConversationsListRequest` class. A Builder object is obtained by invoking one of the `ConversationsListRequest.Builder` methods defined by the `ConversationsListRequest` class. ### ConversationsListRequest.Builder Methods The following are methods for `ConversationsListRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Builds an instance of `Slack.ConversationsListRequest`. **Signature** ```java public Slack.ConversationsListRequest build() ``` **Return Value** Type: Slack.ConversationsListRequest #### cursor(cursor) **Signature** ```java public Slack.ConversationsListRequest.Builder cursor(String cursor) ``` **Parameters** _cursor_ Type: String **Return Value** Type: Slack.ConversationsListRequest.Builder #### excludeArchived(excludeArchived) **Signature** ```java public Slack.ConversationsListRequest.Builder excludeArchived(Boolean excludeArchived) ``` **Parameters** _excludeArchived_ Type: Boolean **Return Value** Type: Slack.ConversationsListRequest.Builder #### limitValue(limitValue) **Signature** ```java public Slack.ConversationsListRequest.Builder limitValue(Integer limitValue) ``` **Parameters** _limitValue_ Type: Integer **Return Value** Type: Slack.ConversationsListRequest.Builder #### teamId(teamId) **Signature** ```java public Slack.ConversationsListRequest.Builder teamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: Slack.ConversationsListRequest.Builder #### types(types) **Signature** ```java public Slack.ConversationsListRequest.Builder types(List types) ``` **Parameters** _types_ Type: List **Return Value** Slack.ConversationsListRequest.Builder --- ## ConversationsListResponse Class Lists all channels in a Slack team. **Usage** See Slack’s [conversations.list method](https://api.slack.com/methods/conversations.list). ### ConversationsListResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `ConversationsListResponse`. #### getChannels() **Signature** ```java public List getChannels() ``` **Return Value** Type: List #### getResponseMetadata() **Signature** ```java public Slack.ResponseMetadata getResponseMetadata() ``` **Return Value** Type: [Slack.ResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#responsemetadata-class) #### setChannels(channels) **Signature** ```java public void setChannels(List channels) ``` **Parameters** _channels_ Type: List **Return Value** Type: void #### setResponseMetadata(responseMetadata) **Signature** ```java public void setResponseMetadata(Slack.ResponseMetadata responseMetadata) ``` **Parameters** _responseMetadata_ Type: [Slack.ResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#responsemetadata-class) --- ## ConversationsMarkRequest Class Sends a request to set the read cursor in a channel. **Usage** See Slack’s [conversations.mark method](https://api.slack.com/methods/conversations.mark). ### ConversationsMarkRequest Methods #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.ConversationsMarkRequest.Builder builder() ``` **Return Value** Type: Slack.ConversationsMarkRequest.Builder --- ## ConversationsMarkRequest.Builder Class Contains methods to build an instance of the `Slack.ConversationsMarkRequest` class. A Builder object is obtained by invoking one of the `ConversationsMarkRequest.Builder` methods defined by the `ConversationsMarkRequest` class. ### ConversationsMarkRequest.Builder Methods The following are methods for `ConversationsMarkRequest.Builder`. #### build() Required. Builds an instance of `Slack.ConversationsMarkRequest`. **Signature** ```java public Slack.ConversationsMarkRequest build() ``` **Return Value** Type: Slack.ConversationsMarkRequest #### channel(channel) Required. The ID of the channel or conversation to set the read cursor for. **Signature** ```java public Slack.ConversationsMarkRequest.Builder channel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: Slack.ConversationsMarkRequest.Builder #### ts(ts) Required. The timestamp that's used as a unique identifier of the message you want marked as most recently seen in this conversation. **Signature** ```java public Slack.ConversationsMarkRequest.Builder ts(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: Slack.ConversationsMarkRequest.Builder --- ## ConversationsMarkResponse Class Sets the read cursor in a channel. **Usage** See Slack’s [conversations.mark method](https://api.slack.com/methods/conversations.mark). ### ConversationsMarkResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `ConversationsMarkResponse`. #### getResponseMetadata() **Signature** ```java public Slack.ResponseMetadata getResponseMetadata() ``` **Return Value** Type: [Slack.ResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#responsemetadata-class) #### setResponseMetadata(responseMetadata) **Signature** ```java public void setResponseMetadata(Slack.ResponseMetadata responseMetadata) ``` **Parameters** _responseMetadata_ Type: [Slack.ResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#responsemetadata-class) **Return Value** Type: void --- ## ConversationsMembersRequest Class Sends a request to retrieve members of a conversation. **Usage** See Slack’s [conversation.members method](https://api.slack.com/methods/conversations.members). ### ConversationsMembersRequest Methods The following are methods for `ConversationsMembersRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.ConversationsMembersRequest.Builder builder() ``` **Return Value** Type: Slack.ConversationsMembersRequest.Builder --- ## ConversationsMembersRequest.Builder Class Contains methods to build an instance of the `Slack.ConversationsMembersRequest` class. A Builder object is obtained by invoking one of the `ConversationsMembersRequest.Builder` methods defined by the `ConversationsMembersRequest` class. ### ConversationsMembersRequest.Builder Methods The following are methods for `ConversationsMembersRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Builds an instance of `Slack.ConversationsMembersRequest`. **Signature** ```java public Slack.ConversationsMembersRequest build() ``` **Return Value** Type: ConversationsMembersRequest #### channel(channel) Required. The ID of the conversation to retrieve members for. **Signature** ```java public Slack.ConversationsMembersRequest.Builder channel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: Slack.ConversationsMembersRequest.Builder #### cursor(cursor) **Signature** ```java public Slack.ConversationsMembersRequest.Builder cursor(String cursor) ``` **Parameters** _cursor_ Type: String **Return Value** Type: Slack.ConversationsMembersRequest.Builder #### limitValue(limitValue) **Signature** ```java public Slack.ConversationsMembersRequest.Builder limitValue(Integer limitValue) ``` **Parameters** _limitValue_ Type: Integer **Return Value** Type: Slack.ConversationsMembersRequest.Builder --- ## ConversationsMembersResponse Class Retrieves members of a conversation. **Usage** See Slack’s [conversation.members method](https://api.slack.com/methods/conversations.members). ### ConversationsMembersResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `ConversationsMembersResponse`. #### getMembers() **Signature** ```java public List getMembers() ``` **Return Value** Type: List\ #### getResponseMetadata() **Signature** ```java public Slack.ResponseMetadata getResponseMetadata() ``` **Return Value** Type: [Slack.ResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#responsemetadata-class) #### setMembers(members) **Signature** ```java public void setMembers(List members) ``` **Parameters** _members_ Type:List<String> **Return Value** Type: void #### setResponseMetadata(responseMetadata) **Signature** ```java public void setResponseMetadata(Slack.ResponseMetadata responseMetadata) ``` **Parameters** _responseMetadata_ Type: [Slack.ResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#responsemetadata-class) **Return Value** Type: void --- ## ConversationsOpenRequest Class Sends a request to open or resume a direct message or multi-person direct message. For public or private channels, use [ConversationsCreateRequest](#conversationscreaterequest-class). **Usage** See Slack’s [conversations.open method](https://api.slack.com/methods/conversations.open). ### ConversationsOpenRequest Methods The following are methods for `ConversationsOpenRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.ConversationsOpenRequest.Builder builder() ``` **Return Value** Type: Slack.ConversationsOpenRequest.Builder --- ## ConversationsOpenRequest.Builder Class Contains methods to build an instance of the `Slack.ConversationsOpenRequest` class. A Builder object is obtained by invoking one of the `ConversationsOpenRequest.Builder` methods defined by the `ConversationsOpenRequest` class. ### ConversationsOpenRequest.Builder Methods The following are methods for `ConversationsOpenRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Builds an instance of `Slack.ConversationsOpenRequest`. **Signature** ```java public Slack.ConversationsOpenRequest build() ``` **Return Value** Type: Slack.ConversationsOpenRequest #### channel(channel) **Signature** ```java public Slack.ConversationsOpenRequest.Builder channel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: Slack.ConversationsOpenRequest.Builder #### returnIm(returnIm) **Signature** ```java public Slack.ConversationsOpenRequest.Builder returnIm(Boolean returnIm) ``` **Parameters** _returnIm_ Type: Boolean **Return Value** Type: Slack.ConversationsOpenRequest.Builder #### users(users) **Signature** ```java public Slack.ConversationsOpenRequest.Builder users(List users) ``` **Parameters** _users_ Type: List<String> **Return Value** Type: Slack.ConversationsOpenRequest.Builder --- ## ConversationsOpenResponse Class Opens or resumes a direct message or multi-person direct message. **Usage** See Slack’s [conversations.open method](https://api.slack.com/methods/conversations.open). ### ConversationsOpenResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `ConversationsOpenResponse`. #### getChannel() **Signature** ```java public Slack.Conversation getChannel() ``` **Return Value** Type: Slack.Conversation #### isAlreadyOpen() **Signature** ```java public Boolean isAlreadyOpen() ``` **Return Value** Type: Boolean #### isNoOp() **Signature** ```java public Boolean isNoOp() ``` **Return Value** Type: Boolean #### setAlreadyOpen(alreadyOpen) **Signature** ```java public void setAlreadyOpen(Boolean alreadyOpen) ``` **Parameters** _alreadyOpen_ Type: Boolean **Return Value** Type: void #### setChannel(channel) **Signature** ```java public void setChannel(Slack.Conversation channel) ``` **Parameters** _channel_ Type: Slack.Conversation **Return Value** Type: void #### setNoOp(noOp) **Signature** ```java public void setNoOp(Boolean noOp) ``` **Parameters** _noOp_ Type: Boolean **Return Value** Type: void --- ## ConversationsRenameRequest Class Sends a request to rename a conversation. **Usage** See Slack’s [conversations.rename method](https://api.slack.com/methods/conversations.rename). ### ConversationsRenameRequest Methods The following are methods for `ConversationsRenameRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.ConversationsRenameRequest.Builder builder() ``` **Return Value** Type: Slack.ConversationsRenameRequest.Builder --- ## ConversationsRenameRequest.Builder Class Contains methods to build an instance of the `Slack.ConversationsRenameRequest` class. A Builder object is obtained by invoking one of the `ConversationsRenameRequest.Builder` methods defined by the `ConversationsRenameRequest` class. ### ConversationsRenameRequest.Builder Methods The following are methods for `ConversationsRenameRequest.Builder`. #### build() Required. Builds an instance of `Slack.ConversationsRenameRequest`. **Signature** ```java public Slack.ConversationsRenameRequest build() ``` **Return Value** Type: Slack.ConversationsRenameRequest #### channel(channel) Required. The ID of conversation to rename. **Signature** ```java public Slack.ConversationsRenameRequest.Builder channel(String channel) ``` **Parameters** _channel_ Type: String #### name(name) Required. New name for conversation. **Signature** ```java public Slack.ConversationsRenameRequest.Builder name(String name) ``` **Parameters** _name_ Type: String **Return Value** Type: Slack.ConversationsRenameRequest.Builder --- ## ConversationsRenameResponse Class Renames a conversation. **Usage** See Slack’s [conversations.rename method](https://api.slack.com/methods/conversations.rename). ### ConversationsRenameResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `ConversationsRenameResponse`. #### getChannel() **Signature** ```java public Slack.Conversation getChannel() ``` **Return Value** Type: Slack.Conversation #### setChannel(channel) **Signature** ```java public void setChannel(Slack.Conversation channel) ``` **Parameters** _channel_ Type: Slack.Conversation **Return Value** Type: void --- ## ConversationsRepliesRequest Class Sends a request to retrieve a thread of messages that’s posted to a conversation. **Usage** See Slack’s [conversations.replies method](https://api.slack.com/methods/conversations.replies). ### ConversationsRepliesRequest Methods The following are methods for `ConversationsRepliesRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.ConversationsRepliesRequest.Builder builder() ``` **Return Value** Type: Slack.ConversationsRepliesRequest.BuilderAdd --- ## ConversationsRepliesRequest.Builder Class Contains methods to build an instance of the `Slack.ConversationsRepliesRequest` class. A Builder object is obtained by invoking one of the `ConversationsRepliesRequest.Builder` methods defined by the `ConversationsRepliesRequest` class. ### ConversationsRepliesRequest.Builder Methods The following are methods for `ConversationsRepliesRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Builds an instance of `Slack.ConversationsRepliesRequest`. **Signature** ```java public Slack.ConversationsRepliesRequest build() ``` **Return Value** Type: Slack.ConversationsRepliesRequest #### channel(channel) Required. Conversation ID to fetch thread from. **Signature** ```java public Slack.ConversationsRepliesRequest.Builder channel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: Slack.ConversationsRepliesRequest.Builder #### cursor(cursor) **Signature** ```java public Slack.ConversationsRepliesRequest.Builder cursor(String cursor) ``` **Parameters** _cursor_ Type: String **Return Value** Type: Slack.ConversationsRepliesRequest.Builder #### inclusive(inclusive) **Signature** ```java public Slack.ConversationsRepliesRequest.Builder inclusive(Boolean inclusive) ``` **Parameters** _inclusive_ Type: Boolean **Return Value** Type: Slack.ConversationsRepliesRequest.Builder #### latest(latest) **Signature** ```java public Slack.ConversationsRepliesRequest.Builder latest(String latest) ``` **Parameters** _latest_ Type: String **Return Value** Type: Slack.ConversationsRepliesRequest.Builder #### limitValue(limitValue) **Signature** ```java public Slack.ConversationsRepliesRequest.Builder limitValue(Integer limitValue) ``` **Parameters** _limitValue_ Type: Integer **Return Value** Type: Slack.ConversationsRepliesRequest.Builder #### oldest(oldest) **Signature** ```java public Slack.ConversationsRepliesRequest.Builder oldest(String oldest) ``` **Parameters** _oldest_ Type: String **Return Value** Type: Slack.ConversationsRepliesRequest.Builder #### ts(ts) Required. The timestamp of an existing message with 0 or more replies. This timestamp is used as a unique identifier of either a thread’s parent message or a message in the thread. If there are no replies, a single unthreaded message that's referenced by the timestamp is returned. **Signature** ```java public Slack.ConversationsRepliesRequest.Builder ts(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: Slack.ConversationsRepliesRequest.Builder --- ## ConversationsRepliesResponse Class Retrieves a thread of messages posted to a conversation. **Usage** See Slack’s [conversations.replies method](https://api.slack.com/methods/conversations.replies). ### ConversationsRepliesResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `ConversationsRepliesResponse`. #### getMessages() **Signature** ```java public List getMessages() ``` **Return Value** Type: List<[Slack.Message](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_messages.md)> #### getResponseMetadata() **Signature** ```java public Slack.ResponseMetadata getResponseMetadata() ``` **Return Value** Type: [Slack.ResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#responsemetadata-class) #### isHasMore() **Signature** ```java public Boolean isHasMore() ``` **Return Value** Type: Boolean #### setHasMore(hasMore) **Signature** ```java public void setHasMore(Boolean hasMore) ``` **Parameters** _hasMore_ Type: Boolean **Return Value** Type: void #### setMessages(messages) **Signature** ```java public void setMessages(List messages) ``` **Parameters** _messages_ Type: List<[Slack.Message](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_messages.md)> **Return Value** Type: void #### setResponseMetadata(responseMetadata) **Signature** ```java public void setResponseMetadata(Slack.ResponseMetadata responseMetadata) ``` **Parameters** _responseMetadata_ Type: [Slack.ResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#responsemetadata-class) **Return Value** Type: void --- ## ConversationsSetPurposeRequest Class Sends a request to set the purpose for a conversation. **Usage** See Slack’s [conversations.setPurpose method](https://api.slack.com/methods/conversations.setPurpose). ### ConversationsSetPurposeRequest Methods The following are methods for `ConversationsSetPurposeRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.ConversationsSetPurposeRequest.Builder builder() ``` **Return Value** Type: Slack.ConversationsSetPurposeRequest.Builder --- ## ConversationsSetPurposeRequest.Builder Class Contains methods to build an instance of the `Slack.ConversationsSetPurposeRequest` class. A Builder object is obtained by invoking one of the `ConversationsSetPurposeRequest.Builder` methods defined by the `ConversationsSetPurposeRequest` class. ### ConversationsSetPurposeRequest.Builder Methods The following are methods for `ConversationsSetPurposeRequest.Builder`. #### build() **Signature** ```java public Slack.ConversationsSetPurposeRequest build() ``` **Return Value** Type: Slack.ConversationsSetPurposeRequest #### channel(channel) Required. The ID of the conversation to set the purpose for. **Signature** ```java public Slack.ConversationsSetPurposeRequest.Builder channel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: Slack.ConversationsSetPurposeRequest.Builder #### purpose(purpose) Required. The purpose for the conversation. **Signature** ```java public Slack.ConversationsSetPurposeRequest.Builder purpose(String purpose) ``` **Parameters** _purpose_ Type: String **Return Value** Type: Slack.ConversationsSetPurposeRequest.Builder --- ## ConversationsSetPurposeResponse Class Sets the purpose for a conversation. **Usage** See Slack’s [conversations.setPurpose method](https://api.slack.com/methods/conversations.setPurpose). ### ConversationsSetPurposeResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `ConversationsSetPurposeResponse`. #### getChannel() **Signature** ```java public Slack.Conversation getChannel() ``` **Return Value** Type: Slack.Conversation #### setChannel(channel) **Signature** ```java public void setChannel(Slack.Conversation channel) ``` **Parameters** _channel_ Type: Slack.Conversation **Return Value** Type: void --- ## ConversationsSetTopicRequest Class Sends a request to set the topic for a conversation. **Usage** See Slack’s [conversations.setTopic method](https://api.slack.com/methods/conversations.setTopic). ### ConversationsSetTopicRequest Methods #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.ConversationsSetTopicRequest.Builder builder() ``` **Return Value** Type: Slack.ConversationsSetTopicRequest.Builder --- ## ConversationsSetTopicRequest.Builder Class Contains methods to build an instance of the `Slack.ConversationsSetTopicRequest` class. A Builder object is obtained by invoking one of the `ConversationsSetTopicRequest.Builder` methods defined by the `ConversationsSetTopicRequest` class. ### ConversationsSetTopicRequest.Builder Methods The following are methods for `ConversationsSetTopicRequest.Builder`. #### build() Required. Builds an instance of `Slack. ConversationsSetTopicRequest`. **Signature** ```java public Slack.ConversationsSetTopicRequest build() ``` **Return Value** Type: Slack.ConversationsSetTopicRequest #### channel(channel) Required. The conversation to set the topic for. **Signature** ```java public Slack.ConversationsSetTopicRequest.Builder channel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: Slack.ConversationsSetTopicRequest.Builder #### topic(topic) Required. The topic for the conversation. **Signature** ```java public Slack.ConversationsSetTopicRequest.Builder topic(String topic) ``` **Parameters** _topic_ Type: String **Return Value** Type: Slack.ConversationsSetTopicRequest.Builder --- ## ConversationsSetTopicResponse Class Sets the topic for a conversation. **Usage** See Slack’s [conversations.setTopic method](https://api.slack.com/methods/conversations.setTopic). ### ConversationsSetTopicResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `ConversationsSetTopicResponse`. #### getChannel() **Signature** ```java public Slack.Conversation getChannel() ``` **Return Value** Type: Slack.Conversation #### setChannel(channel) **Signature** ```java public void setChannel(Slack.Conversation channel) ``` **Parameters** _channel_ Type: Slack.Conversation **Return Value** Type: void --- ## ConversationsUnarchiveRequest Class Sends a request to reverse conversation archival. **Usage** See Slack’s [conversations.unarchive method](https://api.slack.com/methods/conversations.unarchive). ### ConversationsUnarchiveRequest Methods The following are methods for `ConversationsUnarchiveRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.ConversationsUnarchiveRequest.Builder builder() ``` **Return Value** Type: Slack.ConversationsUnarchiveRequest.Builder --- ## ConversationsUnarchiveRequest.Builder Class Contains methods to build an instance of the `Slack.ConversationsUnarchiveRequest` class. A Builder object is obtained by invoking one of the `ConversationsUnarchiveRequest.Builder` methods defined by the `ConversationsUnarchiveRequest` class. ### ConversationsUnarchiveRequest.Builder Methods The following are methods for `ConversationsUnarchiveRequest.Builder`. #### build() Required. Builds an instance of `Slack.ConversationsUnarchiveRequest`. **Signature** ```java public Slack.ConversationsUnarchiveRequest build() ``` **Return Value** Type: Slack.ConversationsUnarchiveRequest #### channel(channel) Required. The ID of conversation to unarchive. **Signature** ```java public Slack.ConversationsUnarchiveRequest.Builder channel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: Slack.ConversationsUnarchiveRequest.Builder --- ## ConversationsUnarchiveResponse Class Reverses conversation archival. **Usage** See Slack’s [conversations.unarchive method](https://api.slack.com/methods/conversations.unarchive). ### ConversationsUnarchiveResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). # Work with Do Not Disturb Mode The following are Apex classes for the Slack `dnd` [API methods](https://api.slack.com/methods?filter=dnd). ## DndEndDndRequest Class Sends a request to end the current user's Do Not Disturb session immediately. **Usage** See Slack’s [dnd.endDnd method](https://api.slack.com/methods/dnd.endDnd). ### DndEndDndRequest Methods The following are methods for `DndEndDndRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.DndEndDndRequest.Builder builder() ``` **Return Value** Type: Slack.DndEndDndRequest.Builder --- ### DndEndDndRequest.Builder Class Contains methods to build an instance of the `Slack.DndEndDndRequest` class. A Builder object is obtained by invoking one of the `DndEndDndRequest.builder` methods defined by the `DndEndDndRequest` class. ### DndEndDndRequest.Builder Methods The following are methods for `DndEndDndRequest.Builder`. #### build() Required. Returns an instance of `Slack.DndEndDndRequest`. **Signature** ```java public Slack.DndEndDndRequest build() ``` **Return Value** Type: Slack.DndEndDndRequest --- ## DndEndDndResponse Class Ends the current user's Do Not Disturb session immediately. **Usage** See Slack’s [dnd.endDnd method](https://api.slack.com/methods/dnd.endDnd). ### DndEndDndResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). --- ## DndEndSnoozeRequest Class Sends a request to end the current user's snooze mode immediately. **Usage** See Slack’s [dnd.endSnooze method](https://api.slack.com/methods/dnd.endSnooze). ### DndEndSnoozeRequest Methods The following are methods for `DndEndSnoozeRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.DndEndSnoozeRequest.Builder builder() ``` **Return Value** Type: Slack.DndEndSnoozeRequest.Builder --- ## DndEndSnoozeRequest.Builder Class Contains methods to build an instance of the `Slack.DndEndSnoozeRequest` class. A Builder object is obtained by invoking one of the `DndEndSnoozeRequest.builder` methods defined by the `DndEndSnoozeRequest` class. ### DndEndSnoozeRequest.Builder Methods The following are methods for `DndEndSnoozeRequest.Builder`. #### build() Required. Returns an instance of the `Slack.DndEndSnoozeRequest` object. **Signature** ```java public Slack.DndEndSnoozeRequest build() ``` **Return Value** Type: Slack.DndEndSnoozeRequest --- ## DndEndSnoozeResponse Class Ends the current user's snooze mode immediately. **Usage** See Slack’s [dnd.endSnooze method](https://api.slack.com/methods/dnd.endSnooze). ### DndEndSnoozeResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `DndEndSnoozeResponse`. #### getNextDndEndTs() Gets the timestamp for when the next Do Not Disturb session ends. **Signature** ```java public Integer getNextDndEndTs() ``` **Return Value** Type: Integer #### getNextDndStartTs() Gets the timestamp for when the next Do Not Disturb session starts. **Signature** ```java public Integer getNextDndStartTs() ``` **Return Value** Type: Integer #### isDndEnabled() Specifies whether the user’s Do Not Disturb mode is enabled. **Signature** ```java public Boolean isDndEnabled() ``` **Return Value** Type: Boolean #### isSnoozeEnabled() Specifies whether snooze is enabled. **Signature** ```java public Boolean isSnoozeEnabled() ``` **Return Value** Type: Boolean #### setDndEnabled(dndEnabled) Sets whether Do Not Disturb mode is enabled . **Signature** ```java public void setDndEnabled(Boolean dndEnabled) ``` **Parameters** _dndEnabled_ Type: Boolean #### setNextDndEndTs(nextDndEndTs) **Signature** ```java public void setNextDndEndTs(Integer nextDndEndTs) ``` **Parameters** _nextDndEndTs_ Type: Integer **Return Value** Type: void #### setNextDndStartTs(nextDndStartTs) **Signature** ```java public void setNextDndStartTs(Integer nextDndStartTs) ``` **Parameters** _nextDndStartTs_ Type: Integer **Return Value** Type: void #### setSnoozeEnabled(snoozeEnabled) **Signature** ```java public void setSnoozeEnabled(Boolean snoozeEnabled) ``` **Parameters** _snoozeEnabled_ Type: Boolean **Return Value** Type: void --- ## DndInfoRequest Class Sends a request to retrieve a user’s current Do Not Disturb status. **Usage** See Slack’s [dnd.info method](https://api.slack.com/methods/dnd.info). ### DndInfoRequest Methods The following are methods for `DndInfoRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.DndInfoRequest.Builder builder() ``` **Return Value** Type: Slack.DndInfoRequest.Builder --- ## DndInfoRequest.Builder Class Contains methods to build an instance of the `Slack.DndInfoRequest` class. A Builder object is obtained by invoking one of the `DndInfoRequest.builder` methods defined by the `DndInfoRequest` class. ### DndInfoRequest.Builder Methods The following are methods for `DndInfoRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of `Slack.DndInfoRequest`. **Signature** ```java public Slack.DndInfoRequest build() ``` **Return Value** Type: Slack.DndInfoRequest #### user(user) **Signature** ```java public Slack.DndInfoRequest.Builder user(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: Slack.DndInfoRequest.Builder #### teamId(teamId) **Signature** ```java public Slack.DndInfoRequest.Builder teamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: [Slack.DndInfoRequest.Builder](#dndinforequestbuilder-class) ## DndInfoResponse Class Retrieves a user’s current Do Not Disturb status. **Usage** See Slack’s [dnd.info method](https://api.slack.com/methods/dnd.info). ### DndInfoResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `DndInfoResponse`. #### getNextDndEndTs() Gets the timestamp for when the next Do Not Disturb session ends. **Signature** ```java public Integer getNextDndEndTs() ``` **Return Value** Type: Integer #### getNextDndStartTs() Gets the timestamp for when the next Do Not Disturb session starts. **Signature** ```java public Integer getNextDndStartTs() ``` **Return Value** Type: Integer #### getSnoozeEndtime() Gets the timestamp for when the snooze ends. **Signature** ```java public Integer getSnoozeEndtime() ``` **Return Value** Type: Integer #### getSnoozeRemaining() Gets the remaining time for the snooze. **Signature** ```java public Integer getSnoozeRemaining() ``` **Return Value** Type: Integer #### isDndEnabled() Specifies whether the user’s Do Not Disturb mode is enabled. **Signature** ```java public Boolean isDndEnabled() ``` **Return Value** Type: Boolean #### isSnoozeEnabled() Specifies whether snooze is enabled. **Signature** ```java public Boolean isSnoozeEnabled() ``` **Return Value** Type: Boolean #### setDndEnabled(dndEnabled) Sets whether Do Not Disturb mode is enabled . **Signature** ```java public void setDndEnabled(Boolean dndEnabled) ``` **Parameters** _dndEnabled_ Type: Boolean #### setNextDndEndTs(nextDndEndTs) **Signature** ```java public void setNextDndEndTs(Integer nextDndEndTs) ``` **Parameters** _nextDndEndTs_ Type: Integer **Return Value** Type: void #### setNextDndStartTs(nextDndStartTs) **Signature** ```java public void setNextDndStartTs(Integer nextDndStartTs) ``` **Parameters** _nextDndStartTs_ Type: Integer **Return Value** Type: void #### setSnoozeEnabled(snoozeEnabled) **Signature** ```java public void setSnoozeEnabled(Boolean snoozeEnabled) ``` **Parameters** _snoozeEnabled_ Type: Boolean **Return Value** Type: void #### setSnoozeEndtime(snoozeEndtime) **Signature** ```java public void setSnoozeEndtime(Integer snoozeEndtime) ``` **Parameters** _snoozeEndtime_ Type: Integer **Return Value** Type: void #### setSnoozeRemaining(snoozeRemaining) **Signature** ```java public void setSnoozeRemaining(Integer snoozeRemaining) ``` **Parameters** _snoozeRemaining_ Type: Integer **Return Value** Type: void --- ## DndSetSnoozeRequest Class Sends a request to turn on Do Not Disturb mode for the current user, or to change its duration. **Usage** See Slack’s [dnd.setSnooze method](https://api.slack.com/methods/dnd.setSnooze). ### DndSetSnoozeRequest Methods The following are methods for `DndSetSnoozeRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.DndSetSnoozeRequest.Builder builder() ``` **Return Value** Type: Slack.DndSetSnoozeRequest.Builder --- ## DndSetSnoozeRequest.Builder Class Contains methods to build an instance of the `Slack.DndSetSnoozeRequest` class. A Builder object is obtained by invoking one of the `DndSetSnoozeRequest.builder` methods defined by the `DndSetSnoozeRequest` class. ### DndSetSnoozeRequest.Builder Methods The following are methods for `DndSetSnoozeRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Builds an instance of `Slack.DndSetSnoozeRequest`. **Signature** ```java public Slack.DndSetSnoozeRequest build() ``` **Return Value** Type: Slack.DndSetSnoozeRequest #### numMinutes(numMinutes) **Signature** ```java public Slack.DndSetSnoozeRequest.Builder numMinutes(Integer numMinutes) ``` **Parameters** _numMinutes_ Type: Integer **Return Value** Type: Slack.DndSetSnoozeRequest.Builder --- ## DndSetSnoozeResponse Class Turns on Do Not Disturb mode for the current user, or changes its duration. **Usage** See Slack’s [dnd.setSnooze method](https://api.slack.com/methods/dnd.setSnooze) ### DndSetSnoozeResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `DndSetSnoozeResponse`. #### getSnoozeEndtime() Gets the timestamp for when the snooze ends. **Signature** ```java public Integer getSnoozeEndtime() ``` **Return Value** Type: Integer #### getSnoozeRemaining() Gets the remaining time for the snooze. **Signature** ```java public Integer getSnoozeRemaining() ``` **Return Value** Type: Integer #### isSnoozeEnabled() Specifies whether snooze is enabled. **Signature** ```java public Boolean isSnoozeEnabled() ``` **Return Value** Type: Boolean #### setSnoozeEnabled(snoozeEnabled) Sets whether the user’s Do Not Disturb mode is enabled. **Signature** ```java public void setSnoozeEnabled(Boolean snoozeEnabled) ``` **Parameters** _snoozeEnabled_ Type: Boolean **Return Value** Type: void #### setSnoozeEndtime(snoozeEndtime) Sets when the user’s Do Not Disturb mode ends. **Signature** ```java public void setSnoozeEndtime(Integer snoozeEndtime) ``` **Parameters** _snoozeEndtime_ Type: Integer **Return Value** Type: void #### setSnoozeRemaining(snoozeRemaining) Sets how long more the Do Not Disturb mode lasts. **Signature** ```java public void setSnoozeRemaining(Integer snoozeRemaining) ``` **Parameters** _snoozeRemaining_ Type: Integer **Return Value** Type: void --- ## DndTeamInfoRequest Class Sends a request to retrieve the Do Not Disturb status for up to 50 users on a team. **Usage** See Slack’s [dnd.teamInfo method](https://api.slack.com/methods/dnd.teamInfo). ### DndTeamInfoRequest Methods The following are methods for `DndTeamInfoRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.DndTeamInfoRequest.Builder builder() ``` **Return Value** Type: Slack.DndTeamInfoRequest.Builder --- ## DndTeamInfoRequest.Builder Class Contains methods to build an instance of the `Slack.DndTeamInfoRequest` class. A Builder object is obtained by invoking one of the `DndTeamInfoRequest.builder` methods defined by the `DndTeamInfoRequest` class. ### DndTeamInfoRequest.Builder Methods The following are methods for `DndTeamInfoRequest.Builder`. #### build() Required. Builds an instance of `Slack.DndTeamInfoRequest`. **Signature** ```java public Slack.DndTeamInfoRequest build() ``` **Return Value** Type: Slack.DndTeamInfoRequest #### teamId(teamId) **Signature** ```java public Slack.DndTeamInfoRequest.Builder teamId(String teamId) ``` **Parameters** teamId Type: String **Return Value** Type: [Slack.DndTeamInfoRequest.Builder](#dndteaminforequestbuilder-class) #### users(users) Required. The comma-separated list of users to fetch Do Not Disturb status for. **Signature** ```java public Slack.DndTeamInfoRequest.Builder users(List users) ``` **Parameters** _users_ Type: List\ **Return Value** Type: Slack.DndTeamInfoRequest.Builder --- ## DndTeamInfoResponse Class Retrieves the Do Not Disturb status for up to 50 users on a team. **Usage** See Slack’s [dnd.teamInfo method](https://api.slack.com/methods/dnd.teamInfo). ### DndTeamInfoResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `DndTeamInfoResponse`. #### getUsers() **Signature** ```java public Map getUsers() ``` **Return Value** Type: Map #### setUsers(users) **Signature** ```java public void setUsers(Map users) ``` **Parameters** _users_ Type: Map **Return Value** Type: void --- ## DndTeamInfoResponse.DndTeamMemberInfo Class Contains methods to build an instance of the `Slack.DndTeamInfoResponse` class. A DndTeamMemberInfo object is obtained by invoking one of the `DndTeamInfoResponse.DndTeamMemberInfo` methods defined by the `DndTeamInfoResponse` class. ### DndTeamInfoResponse.DndTeamMemberInfo Methods The following are methods for `DndTeamInfoResponse.DndTeamMemberInfo`. #### getNextDndEndTs() **Signature** ```java public Integer getNextDndEndTs() ``` **Return Value** Type: Integer #### getNextDndStartTs() **Signature** ```java public Integer getNextDndStartTs() ``` **Return Value** Type: Integer #### isDndEnabled() **Signature** ```java public Boolean isDndEnabled() ``` **Return Value** Type: Boolean #### setDndEnabled(dndEnabled) **Signature** ```java public void setDndEnabled(Boolean dndEnabled) ``` **Parameters** _dndEnabled_ Type: Boolean **Return Value** Type: void # Work with Emojis The following are Apex classes for the Slack `emoji` [API methods](https://api.slack.com/methods?filter=emoji). ## EmojiListRequest Class Sends a request to list custom emoji for a team. **Usage** See Slack’s [emoji.list method.](https://api.slack.com/methods/emoji.list) ### EmojiListRequest Methods The following are methods for `EmojiListRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.EmojiListRequest.Builder builder() ``` **Return Value** Type: Slack.EmojiListRequest.Builder --- ## EmojiListRequest.Builder Class Contains methods to build an instance of the `Slack.EmojiListRequest` class. A Builder object is obtained by invoking one of the `EmojiListRequest.builder` methods defined by the `EmojiListRequest` class. ### EmojiListRequest.Builder Methods The following are methods for `EmojiListRequest.Builder`. #### build() Required. Returns an instance of `Slack.EmojiListRequest`. **Signature** ```java public Slack.EmojiListRequest build() ``` **Return Value** Type: Slack.EmojiListRequest --- ### EmojiListResponse Class Lists custom emoji for a team. ### EmojiListResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `EmojiListResponse`. #### getCacheTs() **Signature** ```java public String getCacheTs() ``` **Return Value** Type: String #### getEmoji() Gets the list of custom emoji. **Signature** ```java public Map getEmoji() ``` **Return Value** Type: Map #### setCacheTs(cacheTs) **Signature** ```java public void setCacheTs(String cacheTs) ``` **Parameters** _cacheTs_ Type: String **Return Value** Type: void #### setEmoji(emoji) **Signature** ```java public void setEmoji(Map emoji) ``` **Parameters** _emoji_ Type: Map **Return Value** Type: void # Work with Events The following are Apex classes for the Slack [event types](https://api.slack.com/events). ## Event Class Represents a Slack event. ### Event Methods The following are methods for `Event`. #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` Type: String ## EventDispatcher Class The `Slack.EventDispatcher` class enables you to invoke an event handler such as in response to a user opening the app home in Slack. **Usage** Extend the `EventDispatcher` class and override the `invoke()` method. ```java public class MyEventDispatcher extends Slack.EventDispatcher { public override Slack.ActionHandler invoke(Slack.EventParameters parameters, Slack.RequestContext context) { return Slack.ActionHandler.ack(new Handler(parameters, context)); } } ``` **Examples** This example shows an `EventDispatcher` that handles a user opening the app home. ```java public class MyAppHomeOpenedDispatcher extends Slack.EventDispatcher { public override Slack.ActionHandler invoke(Slack.EventParameters parameters, Slack.RequestContext context) { return Slack.ActionHandler.ack(new Handler(parameters, context)); } public class Handler implements Slack.RunnableHandler { Slack.EventParameters parameters; Slack.RequestContext context; public Handler (Slack.EventParameters parameters, Slack.RequestContext context){ this.parameters = parameters; this.context = context; } public void run () { System.debug('App Home Opened'); } } } ``` ### EventDispatcher Method `EventDispatcher` has the following method. #### invoke(parameters, context) Invokes the event handler. **Signature** ```java public override Slack.ActionHandler invoke( Slack.EventParameters parameters, Slack.RequestContext context ) ``` **Parameters** _parameters_ Type: Slack.EventParameters The event parameters for the handler. _context_ Type: Slack.RequestContext Describes the context in which a Slack event is invoked. --- ## EventParameters Class Represents Slack event parameters. ### EventParameters Constructors The following are constructors for `EventParameters`. #### EventParameters(event, eventId, eventTime) Creates an instance of the `Slack.EventParameters` class with the specified event, event ID, and event time. **Signature** ```java public EventParameters(Object event, String eventId, Integer eventTime) ``` **Parameters** _event_ Type: Object The event object, including the event type, timestamp, and triggering user. See [Slack API: Event type structure](https://api.slack.com/apis/connections/events-api#the-events-api__receiving-events__event-type-structure). _eventId_ Type: String _eventTime_ Type: Integer ### EventParameters Methods The following are methods for `EventParameters`. #### getEvent() **Signature** ```java public Object getEvent() ``` **Return Value** Type: Object #### getEventId() **Signature** ```java public String getEventId() ``` **Return Value** Type: String #### getEventTime() **Signature** ```java public Integer getEventTime() ``` **Return Value** Type: Integer ## AppHomeOpenedEvent Class Represents the [app_home_opened event](https://api.slack.com/events/app_home_opened). This event notifies your app when a user has entered your app home. **Usage** Use the `app_home_opened` event for an onboarding flow from your app home. See [Onboarding with App Home](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/views_onboarding.md). This event is only sent to your app when a user has already clicked on your app. It's sent each time a user enters your app home. Your Slack app must have a [bot user](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/scopes.md#bot-token) configured and installed to use this event. ```java Slack.App app = Slack.App.ApexSlackApp.get(); Slack.BotClient botClient = app.getBotClientForTeam(context.getTeamId()); Slack.AppHomeOpenedEvent appHomeOpened = (Slack.AppHomeOpenedEvent) parameters.getEvent(); String userId = appHomeOpened.getUser(); ``` ### AppHomeOpenedEvent Methods The following are methods for `AppHomeOpenedEvent`. #### getChannel() **Signature** ```java public String getChannel() ``` **Return Value** Type: String #### getEventTs() Gets the event timestamp. **Signature** ```java public String getEventTs() ``` **Return Value** Type: String #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getTab() Gets the name of the tab, for example, `home`. **Signature** ```java public String getTab() ``` **Return Value** Type: String #### getType() Gets the type of event, for example, `app_home_opened`. **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUser() Gets the user who triggered the event. **Signature** ```java public String getUser() ``` **Return Value** Type: String #### setChannel(channel) **Signature** ```java public void setChannel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: void #### setEventTs(eventTs) Sets the event timestamp. **Signature** ```java public void setEventTs(String eventTs) ``` **Parameters** _eventTs_ Type: String **Return Value** Type: void #### setTab(tab) Sets the name of the tab. **Signature** ```java public void setTab(String tab) ``` **Parameters** _tab_ Type: String **Return Value** Type: void #### setUser(user) Sets the user who triggers the event. **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void ## AppMentionEvent Class Represents the [app_mention event](https://api.slack.com/events/app_mention). This event allows your app to subscribe to message events that directly mention your app or bot. ### AppMentionEvent Methods The following are methods for `AppMentionEvent`. #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void ## EmojiChangedEvent Class Represents the [emoji_changed event](https://api.slack.com/events/emoji_changed). This event notifies your app when a custom emoji has been added or changed. ### EmojiChangedEvent Methods The following are methods for `EmojiChangedEvent`. #### getEventTs() **Signature** ```java public String getEventTs() ``` **Return Value** Type: String #### getName() **Signature** ```java public String getName() ``` **Return Value** Type: String #### getNames() **Signature** ```java public List getNames() ``` **Return Value** Type: List #### getNewName() **Signature** ```java public String getNewName() ``` **Return Value** Type: String #### getOldName() **Signature** ```java public String getOldName() ``` **Return Value** Type: String #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getValue() **Signature** ```java public String getValue() ``` **Return Value** Type: String #### setEventTs(eventTs) **Signature** ```java public void setEventTs(String eventTs) ``` **Parameters** _eventTs_ Type: String **Return Value** Type: void #### setName(name) **Signature** ```java public void setName(String name) ``` **Parameters** _name_ Type: String **Return Value** Type: void #### setNames(names) **Signature** ```java public void setNames(List names) ``` **Parameters** _names_ Type: List **Return Value** Type: void #### setNewName(newName) **Signature** ```java public void setNewName(String newName) ``` **Parameters** _newName_ Type: String **Return Value** Type: void #### setOldName(oldName) **Signature** ```java public void setOldName(String oldName) ``` **Parameters** _oldName_ Type: String **Return Value** Type: void #### setSubtype(subtype) **Signature** ```java public void setSubtype(String subtype) ``` **Parameters** _subtype_ Type: String **Return Value** Type: void #### setValue(value) **Signature** ```java public void setValue(String value) ``` **Parameters** _value_ Type: String **Return Value** Type: void ## FileChangeEvent Class This event is sent when any property of a file is changed. ### FileChangeEvent Methods The following are methods for `FileChangeEvent' #### getFile() **Signature** ```java public Slack.FileChangeEvent.File getFile() ``` **Return Value** Type: Slack.FileChangeEvent.File #### getFileId() **Signature** ```java public String getFileId() ``` **Return Value** Type: String #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### setFile(file) **Signature** ```java public void setFile(Slack.FileChangeEvent.File file) ``` **Parameters** _file_ Type: Slack.FileChangeEvent.File **Return Value** Type: void #### setFileId(fileId) **Signature** ```java public void setFileId(String fileId) ``` **Parameters** _fileId_ Type: String **Return Value** Type: void ## FileCreatedEvent Class This event is sent to all connected clients for a user when that user uploads a file to Slack. ### FileCreatedEvent Methods The following are methods for `FileCreatedEvent' #### getEventTs() **Signature** ```java public String getEventTs() ``` **Return Value** Type: String #### getFile() **Signature** ```java public Slack.FileCreatedEvent.File getFile() ``` **Return Value** Type: Slack.FileCreatedEvent.File #### getFileId() **Signature** ```java public String getFileId() ``` **Return Value** Type: String #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUserId() **Signature** ```java public String getUserId() ``` **Return Value** Type: String #### setFile(file) **Signature** ```java public void setFile(Slack.FileCreatedEvent.File file) ``` **Parameters** _file_ Type: Slack.FileCreatedEvent.File **Return Value** Type: void #### setFileId(fileId) **Signature** ```java public void setFileId(String fileId) ``` **Parameters** _fileId_ Type: String **Return Value** Type: void #### setUserId(userId) **Signature** ```java public void setUserId(String userId) ``` **Parameters** _userId_ Type: String **Return Value** Type: void ## FileDeletedEvent Class This event is sent to all connected clients for a workspace when a file is deleted. ### FileDeletedEvent Methods The following are methods for `FileDeletedEvent' #### getChannelIds() **Signature** ```java public List getChannelIds() ``` **Return Value** Type: List #### getEventTs() **Signature** ```java public String getEventTs() ``` **Return Value** Type: String #### getFileId() **Signature** ```java public String getFileId() ``` **Return Value** Type: String #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### setChannelIds(channelIds) **Signature** ```java public void setChannelIds(List channelIds) ``` **Parameters** _channelIds_ Type: List **Return Value** Type: void #### setEventTs(eventTs) **Signature** ```java public void setEventTs(String eventTs) ``` **Parameters** _eventTs_ Type: String **Return Value** Type: void #### setFileId(fileId) **Signature** ```java public void setFileId(String fileId) ``` **Parameters** _fileId_ Type: String **Return Value** Type: void ## FilePublicEvent Class This event is sent when a file is made public. ### FilePublicEvent Methods The following are methods for `FilePublicEvent' #### getEventTs() **Signature** ```java public String getEventTs() ``` **Return Value** Type: String #### getFile() **Signature** ```java public Slack.FilePublicEvent.File getFile() ``` **Return Value** Type: Slack.FilePublicEvent.File #### getFileId() **Signature** ```java public String getFileId() ``` **Return Value** Type: String #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUserId() **Signature** ```java public String getUserId() ``` **Return Value** Type: String #### setEventTs(eventTs) **Signature** ```java public void setEventTs(String eventTs) ``` **Parameters** _eventTs_ Type: String **Return Value** Type: void #### setFile(file) **Signature** ```java public void setFile(Slack.FilePublicEvent.File file) ``` **Parameters** _file_ Type: Slack.FilePublicEvent.File **Return Value** Type: void #### setFileId(fileId) **Signature** ```java public void setFileId(String fileId) ``` **Parameters** _fileId_ Type: String **Return Value** Type: void #### setUserId(userId) **Signature** ```java public void setUserId(String userId) ``` **Parameters** _userId_ Type: String **Return Value** Type: void ## FileSharedEvent Class This event is sent when a file is shared. ### FileSharedEvent Methods The following are methods for `FileSharedEvent' #### getChannelId() **Signature** ```java public String getChannelId() ``` **Return Value** Type: String #### getEventTs() **Signature** ```java public String getEventTs() ``` **Return Value** Type: String #### getFile() **Signature** ```java public Slack.FileSharedEvent.File getFile() ``` **Return Value** Type: Slack.FileSharedEvent.File #### getFileId() **Signature** ```java public String getFileId() ``` **Return Value** Type: String #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUserId() **Signature** ```java public String getUserId() ``` **Return Value** Type: String #### setChannelId(channelId) **Signature** ```java public void setChannelId(String channelId) ``` **Parameters** _channelId_ Type: String **Return Value** Type: void #### setEventTs(eventTs) **Signature** ```java public void setEventTs(String eventTs) ``` **Parameters** _eventTs_ Type: String **Return Value** Type: void #### setFile(file) **Signature** ```java public void setFile(Slack.FileSharedEvent.File file) ``` **Parameters** _file_ Type: Slack.FileSharedEvent.File **Return Value** Type: void #### setFileId(fileId) **Signature** ```java public void setFileId(String fileId) ``` **Parameters** _fileId_ Type: String **Return Value** Type: void #### setUserId(userId) **Signature** ```java public void setUserId(String userId) ``` **Parameters** _userId_ Type: String **Return Value** Type: void ## FileUnsharedEvent Class ### FileUnsharedEvent Methods The following are methods for `FileUnsharedEvent' #### getChannelId() **Signature** ```java public String getChannelId() ``` **Return Value** Type: String #### getEventTs() **Signature** ```java public String getEventTs() ``` **Return Value** Type: String #### getFile() **Signature** ```java public Slack.FileUnsharedEvent.File getFile() ``` **Return Value** Type: Slack.FileUnsharedEvent.File #### getFileId() **Signature** ```java public String getFileId() ``` **Return Value** Type: String #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUserId() **Signature** ```java public String getUserId() ``` **Return Value** Type: String #### setChannelId(channelId) **Signature** ```java public void setChannelId(String channelId) ``` **Parameters** _channelId_ Type: String **Return Value** Type: void #### setEventTs(eventTs) **Signature** ```java public void setEventTs(String eventTs) ``` **Parameters** _eventTs_ Type: String **Return Value** Type: void #### setFile(file) **Signature** ```java public void setFile(Slack.FileUnsharedEvent.File file) ``` **Parameters** _file_ Type: Slack.FileUnsharedEvent.File **Return Value** Type: void #### setFileId(fileId) **Signature** ```java public void setFileId(String fileId) ``` **Parameters** _fileId_ Type: String **Return Value** Type: void #### setUserId(userId) **Signature** ```java public void setUserId(String userId) ``` **Parameters** _userId_ Type: String **Return Value** Type: void ## MessageBotEvent Class Represents the [bot_message event](https://api.slack.com/events/message/bot_message). This event notifies your app when a message was sent to a channel by a bot. ### MessageBotEvent Methods The following are methods for `MessageBotEvent`. #### getBotId() **Signature** ```java public String getBotId() ``` **Return Value** Type: String #### getChannel() **Signature** ```java public String getChannel() ``` **Return Value** Type: String #### getChannelType() **Signature** ```java public String getChannelType() ``` **Return Value** Type: String #### getEventTs() **Signature** ```java public String getEventTs() ``` **Return Value** Type: String #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getText() **Signature** ```java public String getText() ``` **Return Value** Type: String #### getThreadTs() **Signature** ```java public String getThreadTs() ``` **Return Value** Type: String #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUsername() **Signature** ```java public String getUsername() ``` **Return Value** Type: String #### setBotId(botId) **Signature** ```java public void setBotId(String botId) ``` **Parameters** _botId_ Type: String **Return Value** Type: void #### setChannel(channel) **Signature** ```java public void setChannel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: void #### setChannelType(channelType) **Signature** ```java public void setChannelType(String channelType) ``` **Parameters** _channelType_ Type: String **Return Value** Type: void #### setEventTs(eventTs) **Signature** ```java public void setEventTs(String eventTs) ``` **Parameters** _eventTs_ Type: String **Return Value** Type: void #### setText(text) **Signature** ```java public void setText(String text) ``` **Parameters** _text_ Type: String **Return Value** Type: void #### setThreadTs(threadTs) **Signature** ```java public void setThreadTs(String threadTs) ``` **Parameters** _threadTs_ Type: String **Return Value** Type: void #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void #### setUsername(username) **Signature** ```java public void setUsername(String username) ``` **Parameters** _username_ Type: String **Return Value** Type: void ## MessageChangedEvent Class Represents the [message_changed event](https://api.slack.com/events/message/message_changed). This event notifies your app when a message in a channel is edited. ### MessageChangedEvent Methods The following are methods for `MessageChangedEvent`. #### getChannel() **Signature** ```java public String getChannel() ``` **Return Value** Type: String #### getChannelType() **Signature** ```java public String getChannelType() ``` **Return Value** Type: String #### getEventTs() **Signature** ```java public String getEventTs() ``` **Return Value** Type: String #### getMessage() **Signature** ```java public Slack.MessageChangedEvent.Message getMessage() ``` **Return Value** Type: Slack.MessageChangedEvent.Message #### getPreviousMessage() **Signature** ```java public Slack.MessageChangedEvent.PreviousMessage getPreviousMessage() ``` **Return Value** Type: Slack.MessageChangedEvent.PreviousMessage #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### isHidden() **Signature** ```java public Boolean isHidden() ``` **Return Value** Type: Boolean #### setChannel(channel) **Signature** ```java public void setChannel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: void #### setChannelType(channelType) **Signature** ```java public void setChannelType(String channelType) ``` **Parameters** _channelType_ Type: String **Return Value** Type: void #### setEventTs(eventTs) **Signature** ```java public void setEventTs(String eventTs) ``` **Parameters** _eventTs_ Type: String **Return Value** Type: void #### setHidden(hidden) **Signature** ```java public void setHidden(Boolean hidden) ``` **Parameters** _hidden_ Type: Boolean **Return Value** Type: void #### setMessage(message) **Signature** ```java public void setMessage(Slack.MessageChangedEvent.Message message) ``` **Parameters** _message_ Type: Slack.MessageChangedEvent.Message **Return Value** Type: void #### setPreviousMessage(previousMessage) **Signature** ```java public void setPreviousMessage(Slack.MessageChangedEvent.PreviousMessage previousMessage) ``` **Parameters** _previousMessage_ Type: Slack.MessageChangedEvent.PreviousMessage **Return Value** Type: void #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void ## MessageChangedEvent.Edited Class ### MessageChangedEvent.Edited Methods The following are methods for `MessageChangedEvent.Edited`. #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void ## MessageChangedEvent.Message Class ### MessageChangedEvent.Message Methods The following are methods for `MessageChangedEvent.Message`. #### getBotId() **Signature** ```java public String getBotId() ``` **Return Value** Type: String #### getBotProfile() **Signature** ```java public Slack.BotProfile getBotProfile() ``` **Return Value** Type: Slack.BotProfile #### getClientMsgId() **Signature** ```java public String getClientMsgId() ``` **Return Value** Type: String #### getDisplayAsBot() **Signature** ```java public Boolean getDisplayAsBot() ``` **Return Value** Type: Boolean #### getFiles() **Signature** ```java public List getFiles() ``` **Return Value** Type: List #### getHidden() **Signature** ```java public Boolean getHidden() ``` **Return Value** Type: Boolean #### getIsLocked() **Signature** ```java public Boolean getIsLocked() ``` **Return Value** Type: Boolean #### getLastRead() **Signature** ```java public String getLastRead() ``` **Return Value** Type: String #### getLatestReply() **Signature** ```java public String getLatestReply() ``` **Return Value** Type: String #### getParentUserId() **Signature** ```java public String getParentUserId() ``` **Return Value** Type: String #### getPinnedTo() **Signature** ```java public List getPinnedTo() ``` **Return Value** Type: List #### getReactions() **Signature** ```java public List getReactions() ``` **Return Value** Type: List #### getReplyCount() **Signature** ```java public Integer getReplyCount() ``` **Return Value** Type: Integer #### getReplyUsers() **Signature** ```java public List getReplyUsers() ``` **Return Value** Type: List #### getReplyUsersCount() **Signature** ```java public Integer getReplyUsersCount() ``` **Return Value** Type: Integer #### getSourceTeam() **Signature** ```java public String getSourceTeam() ``` **Return Value** Type: String #### getSubscribed() **Signature** ```java public Boolean getSubscribed() ``` **Return Value** Type: Boolean #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getTeam() **Signature** ```java public String getTeam() ``` **Return Value** Type: String #### getText() **Signature** ```java public String getText() ``` **Return Value** Type: String #### getThreadTs() **Signature** ```java public String getThreadTs() ``` **Return Value** Type: String #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUpload() **Signature** ```java public Boolean getUpload() ``` **Return Value** Type: Boolean #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### getUserTeam() **Signature** ```java public String getUserTeam() ``` **Return Value** Type: String #### getXFiles() **Signature** ```java public List getXFiles() ``` **Return Value** Type: List #### isStarred() **Signature** ```java public Boolean isStarred() ``` **Return Value** Type: Boolean #### setBotId(botId) **Signature** ```java public void setBotId(String botId) ``` **Parameters** _botId_ Type: String **Return Value** Type: void #### setBotProfile(botProfile) **Signature** ```java public void setBotProfile(Slack.BotProfile botProfile) ``` **Parameters** _botProfile_ Type: Slack.BotProfile **Return Value** Type: void #### setClientMsgId(clientMsgId) **Signature** ```java public void setClientMsgId(String clientMsgId) ``` **Parameters** _clientMsgId_ Type: String **Return Value** Type: void #### setDisplayAsBot(displayAsBot) **Signature** ```java public void setDisplayAsBot(Boolean displayAsBot) ``` **Parameters** _displayAsBot_ Type: Boolean **Return Value** Type: void #### setFiles(files) **Signature** ```java public void setFiles(List files) ``` **Parameters** _files_ Type: List **Return Value** Type: void #### setHidden(hidden) **Signature** ```java public void setHidden(Boolean hidden) ``` **Parameters** _hidden_ Type: Boolean **Return Value** Type: void #### setIsLocked(isLocked) **Signature** ```java public void setIsLocked(Boolean isLocked) ``` **Parameters** _isLocked_ Type: Boolean **Return Value** Type: void #### setLastRead(lastRead) **Signature** ```java public void setLastRead(String lastRead) ``` **Parameters** _lastRead_ Type: String **Return Value** Type: void #### setLatestReply(latestReply) **Signature** ```java public void setLatestReply(String latestReply) ``` **Parameters** _latestReply_ Type: String **Return Value** Type: void #### setParentUserId(parentUserId) **Signature** ```java public void setParentUserId(String parentUserId) ``` **Parameters** _parentUserId_ Type: String **Return Value** Type: void #### setPinnedTo(pinnedTo) **Signature** ```java public void setPinnedTo(List pinnedTo) ``` **Parameters** _pinnedTo_ Type: List **Return Value** Type: void #### setReactions(reactions) **Signature** ```java public void setReactions(List reactions) ``` **Parameters** _reactions_ Type: List **Return Value** Type: void #### setReplyCount(replyCount) **Signature** ```java public void setReplyCount(Integer replyCount) ``` **Parameters** _replyCount_ Type: Integer **Return Value** Type: void #### setReplyUsers(replyUsers) **Signature** ```java public void setReplyUsers(List replyUsers) ``` **Parameters** _replyUsers_ Type: List **Return Value** Type: void #### setReplyUsersCount(replyUsersCount) **Signature** ```java public void setReplyUsersCount(Integer replyUsersCount) ``` **Parameters** _replyUsersCount_ Type: Integer **Return Value** Type: void #### setSourceTeam(sourceTeam) **Signature** ```java public void setSourceTeam(String sourceTeam) ``` **Parameters** _sourceTeam_ Type: String **Return Value** Type: void #### setStarred(starred) **Signature** ```java public void setStarred(Boolean starred) ``` **Parameters** _starred_ Type: Boolean **Return Value** Type: void #### setSubscribed(subscribed) **Signature** ```java public void setSubscribed(Boolean subscribed) ``` **Parameters** _subscribed_ Type: Boolean **Return Value** Type: void #### setSubtype(subtype) **Signature** ```java public void setSubtype(String subtype) ``` **Parameters** _subtype_ Type: String **Return Value** Type: void #### setTeam(team) **Signature** ```java public void setTeam(String team) ``` **Parameters** _team_ Type: String **Return Value** Type: void #### setText(text) **Signature** ```java public void setText(String text) ``` **Parameters** _text_ Type: String **Return Value** Type: void #### setThreadTs(threadTs) **Signature** ```java public void setThreadTs(String threadTs) ``` **Parameters** _threadTs_ Type: String **Return Value** Type: void #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void #### setUpload(upload) **Signature** ```java public void setUpload(Boolean upload) ``` **Parameters** _upload_ Type: Boolean **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void #### setUserTeam(userTeam) **Signature** ```java public void setUserTeam(String userTeam) ``` **Parameters** _userTeam_ Type: String **Return Value** Type: void #### setXFiles(xFiles) **Signature** ```java public void setXFiles(List xFiles) ``` **Parameters** _xFiles_ Type: List **Return Value** Type: void ## MesssageChangedEvent.PreviousMessage Class ### MesssageChangedEvent.PreviousMessage Methods The following are methods for `MesssageChangedEvent.PreviousMessage`. #### getMessage() **Signature** ```java public Slack.MessageChangedEvent.Message getMessage() ``` **Return Value** Type: Slack.MessageChangedEvent.Message #### setMessage(message) **Signature** ```java public void setMessage(Slack.MessageChangedEvent.Message message) ``` **Parameters** _message_ Type: Slack.MessageChangedEvent.Message **Return Value** Type: void ## MessageChannelJoinEvent Class Represents the [channel_join event](https://api.slack.com/events/message/channel_join). This event notifies your app when a user joins a channel. ### MessageChannelJoinEvent Methods The following are methods for `MessageChannelJoinEvent`. ## MessageChannelPostingPermissionsEvent Class Represents the [channel_posting_permissions event](https://api.slack.com/events/message/channel_posting_permissions). This event notifies your app that the posting permissions for a channel have been modified by a user. ### MessageChannelPostingPermissionsEvent Methods The following are methods for `MessageChannelPostingPermissionsEvent`. ## MessageChannelTopicEvent Class Represents the [channel_topic event](https://api.slack.com/events/message/channel_topic). This event notifies your app that the topic for a channel is changed. ### MessageChannelTopicEvent Methods The following are methods for `MessageChannelTopicEvent`. ## MessageDeletedEvent Class Represents the [message_deleted event](https://api.slack.com/events/message/message_deleted). This event notifies your app when a message in a channel is deleted. ### MessageDeletedEvent Methods The following are methods for `MessageDeletedEvent`. #### getChannel() **Signature** ```java public String getChannel() ``` **Return Value** Type: String #### getChannelType() **Signature** ```java public String getChannelType() ``` **Return Value** Type: String #### getDeletedTs() **Signature** ```java public String getDeletedTs() ``` **Return Value** Type: String #### getEventTs() **Signature** ```java public String getEventTs() ``` **Return Value** Type: String #### getPreviousMessage() **Signature** ```java public Slack.MessageDeletedEvent.Message getPreviousMessage() ``` **Return Value** Type: Slack.MessageDeletedEvent.Message #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### isHidden() **Signature** ```java public Boolean isHidden() ``` **Return Value** Type: Boolean ### setChannel(channel) **Signature** ```java public void setChannel(String channel) ``` **Parameters** _channel_ Type: String ### setChannelType(channelType) **Signature** ```java public void setChannelType(String channelType) ``` **Parameters** _channel_ Type: String **Return Value** Type: void #### setDeletedTs(deletedTs) **Signature** ```java public void setDeletedTs(String deletedTs) ``` **Parameters** _deletedTs_ Type: String **Return Value** Type: void #### setEventTs(eventTs) **Signature** ```java public void setEventTs(String eventTs) ``` **Parameters** _eventTs_ Type: String **Return Value** Type: void #### setHidden(hidden) **Signature** ```java public void setHidden(Boolean hidden) ``` **Parameters** _hidden_ Type: Boolean **Return Value** Type: void #### setPreviousMessage(previousMessage) **Signature** ```java public void setPreviousMessage(Slack.MessageDeletedEvent.Message previousMessage) ``` **Parameters** _previousMessage_ Type: Slack.MessageDeletedEvent.Message **Return Value** Type: void #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void ## MessageDeletedEvent.Edited Class ### MessageDeletedEvent.Edited Methods The following are methods for `MessageDeletedEvent.Edited`. #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void ## MessageEkmAccessDeniedEvent Class Represents the [ekm_access_denied event](https://api.slack.com/events/message/ekm_access_denied). This event notifies your app when a piece of content is redacted by a workspace's administrators. ### MessageEkmAccessDeniedEvent Methods The following are methods for `MessageEkmAccessDeniedEvent`. #### getChannel() **Signature** ```java public String getChannel() ``` **Return Value** Type: String #### getChannelType() **Signature** ```java public String getChannelType() ``` **Return Value** Type: String #### getEventTs() **Signature** ```java public String getEventTs() ``` **Return Value** Type: String #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getText() **Signature** ```java public String getText() ``` **Return Value** Type: String #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### isHidden() **Signature** ```java public Boolean isHidden() ``` **Return Value** Type: Boolean ### setChannel(channel) **Signature** ```java public void setChannel(String channel) ``` **Parameters** _channel_ Type: String ### setChannelType(channelType) **Signature** ```java public void setChannelType(String channelType) ``` **Parameters** _channelType_ Type: String **Return Value** Type: void ### setEventTs(eventTs) **Signature** ```java public void setEventTs(String eventTs) ``` **Parameters** _eventTs_ Type: String **Return Value** Type: void #### setHidden(hidden) **Signature** ```java public void setHidden(Boolean hidden) ``` **Parameters** _hidden_ Type: Boolean **Return Value** Type: void #### setText(text) **Signature** ```java public void setText(String text) ``` **Parameters** _text_ Type: String **Return Value** Type: void #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _eventTs_ Type: String **Return Value** Type: void #### setUser(user) **Signature** ```java public void setTs(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void ## MessageEvent Class ### MessageEvent Methods The following are methods for `MessageEvent`. #### getBotId() **Signature** ```java public String getBotId() ``` **Return Value** Type: String #### getBotProfile() **Signature** ```java public Slack.BotProfile getBotProfile() ``` **Return Value** Type: Slack.BotProfile #### getChannel() **Signature** ```java public String getChannel() ``` **Return Value** Type: String #### getChannelType() **Signature** ```java public String getChannelType() ``` **Return Value** Type: String #### getClientMsgId() **Signature** ```java public String getClientMsgId() ``` **Return Value** Type: String #### getEdited() **Signature** ```java public Slack.MessageEvent.Edited getEdited() ``` **Return Value** Type: Slack.MessageEvent.Edited #### getEventTs() **Signature** ```java public String getEventTs() ``` **Return Value** Type: String #### getFiles() **Signature** ```java public List getFiles() ``` **Return Value** Type: List #### getParentUserId() **Signature** ```java public String getParentUserId() ``` **Return Value** Type: String #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getTeam() **Signature** ```java public String getTeam() ``` **Return Value** Type: String #### getText() **Signature** ```java public String getText() ``` **Return Value** Type: String #### getThreadTs() **Signature** ```java public String getThreadTs() ``` **Return Value** Type: String #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### setBotId(botId) **Signature** ```java public void setBotId(String botId) ``` **Parameters** _botId_ Type: String **Return Value** Type: void #### setBotProfile(botProfile) Description? **Signature** ```java public void setBotProfile(Slack.BotProfile botProfile) ``` **Parameters** _botProfilem_ Type: setBotProfile **Return Value** Type: void #### setChannel(channel) **Signature** ```java public void setChannel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: void #### setChannelType(channelType) **Signature** ```java public void setChannelType(String channelType) ``` **Parameters** _channelType_ Type: String **Return Value** Type: void #### setClientMsgId(clientMsgId) **Signature** ```java public void setClientMsgId(String clientMsgId) ``` **Parameters** _clientMsgId_ Type: String **Return Value** Type: void #### setEdited(edited) **Signature** ```java public void setEdited(Slack.MessageEvent.Edited edited) ``` **Parameters** _edited_ Type: Slack.MessageEvent.Edited **Return Value** Type: void #### setEventTs(eventTs) **Signature** ```java public void setEventTs(String eventTs) ``` **Parameters** _eventTs_ Type: String **Return Value** Type: void #### setFiles(files) **Signature** ```java public void setFiles(List files) ``` **Parameters** _files_ Type: List **Return Value** Type: void #### setParentUserId(parentUserId) **Signature** ```java public void setParentUserId(String parentUserId) ``` **Parameters** _parentUserId_ Type: String **Return Value** Type: void #### setTeam(team) **Signature** ```java public void setTeam(String team) ``` **Parameters** _team_ Type: String **Return Value** Type: void #### setText(text) **Signature** ```java public void setText(String text) ``` **Parameters** _text_ Type: String **Return Value** Type: void #### setThreadTs(threadTs) **Signature** ```java public void setThreadTs(String threadTs) ``` **Parameters** _threadTs_ Type: String **Return Value** Type: void #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void ## MessageEvent.Edited Class ### MessageEvent.Edited Methods The following are methods for `MessageEvent.Edited`. #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void ## MessageFileShareEvent Class Represents the [file_share event](https://api.slack.com/events/message/file_share). This event notifies your app when a file is shared in a channel. ### MessageFileShareEvent Methods The following are methods for `MessageFileShareEvent`. #### getChannel() **Signature** ```java public String getChannel() ``` **Return Value** Type: String #### getChannelType() **Signature** ```java public String getChannelType() ``` **Return Value** Type: String #### getDisplayAsBot() **Signature** ```java public Boolean getDisplayAsBot() ``` **Return Value** Type: Boolean #### getEventTs() **Signature** ```java public String getEventTs() ``` **Return Value** Type: String #### getFiles() **Signature** ```java public List getFiles() ``` **Return Value** Type: List #### getParentUserId() **Signature** ```java public String getParentUserId() ``` **Return Value** Type: String #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getText() **Signature** ```java public String getText() ``` **Return Value** Type: String #### getThreadTs() **Signature** ```java public String getThreadTs() ``` **Return Value** Type: String #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUpload() **Signature** ```java public Boolean getUpload() ``` **Return Value** Type: Boolean #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### getXFiles() **Signature** ```java public List getXFiles() ``` **Return Value** Type: List\ #### setChannel(channel) **Signature** ```java public void setChannel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: void #### setChannelType(channelType) **Signature** ```java public void setChannelType(String channelType) ``` **Parameters** _channelType_ Type: String **Return Value** Type: void #### setDisplayAsBot(displayAsBot) **Signature** ```java public void setDisplayAsBot(Boolean displayAsBot) ``` **Parameters** _displayAsBot_ Type: Boolean **Return Value** Type: void #### setEventTs(eventTs) **Signature** ```java public void setEventTs(String eventTs) ``` **Parameters** _eventTs_ Type: String **Return Value** Type: void #### setFiles(files) **Signature** ```java public void setFiles(List files) ``` **Parameters** _files_ Type: List **Return Value** Type: void #### setParentUserId(parentUserId) **Signature** ```java public void setParentUserId(String parentUserId) ``` **Parameters** _parentUserId_ Type: String **Return Value** Type: void #### setText(text) **Signature** ```java public void setText(String text) ``` **Parameters** _text_ Type: String **Return Value** Type: void #### setThreadTs(threadTs) **Signature** ```java public void setThreadTs(String threadTs) ``` **Parameters** _threadTs_ Type: String **Return Value** Type: void #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void #### setUpload(upload) **Signature** ```java public void setUpload(Boolean upload) ``` **Parameters** _upload_ Type: Boolean **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void #### setXFiles(xFiles) **Signature** ```java public void setXFiles(List xFiles) ``` **Parameters** _xFiles_ Type: List\ **Return Value** Type: void ## MessageGroupTopicEvent Class Represents the [group_topic event](https://api.slack.com/events/message/group_topic). This event notifies your app when the topic for a private group is changed. ### MessageGroupTopicEvent Methods The following are methods for `MessageGroupTopicEvent`. #### getChannel() **Signature** ```java public String getChannel() ``` **Return Value** Type: String #### getChannelType() **Signature** ```java public String getChannelType() ``` **Return Value** Type: String #### getEventTs() **Signature** ```java public String getEventTs() ``` **Return Value** Type: String #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getText() **Signature** ```java public String getText() ``` **Return Value** Type: String #### getTopic() **Signature** ```java public String getTopic() ``` **Return Value** Type: String #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### setChannel(channel) **Signature** ```java public void setChannel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: void #### setChannelType(channelType) **Signature** ```java public void setChannelType(String channelType) ``` **Parameters** _channelType_ Type: String **Return Value** Type: void #### setEventTs(eventTs) **Signature** ```java public void setEventTs(String eventTs) ``` **Parameters** _eventTs_ Type: String **Return Value** Type: void #### setText(text) **Signature** ```java public void setText(String text) ``` **Parameters** _text_ Type: String **Return Value** Type: void #### setTopic(topic) **Signature** ```java public void setTopic(String topic) ``` **Parameters** _topic_ Type: String **Return Value** Type: void #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void ## MessageMeEvent Class Represents the [me_message event](https://api.slack.com/events/message/me_message). This event notifies your app when a channel member performs an action using the `/me` command. ### MessageMeEvent Methods The following are methods for `MessageMeEvent`. #### getBotId() **Signature** ```java public String getBotId() ``` **Return Value** Type: String #### getChannel() **Signature** ```java public String getChannel() ``` **Return Value** Type: String #### getChannelType() **Signature** ```java public String getChannelType() ``` **Return Value** Type: String #### getEventTs() **Signature** ```java public String getEventTs() ``` **Return Value** Type: String #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getText() **Signature** ```java public String getText() ``` **Return Value** Type: String #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUsername() **Signature** ```java public String getUsername() ``` **Return Value** Type: String #### setBotId(botId) **Signature** ```java public void setBotId(String botId) ``` **Parameters** _botId_ Type: String **Return Value** Type: void #### setChannel(channel) **Signature** ```java public void setChannel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: void #### setChannelType(channelType) **Signature** ```java public void setChannelType(String channelType) ``` **Parameters** _channelType_ Type: String **Return Value** Type: void #### setEventTs(eventTs) **Signature** ```java public void setEventTs(String eventTs) ``` **Parameters** _eventTs_ Type: String **Return Value** Type: void #### setText(text) **Signature** ```java public void setText(String text) ``` **Parameters** _text_ Type: String **Return Value** Type: void #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void #### setUsername(username) **Signature** ```java public void setUsername(String username) ``` **Parameters** _username_ Type: String **Return Value** Type: void ## MessageRepliedEvent Class Represents the [message_replied event](https://api.slack.com/events/message/message_replied). This event notifies your app when a channel's message is a reply to another message (its parent). ### MessageRepliedEvent Methods The following are methods for `MessageRepliedEvent`. #### getChannel() **Signature** ```java public String getChannel() ``` **Return Value** Type: String #### getEventTs() **Signature** ```java public String getEventTs() ``` **Return Value** Type: String #### getMessage() **Signature** ```java public Slack.MessageRepliedEvent.Message getMessage() ``` **Return Value** Type: Slack.MessageRepliedEvent.Message #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### isHidden() **Signature** ```java public Boolean isHidden() ``` **Return Value** Type: Boolean #### setChannel(channel) **Signature** ```java public void setChannel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: void #### setEventTs(eventTs) **Signature** ```java public void setEventTs(String eventTs) ``` **Parameters** _eventTs_ Type: String **Return Value** Type: void #### setHidden(hidden) **Signature** ```java public void setHidden(Boolean hidden) ``` **Parameters** _hidden_ Type: Boolean **Return Value** Type: void #### setMessage(message) **Signature** ```java public void setMessage(Slack.MessageRepliedEvent.Message message) ``` **Parameters** _param_ Type: String **Return Value** Type: void #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void ## MessageRepliedEvent.Edited Class ### MessageRepliedEvent.Edited Methods The following are methods for `MessageRepliedEvent.Edited`. #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void ## MessageRepliedEvent.Message Class ### MessageRepliedEvent.Message Methods The following are methods for `MessageRepliedEvent.Message`. #### getClientMsgId() **Signature** ```java public String getClientMsgId() ``` **Return Value** Type: String #### getPinnedTo() **Signature** ```java public List getPinnedTo() ``` **Return Value** Type: List #### getReactions() **Signature** ```java public List getReactions() ``` **Return Value** Type: List #### getSourceTeam() **Signature** ```java public String getSourceTeam() ``` **Return Value** Type: String #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getTeam() **Signature** ```java public String getTeam() ``` **Return Value** Type: String #### getText() **Signature** ```java public String getText() ``` **Return Value** Type: String #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### getUserTeam() **Signature** ```java public String getUserTeam() ``` **Return Value** Type: String #### isStarred() **Signature** ```java public Boolean isStarred() ``` **Return Value** Type: Boolean #### setClientMsgId(clientMsgId) **Signature** ```java public void setClientMsgId(String clientMsgId) ``` **Parameters** _clientMsgId_ Type: String **Return Value** Type: void #### setPinnedTo(pinnedTo) **Signature** ```java public void setPinnedTo(List pinnedTo) ``` **Parameters** _pinnedTo_ Type: List **Return Value** Type: void #### setReactions(reactions) **Signature** ```java public void setReactions(List reactions) ``` **Parameters** _reactions_ Type: List **Return Value** Type: void #### setSourceTeam(sourceTeam) **Signature** ```java public void setSourceTeam(String sourceTeam) ``` **Parameters** _sourceTeam_ Type: String **Return Value** Type: void #### setStarred(starred) **Signature** ```java public void setStarred(Boolean starred) ``` **Parameters** _starred_ Type: Boolean **Return Value** Type: void #### setSubtype(subtype) **Signature** ```java public void setSubtype(String subtype) ``` **Parameters** _subtype_ Type: String **Return Value** Type: void #### setTeam(team) **Signature** ```java public void setTeam(String team) ``` **Parameters** _team_ Type: String **Return Value** Type: void #### setText(text) **Signature** ```java public void setText(String text) ``` **Parameters** _text_ Type: String **Return Value** Type: void #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void #### setUserTeam(userTeam) **Signature** ```java public void setUserTeam(String userTeam) ``` **Parameters** _userTeam_ Type: String **Return Value** Type: void ## MessageThreadBroadcastEvent Class Represents the [thread_broadcast event](https://api.slack.com/events/message/thread_broadcast). This event notifies your app when a user or bot user has indicated their reply should be broadcast to the whole channel. ### MessageThreadBroadcastEvent Methods The following are methods for `MessageThreadBroadcastEvent`. #### getChannel() **Signature** ```java public String getChannel() ``` **Return Value** Type: String #### getChannelType() **Signature** ```java public String getChannelType() ``` **Return Value** Type: String #### getClientMsgId() **Signature** ```java public String getClientMsgId() ``` **Return Value** Type: String #### getEventTs() **Signature** ```java public String getEventTs() ``` **Return Value** Type: String #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getText() **Signature** ```java public String getText() ``` **Return Value** Type: String #### getThreadTs() **Signature** ```java public String getThreadTs() ``` **Return Value** Type: String #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### setChannel(channel) **Signature** ```java public void setChannel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: void #### setChannelType(channelType) **Signature** ```java public void setChannelType(String channelType) ``` **Parameters** _channelType_ Type: String **Return Value** Type: void #### setClientMsgId(clientMsgId) **Signature** ```java public void setClientMsgId(String clientMsgId) ``` **Parameters** _clientMsgId_ Type: String **Return Value** Type: void #### setEventTs(eventTs) **Signature** ```java public void setEventTs(String eventTs) ``` **Parameters** _eventTs_ Type: String **Return Value** Type: void #### setText(text) **Signature** ```java public void setText(String text) ``` **Parameters** _text_ Type: String **Return Value** Type: void #### setThreadTs(threadTs) **Signature** ```java public void setThreadTs(String threadTs) ``` **Parameters** _threadTs_ Type: String **Return Value** Type: void #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void ## PinAddedEvent Class Represents the [pin_added event](https://api.slack.com/events/pin_added). This event notifies your app when an item is pinned in a channel. ### PinAddedEvent Methods The following are methods for `PinAddedEvent`. #### getChannelId() **Signature** ```java public String getChannelId() ``` **Return Value** Type: String #### getEventTs() **Signature** ```java public String getEventTs() ``` **Return Value** Type: String #### getItem() **Signature** ```java public Slack.PinAddedEvent.Item getItem() ``` **Return Value** Type: Slack.PinAddedEvent.Item #### getItemUser() **Signature** ```java public String getItemUser() ``` **Return Value** Type: String #### getPinCount() **Signature** ```java public Integer getPinCount() ``` **Return Value** Type: Integer #### getPinnedInfo() **Signature** ```java public Slack.PinAddedEvent.PinnedInfo getPinnedInfo() ``` **Return Value** Type: Slack.PinAddedEvent.PinnedInfo #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### setChannelId(channelId) **Signature** ```java public void setChannelId(String channelId) ``` **Parameters** _channelId_ Type: String **Return Value** Type: void #### setEventTs(eventTs) **Signature** ```java public void setEventTs(String eventTs) ``` **Parameters** _eventTs_ Type: String **Return Value** Type: void #### setItem(item) **Signature** ```java public void setItem(Slack.PinAddedEvent.Item item) ``` **Parameters** _item_ Type: Slack.PinAddedEvent.Item **Return Value** Type: void #### setItemUser(itemUser) **Signature** ```java public void setItemUser(String itemUser) ``` **Parameters** _itemUser_ Type: String **Return Value** Type: void #### setPinCount(pinCount) **Signature** ```java public void setPinCount(Integer pinCount) ``` **Parameters** _pinCount_ Type: Integer **Return Value** Type: void #### setPinnedInfo(pinnedInfo) **Signature** ```java public void setPinnedInfo(Slack.PinAddedEvent.PinnedInfo pinnedInfo) ``` **Parameters** _pinnedInfo_ Type: Slack.PinAddedEvent.PinnedInfo **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void ## PinAddedEvent.Item Class ### PinAddedEvent.Item Methods The following are methods for `PinAddedEvent.Item`. #### getChannel() **Signature** ```java public String getChannel() ``` **Return Value** Type: String #### getComment() **Signature** ```java public Slack.FileComment getComment() ``` **Return Value** Type: Slack.FileComment #### getCreated() **Signature** ```java public Integer getCreated() ``` **Return Value** Type: Integer #### getCreatedBy() **Signature** ```java public String getCreatedBy() ``` **Return Value** Type: String #### getFile() **Signature** ```java public Slack.File getFile() ``` **Return Value** Type: Slack.File #### getMessage() **Signature** ```java public Slack.PinAddedEvent.Message getMessage() ``` **Return Value** Type: Slack.PinAddedEvent.Message #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### setChannel(channel) **Signature** ```java public void setChannel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: void #### setComment(comment) **Signature** ```java public void setComment(Slack.FileComment comment) ``` **Parameters** _comment_ Type: Slack.FileComment **Return Value** Type: void #### setCreated(created) **Signature** ```java public void setCreated(Integer created) ``` **Parameters** _created_ Type: Integer **Return Value** Type: void #### setCreatedBy(createdBy) **Signature** ```java public void setCreatedBy(String createdBy) ``` **Parameters** _createdBy_ Type: String **Return Value** Type: void #### setFile(file) **Signature** ```java public void setFile(Slack.File file) ``` **Parameters** _file_ Type: Slack.File **Return Value** Type: void #### setMessage(message) **Signature** ```java public void setMessage(Slack.PinAddedEvent.Message message) ``` **Parameters** _message_ Type: Slack.PinAddedEvent.Message **Return Value** Type: void #### setType(type) **Signature** ```java public void setType(String type) ``` **Parameters** _type_ Type: String **Return Value** Type: void ## PinAddedEvent.Message Class ### PinAddedEvent.Message Methods The following are methods for `PinAddedEvent.Message`. #### getAppId() **Signature** ```java public String getAppId() ``` **Return Value** Type: String #### getBotId() **Signature** ```java public String getBotId() ``` **Return Value** Type: String #### getBotProfile() **Signature** ```java public Slack.BotProfile getBotProfile() ``` **Return Value** Type: Slack.BotProfile #### getClientMsgId() **Signature** ```java public String getClientMsgId() ``` **Return Value** Type: String #### getPermalink() **Signature** ```java public String getPermalink() ``` **Return Value** Type: String #### getPinnedTo() **Signature** ```java public List getPinnedTo() ``` **Return Value** Type: List #### getTeam() **Signature** ```java public String getTeam() ``` **Return Value** Type: String #### getText() **Signature** ```java public String getText() ``` **Return Value** Type: String #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### setBotId(botId) **Signature** ```java public void setBotId(String botId) ``` **Parameters** _botId_ Type: String **Return Value** Type: void #### setBotProfile(botProfile) **Signature** ```java public void setBotProfile(Slack.BotProfile botProfile) ``` **Parameters** _botProfile_ Type: Slack.BotProfile **Return Value** Type: void #### setClientMsgId(clientMsgId) **Signature** ```java public void setClientMsgId(String clientMsgId) ``` **Parameters** _clientMsgId_ Type: String **Return Value** Type: void #### setPermalink(permalink) **Signature** ```java public void setPermalink(String permalink) ``` **Parameters** _permalink_ Type: String **Return Value** Type: void #### setPinnedTo(pinnedTo) **Signature** ```java public void setPinnedTo(List pinnedTo) ``` **Parameters** _pinnedTo_ Type: List **Return Value** Type: void #### setTeam(team) **Signature** ```java public void setTeam(String team) ``` **Parameters** _team_ Type: String **Return Value** Type: void #### setText(text) **Signature** ```java public void setText(String text) ``` **Parameters** _text_ Type: String **Return Value** Type: void #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void #### setType(type) **Signature** ```java public void setType(String type) ``` **Parameters** _type_ Type: String **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void ## PinAddedEvent.PinnedInfo Class ### PinAddedEvent.PinnedInfo Methods The following are methods for `PinAddedEvent.PinnedInfo`. #### getChannel() **Signature** ```java public String getChannel() ``` **Return Value** Type: String #### getPinnedBy() **Signature** ```java public String getPinnedBy() ``` **Return Value** Type: String #### getPinnedTs() **Signature** ```java public Long getPinnedTs() ``` **Return Value** Type: Long #### setChannel(channel) **Signature** ```java public void setChannel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: void #### setPinnedBy(pinnedBy) **Signature** ```java public void setPinnedBy(String pinnedBy) ``` **Parameters** _pinnedBy_ Type: String **Return Value** Type: void #### setPinnedTs(pinnedTs) **Signature** ```java public void setPinnedTs(Long pinnedTs) ``` **Parameters** _pinnedTs_ Type: Long **Return Value** Type: void ## PinRemovedEvent Class Represents the [pin_removed event](https://api.slack.com/events/pin_removed). This event notifies your app when a pin is removed from a channel. ### PinRemovedEvent Methods The following are methods for `PinRemovedEvent`. #### getChannelId() **Signature** ```java public String getChannelId() ``` **Return Value** Type: String #### getEventTs() **Signature** ```java public String getEventTs() ``` **Return Value** Type: String #### getItem() **Signature** ```java public Slack.PinRemovedEvent.Item getItem() ``` **Return Value** Type: Slack.PinRemovedEvent.Item #### getItemUser() **Signature** ```java public String getItemUser() ``` **Return Value** Type: String #### getPinCount() **Signature** ```java public Integer getPinCount() ``` **Return Value** Type: Integer #### getPinnedInfo() **Signature** ```java public Slack.PinRemovedEvent.PinnedInfo getPinnedInfo() ``` **Return Value** Type: Slack.PinRemovedEvent.PinnedInfo #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### isHasPins() **Signature** ```java public Boolean isHasPins() ``` **Return Value** Type: Boolean #### setChannelId(channelId) **Signature** ```java public void setChannelId(String channelId) ``` **Parameters** _channelId_ Type: String **Return Value** Type: void #### setEventTs(eventTs) **Signature** ```java public void setEventTs(String eventTs) ``` **Parameters** _eventTs_ Type: String **Return Value** Type: void #### setHasPins(hasPins) **Signature** ```java public void setHasPins(Boolean hasPins) ``` **Parameters** _hasPins_ Type: Boolean **Return Value** Type: void #### setItem(item) **Signature** ```java public void setItem(Slack.PinRemovedEvent.Item item) ``` **Parameters** _item_ Type: Slack.PinRemovedEvent.Item **Return Value** Type: void #### setItemUser(itemUser) **Signature** ```java public void setItemUser(String itemUser) ``` **Parameters** _param_ Type: String **Return Value** Type: void #### setPinCount(pinCount) **Signature** ```java public void setPinCount(Integer pinCount) ``` **Parameters** _pinCount_ Type: Integer **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void ## PinRemovedEvent.Item Class ### PinRemovedEvent.Item Methods The following are methods for `PinRemovedEvent.Item`. #### getChannel() **Signature** ```java public String getChannel() ``` **Return Value** Type: String #### getComment() **Signature** ```java public Slack.FileComment getComment() ``` **Return Value** Type: Slack.FileComment #### getCreated() **Signature** ```java public Integer getCreated() ``` **Return Value** Type: Integer #### getCreatedBy() **Signature** ```java public String getCreatedBy() ``` **Return Value** Type: String #### getFile() **Signature** ```java public Slack.File getFile() ``` **Return Value** Type: Slack.File #### getMessage() **Signature** ```java public Slack.PinRemovedEvent.Message getMessage() ``` **Return Value** Type: Slack.PinRemovedEvent.Message #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### setChannel(channel) **Signature** ```java public void setChannel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: void #### setComment(comment) **Signature** ```java public void setComment(Slack.FileComment comment) ``` **Parameters** _comment_ Type: Slack.FileComment **Return Value** Type: void #### setCreated(created) **Signature** ```java public void setCreated(Integer created) ``` **Parameters** _created_ Type: Integer **Return Value** Type: void #### setCreatedBy(createdBy) **Signature** ```java public void setCreatedBy(String createdBy) ``` **Parameters** _createdBy_ Type: String **Return Value** Type: void #### setFile(file) **Signature** ```java public void setFile(Slack.File file) ``` **Parameters** _file_ Type: Slack.File **Return Value** Type: void #### setMessage(message) **Signature** ```java public void setMessage(Slack.PinRemovedEvent.Message message) ``` **Parameters** _message_ Type: Slack.PinRemovedEvent.Message **Return Value** Type: void #### setType(type) **Signature** ```java public void setType(String type) ``` **Parameters** _type_ Type: String **Return Value** Type: void ## PinRemovedEvent.Message Class ### PinRemovedEvent.Message Methods The following are methods for `PinRemovedEvent.Message`. #### getAppId() **Signature** ```java public String getAppId() ``` **Return Value** Type: String #### getBotId() **Signature** ```java public String getBotId() ``` **Return Value** Type: String #### getBotProfile() **Signature** ```java public Slack.BotProfile getBotProfile() ``` **Return Value** Type: Slack.BotProfile #### getClientMsgId() **Signature** ```java public String getClientMsgId() ``` **Return Value** Type: String #### getPermalink() **Signature** ```java public String getPermalink() ``` **Return Value** Type: String #### getPinnedTo() **Signature** ```java public List getPinnedTo() ``` **Return Value** Type: List #### getTeam() **Signature** ```java public String getTeam() ``` **Return Value** Type: String #### getText() **Signature** ```java public String getText() ``` **Return Value** Type: String #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### setAppId(appId) **Signature** ```java public void setAppId(String appId) ``` **Parameters** _appId_ Type: String **Return Value** Type: void #### setBotId(botId) **Signature** ```java public void setBotId(String botId) ``` **Parameters** _botId_ Type: String **Return Value** Type: void #### setBotProfile(botProfile) **Signature** ```java public void setBotProfile(Slack.BotProfile botProfile) ``` **Parameters** _botProfile_ Type: Slack.BotProfile **Return Value** Type: void #### setClientMsgId(clientMsgId) **Signature** ```java public void setClientMsgId(String clientMsgId) ``` **Parameters** _clientMsgId_ Type: String **Return Value** Type: void #### setPermalink(permalink) **Signature** ```java public void setPermalink(String permalink) ``` **Parameters** _permalink_ Type: String **Return Value** Type: void #### setPinnedTo(pinnedTo) **Signature** ```java public void setPinnedTo(List pinnedTo) ``` **Parameters** _pinnedTo_ Type: List **Return Value** Type: void #### setTeam(team) **Signature** ```java public void setTeam(String team) ``` **Parameters** _team_ Type: String **Return Value** Type: void #### setText(text) **Signature** ```java public void setText(String text) ``` **Parameters** _text_ Type: String **Return Value** Type: void #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void #### setType(type) **Signature** ```java public void setType(String type) ``` **Parameters** _type_ Type: String **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void ## PinRemovedEvent.PinnedInfo Class ### PinRemovedEvent.PinnedInfo Methods The following are methods for `PinRemovedEvent.PinnedInfo`. #### getChannel() **Signature** ```java public String getChannel() ``` **Return Value** Type: String #### getPinnedBy() **Signature** ```java public String getPinnedBy() ``` **Return Value** Type: String #### getPinnedTs() **Signature** ```java public Long getPinnedTs() ``` **Return Value** Type: Long #### setChannel(channel) **Signature** ```java public void setChannel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: void #### setPinnedBy(pinnedBy) **Signature** ```java public void setPinnedBy(String pinnedBy) ``` **Parameters** _pinnedBy_ Type: String **Return Value** Type: void #### setPinnedTs(pinnedTs) **Signature** ```java public void setPinnedTs(Long pinnedTs) ``` **Parameters** _pinnedTs_ Type: Long **Return Value** Type: void ## ReactionAddedEvent Class Represents the [reaction_added event](https://api.slack.com/events/reaction_added). This event notifies your app when a reaction is added to an item. ### ReactionAddedEvent Methods The following are methods for `ReactionAddedEvent`. #### getEventTs() **Signature** ```java public String getEventTs() ``` **Return Value** Type: String ### getItem() **Signature** ```java public Slack.ReactionAddedEvent.Item getItem() ``` **Return Value** Type: Slack.ReactionAddedEvent.Item ### getItemUser() **Signature** ```java public String getItemUser() ``` **Return Value** Type: String ### getReaction() **Signature** ```java public String getReaction() ``` **Return Value** Type: String #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### setEventTs(eventTs) **Signature** ```java public void setEventTs(String eventTs) ``` **Parameters** _eventTs_ Type: String **Return Value** Type: void #### setItem(item) **Signature** ```java public void setItem(Slack.ReactionAddedEvent.Item item) ``` **Parameters** _item_ Type: Slack.ReactionAddedEvent.Item **Return Value** Type: void #### setItemUser(itemUser) **Signature** ```java public void setItemUser(String itemUser) ``` **Parameters** _itemUser_ Type: String **Return Value** Type: void #### setReaction(reaction) **Signature** ```java public void setReaction(String reaction) ``` **Parameters** _reaction_ Type: String **Return Value** Type: void #### setUser(user) Sets the user who triggers the event. **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void ## ReactionAddedEvent.Item Class ### ReactionAddedEvent.Item Methods The following are methods for `ReactionAddedEvent.Item`. #### getChannel() **Signature** ```java public String getChannel() ``` **Return Value** Type: String #### getFile() **Signature** ```java public String getFile() ``` **Return Value** Type: String #### getFileComment() **Signature** ```java public String getFileComment() ``` **Return Value** Type: String #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### setChannel(channel) **Signature** ```java public void setChannel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: void #### setFile(file) **Signature** ```java public void setFile(String file) ``` **Parameters** _file_ Type: String **Return Value** Type: void #### setFileComment(fileComment) **Signature** ```java public void setFileComment(String fileComment) ``` **Parameters** _fileComment_ Type: String **Return Value** Type: void #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void #### setType(type) **Signature** ```java public void setType(String type) ``` **Parameters** _type_ Type: String **Return Value** Type: void ## ReactionRemovedEvent Class Represents the [reaction_removed event](https://api.slack.com/events/reaction_removed). This event notifies your app when a reaction is removed from an item. ### ReactionRemovedEvent Methods The following are methods for `ReactionRemovedEvent`. #### getEventTs() **Signature** ```java public String getEventTs() ``` **Return Value** Type: String #### getItem() **Signature** ```java public Slack.ReactionRemovedEvent.Item getItem() ``` **Return Value** Type: Slack.ReactionRemovedEvent.Item #### getItemUser() **Signature** ```java public String getItemUser() ``` **Return Value** Type: String #### getReaction() **Signature** ```java public String getReaction() ``` **Return Value** Type: String #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### setEventTs(eventTs) **Signature** ```java public void setEventTs(String eventTs) ``` **Parameters** _eventTs_ Type: String **Return Value** Type: void #### setItem(item) **Signature** ```java public void setItem(Slack.ReactionRemovedEvent.Item item) ``` **Parameters** _item_ Type: Slack.ReactionRemovedEvent.Item **Return Value** Type: void #### setItemUser(itemUser) **Signature** ```java public void setItemUser(String itemUser) ``` **Parameters** _itemUser_ Type: String **Return Value** Type: void #### setReaction(reaction) **Signature** ```java public void setReaction(String reaction) ``` **Parameters** _reaction_ Type: String **Return Value** Type: void #### setUser(user) Sets the user who triggers the event. **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void ## ReactionRemovedEvent.Item Class ### ReactionRemovedEvent.Item Methods The following are methods for `ReactionRemovedEvent.Item`. #### getChannel() **Signature** ```java public String getChannel() ``` **Return Value** Type: String #### getFile() **Signature** ```java public String getFile() ``` **Return Value** Type: String #### getFileComment() **Signature** ```java public String getFileComment() ``` **Return Value** Type: String #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### setChannel(channel) **Signature** ```java public void setChannel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: void #### setFile(file) **Signature** ```java public void setFile(String file) ``` **Parameters** _file_ Type: String **Return Value** Type: void #### setFileComment(fileComment) **Signature** ```java public void setFileComment(String fileComment) ``` **Parameters** _fileComment_ Type: String **Return Value** Type: void #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void #### setType(type) **Signature** ```java public void setType(String type) ``` **Parameters** _type_ Type: String **Return Value** Type: void ## StarAddedEvent Class Represents the [star_added event](https://api.slack.com/events/star_added). This event notifies your app when an item is starred. ### StarAddedEvent Methods The following are methods for `StarAddedEvent`. #### getEventTs() **Signature** ```java public String getEventTs() ``` **Return Value** Type: String #### getItem() **Signature** ```java public Slack.StarAddedEvent.Item getItem() ``` **Return Value** Type: Slack.StarAddedEvent.Item #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### setEventTs(eventTs) **Signature** ```java public void setEventTs(String eventTs) ``` **Parameters** _eventTs_ Type: String **Return Value** Type: void #### setItem(item) **Signature** ```java public void setItem(Slack.StarAddedEvent.Item item) ``` **Parameters** _item_ Type: Slack.StarAddedEvent.Item **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void ## StarAddedEvent.Edited Class ### StarAddedEvent.Edited Methods The following are methods for `StarAddedEvent.Edited`. #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void ## StarAddedEvent.Item Class ### StarAddedEvent.Item Methods The following are methods for `StarAddedEvent.Item`. #### getChannel() **Signature** ```java public String getChannel() ``` **Return Value** Type: String #### getComment() **Signature** ```java public Slack.FileComment getComment() ``` **Return Value** Type: Slack.FileComment #### getCreatedBy() **Signature** ```java public String getCreatedBy() ``` **Return Value** Type: String #### getDateCreate() **Signature** ```java public Long getDateCreate() ``` **Return Value** Type: Long #### getFile() **Signature** ```java public Slack.File getFile() ``` **Return Value** Type: Slack.File #### getMessage() **Signature** ```java public Slack.StarAddedEvent.Message getMessage() ``` **Return Value** Type: Slack.StarAddedEvent.Messagering #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### setChannel(channel) **Signature** ```java public void setChannel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: void #### setComment(comment) **Signature** ```java public void setComment(Slack.FileComment comment) ``` **Parameters** _comment_ Type: Slack.FileComment **Return Value** Type: void #### setCreatedBy(createdBy) **Signature** ```java public void setCreatedBy(String createdBy) ``` **Parameters** _createdBy_ Type: String **Return Value** Type: void #### setDateCreate(dateCreate) **Signature** ```java public void setDateCreate(Long dateCreate) ``` **Parameters** _dateCreate_ Type: Long **Return Value** Type: void #### setFile(file) **Signature** ```java public void setFile(Slack.File file) ``` **Parameters** _file_ Type: Slack.File **Return Value** Type: void #### setMessage(message) **Signature** ```java public void setMessage(Slack.StarAddedEvent.Message message) ``` **Parameters** _message_ Type: Slack.StarAddedEvent.Message **Return Value** Type: void #### setType(type) **Signature** ```java public void setType(String type) ``` **Parameters** _type_ Type: String **Return Value** Type: void ## StarAddedEvent.Message Class ### StarAddedEvent.Message Methods The following are methods for `StarAddedEvent.Message`. #### getAppId() **Signature** ```java public String getAppId() ``` **Return Value** Type: String #### getBotId() **Signature** ```java public String getBotId() ``` **Return Value** Type: String #### getBotProfile() **Signature** ```java public Slack.BotProfile getBotProfile() ``` **Return Value** Type: Slack.BotProfile #### getClientMsgId() **Signature** ```java public String getClientMsgId() ``` **Return Value** Type: String #### getEdited() **Signature** ```java public Slack.StarAddedEvent.Edited getEdited() ``` **Return Value** Type: Slack.StarAddedEvent.Edited #### getPermalink() **Signature** ```java public String getPermalink() ``` **Return Value** Type: String #### getPinnedTo() **Signature** ```java public List getPinnedTo() ``` **Return Value** Type: List #### getTeam() **Signature** ```java public String getTeam() ``` **Return Value** Type: String #### getText() **Signature** ```java public String getText() ``` **Return Value** Type: String #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### isStarred() **Signature** ```java public Boolean isStarred() ``` **Return Value** Type: String #### setAppId(appId) **Signature** ```java public void setAppId(String appId) ``` **Parameters** _appId_ Type: String **Return Value** Type: void #### setBotId(botId) **Signature** ```java public void setBotId(String botId) ``` **Parameters** _botId_ Type: String **Return Value** Type: void #### setBotProfile(botProfile) **Signature** ```java public void setBotProfile(Slack.BotProfile botProfile) ``` **Parameters** _botProfile_ Type: Slack.BotProfile **Return Value** Type: void #### setClientMsgId(clientMsgId) **Signature** ```java public void setClientMsgId(String clientMsgId) ``` **Parameters** _clientMsgId_ Type: String **Return Value** Type: void #### setEdited(edited) **Signature** ```java public void setEdited(Slack.StarAddedEvent.Edited edited) ``` **Parameters** _edited_ Type: Slack.StarAddedEvent.Edited **Return Value** Type: void #### setPermalink(permalink) **Signature** ```java public void setPermalink(String permalink) ``` **Parameters** _permalink_ Type: String **Return Value** Type: void #### setPinnedTo(pinnedTo) **Signature** ```java public void setPinnedTo(List pinnedTo) ``` **Parameters** _pinnedTo_ Type: List **Return Value** Type: void #### setStarred(isStarred) **Signature** ```java public void setStarred(Boolean isStarred) ``` **Parameters** _isStarred_ Type: Boolean **Return Value** Type: void #### setTeam(team) **Signature** ```java public void setTeam(String team) ``` **Parameters** _team_ Type: String **Return Value** Type: void #### setText(text) **Signature** ```java public void setText(String text) ``` **Parameters** _text_ Type: String **Return Value** Type: void #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void #### setType(type) **Signature** ```java public void setType(String type) ``` **Parameters** _type_ Type: String **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void ## StarRemovedEvent Class Represents the [star_removed event](https://api.slack.com/events/star_removed). This event notifies your app when a star is removed from an item. ### StarRemovedEvent Methods The following are methods for `StarRemovedEvent`. #### getEventTs() **Signature** ```java public String getEventTs() ``` **Return Value** Type: String #### getItem() **Signature** ```java public Slack.StarRemovedEvent.Item getItem() ``` **Return Value** Type: Slack.StarRemovedEvent.Item #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### setEventTs(eventTs) **Signature** ```java public void setEventTs(String eventTs) ``` **Parameters** _eventTs_ Type: String **Return Value** Type: void #### setItem(item) **Signature** ```java public void setItem(Slack.StarRemovedEvent.Item item) ``` **Parameters** _item_ Type: Slack.StarRemovedEvent.Item **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void ## StarRemovedEvent.Edited Class ### StarRemovedEvent.Edited Methods The following are methods for `StarRemovedEvent.Edited`. #### getEventTs() **Signature** ```java public String getEventTs() ``` **Return Value** Type: String #### getItem() **Signature** ```java public Slack.StarRemovedEvent.Item getItem() ``` **Return Value** Type: Slack.StarRemovedEvent.Item #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### setEventTs(eventTs) **Signature** ```java public void setEventTs(String eventTs) ``` **Parameters** _eventTs_ Type: String **Return Value** Type: void #### setItem(item) **Signature** ```java public void setItem(Slack.StarRemovedEvent.Item item) ``` **Parameters** _item_ Type: Slack.StarRemovedEvent.Item **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void ## StarRemovedEvent.Item Class ### StarRemovedEvent.Item Methods The following are methods for `StarRemovedEvent.Item`. #### getChannel() **Signature** ```java public String getChannel() ``` **Return Value** Type: String #### getComment() **Signature** ```java public Slack.FileComment getComment() ``` **Return Value** Type: Slack.FileComment #### getCreatedBy() **Signature** ```java public String getCreatedBy() ``` **Return Value** Type: String #### getDateCreate() **Signature** ```java public Long getDateCreate() ``` **Return Value** Type: Long #### getFile() **Signature** ```java public Slack.File getFile() ``` **Return Value** Type: Slack.File #### getMessage() **Signature** ```java public Slack.StarRemovedEvent.Message getMessage() ``` **Return Value** Type: Slack.StarRemovedEvent.Message #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### setChannel(channel) **Signature** ```java public void setChannel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: void #### setComment(comment) **Signature** ```java public void setComment(Slack.FileComment comment) ``` **Parameters** _comment_ Type: Slack.FileComment **Return Value** Type: void #### setCreatedBy(createdBy) **Signature** ```java public void setCreatedBy(String createdBy) ``` **Parameters** _createdBy_ Type: String **Return Value** Type: void #### setDateCreate(dateCreate) **Signature** ```java public void setDateCreate(Long dateCreate) ``` **Parameters** _dateCreate_ Type: Long **Return Value** Type: void #### setFile(file) **Signature** ```java public void setFile(Slack.File file) ``` **Parameters** _file_ Type: Slack.File **Return Value** Type: void #### setMessage(message) **Signature** ```java public void setMessage(Slack.StarRemovedEvent.Message message) ``` **Parameters** _message_ Type: Slack.StarRemovedEvent.Message **Return Value** Type: void #### setType(type) **Signature** ```java public void setType(String type) ``` **Parameters** _type_ Type: String **Return Value** Type: void ## StarRemovedEvent.Message Class ### StarRemovedEvent.Message Methods The following are methods for `StarRemovedEvent.Message`. #### getAppId() **Signature** ```java public String getAppId() ``` **Return Value** Type: String #### getBotId() **Signature** ```java public String getBotId() ``` **Return Value** Type: String #### getBotProfile() **Signature** ```java public Slack.BotProfile getBotProfile() ``` **Return Value** Type: Slack.BotProfile #### getClientMsgId() **Signature** ```java public String getClientMsgId() ``` **Return Value** Type: String #### getEdited() **Signature** ```java public Slack.StarRemovedEvent.Edited getEdited() ``` **Return Value** Type: Slack.StarRemovedEvent.Edited #### getPermalink() **Signature** ```java public String getPermalink() ``` **Return Value** Type: String #### getPinnedTo() **Signature** ```java public List getPinnedTo() ``` **Return Value** Type: List #### getTeam() **Signature** ```java public String getTeam() ``` **Return Value** Type: String #### getText() **Signature** ```java public String getText() ``` **Return Value** Type: String #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### setAppId(appId) **Signature** ```java public void setAppId(String appId) ``` **Parameters** _appId_ Type: String **Return Value** Type: void #### setBotId(botId) **Signature** ```java public void setBotId(String botId) ``` **Parameters** _botId_ Type: String **Return Value** Type: void #### setBotProfile(botProfile) **Signature** ```java public void setBotProfile(Slack.BotProfile botProfile) ``` **Parameters** _botProfile_ Type: Slack.BotProfile **Return Value** Type: void #### setClientMsgId(clientMsgId) **Signature** ```java public void setClientMsgId(String clientMsgId) ``` **Parameters** _clientMsgId_ Type: String **Return Value** Type: void #### setEdited(edited) **Signature** ```java public void setEdited(Slack.StarRemovedEvent.Edited edited) ``` **Parameters** _edited_ Type: Slack.StarRemovedEvent.Edited **Return Value** Type: void #### setPermalink(permalink) **Signature** ```java public void setPermalink(String permalink) ``` **Parameters** _permalink_ Type: String **Return Value** Type: void #### setPinnedTo(pinnedTo) **Signature** ```java public void setPinnedTo(List pinnedTo) ``` **Parameters** _pinnedTo_ Type: List **Return Value** Type: void #### setTeam(team) **Signature** ```java public void setTeam(String team) ``` **Parameters** _team_ Type: String **Return Value** Type: void #### setText(text) **Signature** ```java public void setText(String text) ``` **Parameters** _text_ Type: String **Return Value** Type: void #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void #### setType(type) **Signature** ```java public void setType(String type) ``` **Parameters** _type_ Type: String **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void ## SubteamCreatedEvent Class Represents the [subteam_created event](https://api.slack.com/events/subteam_created). This event notifies your app when a user group has been added to the workspace. ### SubteamCreatedEvent Methods The following are methods for `SubteamCreatedEvent`. #### getEventTs() **Signature** ```java public String getEventTs() ``` **Return Value** Type: String #### getSubteam() **Signature** ```java public Slack.SubteamCreatedEvent.Subteam getSubteam() ``` **Return Value** Type: Slack.SubteamCreatedEvent.Subteam #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### setEventTs(eventTs) **Signature** ```java public void setEventTs(String eventTs) ``` **Parameters** _eventTs_ Type: String **Return Value** Type: void #### setSubteam(subteam) **Signature** ```java public void setSubteam(Slack.SubteamCreatedEvent.Subteam subteam) ``` **Parameters** _subteam_ Type: Slack.SubteamCreatedEvent.Subteam **Return Value** Type: void ## SubteamCreatedEvent.Prefs Class ### SubteamCreatedEvent.Prefs Methods The following are methods for `SubteamCreatedEvent.Prefs`. #### getChannels() **Signature** ```java public List getChannels() ``` **Return Value** Type: List #### getGroups() **Signature** ```java ppublic List getGroups() ``` **Return Value** Type: List #### setChannels(channels) **Signature** ```java public void setChannels(List channels) ``` **Parameters** _channels_ Type: List **Return Value** Type: void #### setGroups(groups) **Signature** ```java public void setGroups(List groups) ``` **Parameters** _groups_ Type: List **Return Value** Type: void ## SubteamCreatedEvent.Subteam Class ### SubteamCreatedEvent.Subteam Methods The following are methods for `SubteamCreatedEvent.Subteam`. #### getAutoType() **Signature** ```java public String getAutoType() ``` **Return Value** Type: String #### getChannelCount() **Signature** ```java public Integer getChannelCount() ``` **Return Value** Type: Integer #### getCreatedBy() **Signature** ```java public String getCreatedBy() ``` **Return Value** Type: String #### getDateCreate() **Signature** ```java public Integer getDateCreate() ``` **Return Value** Type: Integer #### getDateDelete() **Signature** ```java public Integer getDateDelete() ``` **Return Value** Type: Integer #### getDateUpdate() **Signature** ```java public Integer getDateUpdate() ``` **Return Value** Type: Integer #### getDeletedBy() **Signature** ```java public String getDeletedBy() ``` **Return Value** Type: String #### getDescription() **Signature** ```java public String getDescription() ``` **Return Value** Type: String #### getEnterpriseSubteamId() **Signature** ```java public String getEnterpriseSubteamId() ``` **Return Value** Type: String #### getHandle() **Signature** ```java public String getHandle() ``` **Return Value** Type: String #### getId() **Signature** ```java public String getId() ``` **Return Value** Type: String #### getName() **Signature** ```java public String getName() ``` **Return Value** Type: String #### getPrefs() **Signature** ```java public Slack.SubteamCreatedEvent.Prefs getPrefs() ``` **Return Value** Type: Slack.SubteamCreatedEvent.Prefs #### getTeamId() **Signature** ```java public String getTeamId() ``` **Return Value** Type: String #### getUpdatedBy() **Signature** ```java public String getUpdatedBy() ``` **Return Value** Type: String #### getUserCount() **Signature** ```java public Integer getUserCount() ``` **Return Value** Type: Integer #### getUsers() **Signature** ```java public List getUsers() ``` **Return Value** Type: List #### isAutoProvision() **Signature** ```java public Boolean isAutoProvision() ``` **Return Value** Type: Boolean #### isExternal() **Signature** ```java public Boolean isExternal() ``` **Return Value** Type: Boolean #### isSubteam() **Signature** ```java public Boolean isSubteam() ``` **Return Value** Type: Boolean #### isUsergroup() **Signature** ```java public Boolean isUsergroup() ``` **Return Value** Type: Boolean #### setAutoProvision(autoProvision) **Signature** ```java public void setAutoProvision(Boolean autoProvision) ``` **Parameters** _autoProvision_ Type: Boolean **Return Value** Type: void #### setAutoType(autoType) **Signature** ```java public void setAutoType(String autoType) ``` **Parameters** _autoType_ Type: String **Return Value** Type: void #### setChannelCount(channelCount) **Signature** ```java public void setChannelCount(Integer channelCount) ``` **Parameters** _channelCount_ Type: Integer **Return Value** Type: void #### setCreatedBy(createdBy) **Signature** ```java public void setCreatedBy(String createdBy) ``` **Parameters** _createdBy_ Type: String **Return Value** Type: void #### setDateCreate(dateCreate) **Signature** ```java public void setDateCreate(Integer dateCreate) ``` **Parameters** _dateCreate_ Type: Integer **Return Value** Type: void #### setDateDelete(dateDelete) **Signature** ```java public void setDateDelete(Integer dateDelete) ``` **Parameters** _dateDelete_ Type: Integer **Return Value** Type: void #### setDateUpdate(dateUpdate) **Signature** ```java public void setDateUpdate(Integer dateUpdate) ``` **Parameters** _dateUpdate_ Type: Integer **Return Value** Type: void #### setDeletedBy(deletedBy) **Signature** ```java public void setDeletedBy(String deletedBy) ``` **Parameters** _deletedBy_ Type: String **Return Value** Type: void #### setDescription(description) **Signature** ```java public void setDescription(String description) ``` **Parameters** _description_ Type: String **Return Value** Type: void #### setEnterpriseSubteamId(enterpriseSubteamId) **Signature** ```java public void setEnterpriseSubteamId(String enterpriseSubteamId) ``` **Parameters** _enterpriseSubteamId_ Type: String **Return Value** Type: void #### setExternal(external) **Signature** ```java public void setExternal(Boolean external) ``` **Parameters** _external_ Type: Boolean **Return Value** Type: void #### setHandle(handle) **Signature** ```java public void setHandle(String handle) ``` **Parameters** _handle_ Type: String **Return Value** Type: void #### setId(id) **Signature** ```java public void setId(String id) ``` **Parameters** _id_ Type: String **Return Value** Type: void #### setName(name) **Signature** ```java public void setName(String name) ``` **Parameters** _name_ Type: String **Return Value** Type: void #### setPrefs(prefs) **Signature** ```java public void setPrefs(Slack.SubteamCreatedEvent.Prefs prefs) ``` **Parameters** _prefs_ Type: Slack.SubteamCreatedEvent.Prefs **Return Value** Type: void #### setSubteam(isSubteam) **Signature** ```java public void setSubteam(Boolean isSubteam) ``` **Parameters** _isSubteam_ Type: Boolean **Return Value** Type: void #### setTeamId(teamId) **Signature** ```java public void setTeamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: void #### setUpdatedBy(updatedBy) **Signature** ```java public void setUpdatedBy(String updatedBy) ``` **Parameters** _updatedBy_ Type: String **Return Value** Type: void #### setUserCount(userCount) **Signature** ```java public void setUserCount(Integer userCount) ``` **Parameters** _userCount_ Type: Integer **Return Value** Type: void #### setUsergroup(isUsergroup) **Signature** ```java public void setUsergroup(Boolean isUsergroup) ``` **Parameters** _isUsergroup_ Type: Boolean **Return Value** Type: void #### setUsers(users) **Signature** ```java public void setUsers(List users) ``` **Parameters** _users_ Type: List **Return Value** Type: void ## SubteamMembersChangedEvent Class Represents the [subteam_members_changed event](https://api.slack.com/events/subteam_members_changed). This event notifies your app when the membership of an existing user group has changed. ### SubteamMembersChangedEvent Methods The following are methods for `SubteamMembersChangedEvent`. #### getAddedUsers() **Signature** ```java public List getAddedUsers() ``` **Return Value** Type: List\ #### getAddedUsersCount() **Signature** ```java public Integer getAddedUsersCount() ``` **Return Value** Type: Integer #### getDatePreviousUpdate() **Signature** ```java public Integer getDatePreviousUpdate() ``` **Return Value** Type: Integer #### getDateUpdate() **Signature** ```java public Integer getDateUpdate() ``` **Return Value** Type: Integer #### getEventTs() **Signature** ```java public String getEventTs() ``` **Return Value** Type: String #### getRemovedUsers() **Signature** ```java public List getRemovedUsers() ``` **Return Value** Type: List\ #### getRemovedUsersCount() **Signature** ```java public Integer getRemovedUsersCount() ``` **Return Value** Type: Integer #### getSubteamId() **Signature** ```java public String getSubteamId() ``` **Return Value** Type: String #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getTeamId() **Signature** ```java public String getTeamId() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### setAddedUsers(addedUsers) **Signature** ```java public void setAddedUsers(List addedUsers) ``` **Parameters** _addedUsers_ Type: List\ **Return Value** Type: void #### setAddedUsersCount(addedUsersCount) **Signature** ```java public void setAddedUsersCount(Integer addedUsersCount) ``` **Parameters** _addedUsersCount_ Type: Integer **Return Value** Type: void #### setDatePreviousUpdate(datePreviousUpdate) **Signature** ```java public void setDatePreviousUpdate(Integer datePreviousUpdate) ``` **Parameters** _datePreviousUpdate_ Type: Integer **Return Value** Type: void #### setDateUpdate(dateUpdate) **Signature** ```java public void setDateUpdate(Integer dateUpdate) ``` **Parameters** _dateUpdate_ Type: Integer **Return Value** Type: void #### setEventTs(eventTs) **Signature** ```java public void setEventTs(String eventTs) ``` **Parameters** _eventTs_ Type: String **Return Value** Type: void #### setRemovedUsers(removedUsers) **Signature** ```java public void setRemovedUsers(List removedUsers) ``` **Parameters** _removedUsers_ Type: List\ **Return Value** Type: void #### setRemovedUsersCount(removedUsersCount) **Signature** ```java public void setRemovedUsersCount(Integer removedUsersCount) ``` **Parameters** _param_ Type: String **Return Value** Type: void #### setSubteamId(subteamId) **Signature** ```java public void setSubteamId(String subteamId) ``` **Parameters** _subteamId_ Type: String **Return Value** Type: void #### setTeamId(teamId) **Signature** ```java public void setTeamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: void ## SubteamSelfAddedEvent Class Represents the [subteam_self_added event](https://api.slack.com/events/subteam_self_added). This event notifies your app when you have been added to a user group. ### SubteamSelfAddedEvent Methods The following are methods for `SubteamSelfAddedEvent`. #### getEventTs() **Signature** ```java public String getEventTs() ``` **Return Value** Type: String #### getSubteamId() **Signature** ```java public String getSubteamId() ``` **Return Value** Type: String #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### setEventTs(eventTs) **Signature** ```java public void setEventTs(String eventTs) ``` **Parameters** _eventTs_ Type: String **Return Value** Type: void #### setSubteamId(subteamId) **Signature** ```java public void setSubteamId(String subteamId) ``` **Parameters** _subteamId_ Type: String **Return Value** Type: void ## SubteamSelfRemovedEvent Methods Represents the [subteam_self_removed event](https://api.slack.com/events/subteam_self_removed). This event notifies your app when you have been removed from a user group. ### SubteamSelfRemovedEvent Methods The following are methods for `SubteamSelfRemovedEvent`. #### getEventTs() **Signature** ```java public String getEventTs() ``` **Return Value** Type: String #### getSubteamId() **Signature** ```java public String getSubteamId() ``` **Return Value** Type: String #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### setEventTs(eventTs) **Signature** ```java public void setEventTs(String eventTs) ``` **Parameters** _eventTs_ Type: String **Return Value** Type: void #### setSubteamId(subteamId) **Signature** ```java public void setSubteamId(String subteamId) ``` **Parameters** _param_ Type: String **Return Value** Type: void ## SubteamUpdatedEvent Class Represents the [subteam_updated event](https://api.slack.com/events/subteam_updated). This event notifies you when an existing user group has been updated or its members changed. ### SubteamUpdatedEvent Methods The following are methods for `SubteamUpdatedEvent`. #### getEventTs() **Signature** ```java public String getEventTs() ``` **Return Value** Type: String #### getSubteam() **Signature** ```java public Slack.SubteamUpdatedEvent.Subteam getSubteam() ``` **Return Value** Type: Slack.SubteamUpdatedEvent.Subteam #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### setEventTs(eventTs) **Signature** ```java public void setEventTs(String eventTs) ``` **Parameters** _eventTs_ Type: String **Return Value** Type: void #### setSubteam(subteam) **Signature** ```java public void setSubteam(Slack.SubteamUpdatedEvent.Subteam subteam) ``` **Parameters** _subteam_ Type: Slack.SubteamUpdatedEvent.Subteam **Return Value** Type: void ## SubteamUpdatedEvent.Prefs Class ### SubteamUpdatedEvent Methods The following are methods for `SubteamUpdatedEvent.Prefs`. #### getChannels() **Signature** ```java public List getChannels() ``` **Return Value** Type: List #### getGroups() **Signature** ```java public List getGroups() ``` **Return Value** Type: List #### setChannels(channels) **Signature** ```java public void setChannels(List channels) ``` **Parameters** _channels_ Type: List **Return Value** Type: void #### setGroups(groups) **Signature** ```java public void setGroups(List groups) ``` **Parameters** _groups_ Type: List **Return Value** Type: void ## SubteamUpdatedEvent.Subteam Class ### SubteamUpdatedEvent.Subteam Methods The following are methods for `SubteamUpdatedEvent.Subteam`. #### getAutoType() **Signature** ```java public String getAutoType() ``` **Return Value** Type: String #### getChannelCount() **Signature** ```java public Integer getChannelCount() ``` **Return Value** Type: Integer #### getCreatedBy() **Signature** ```java public String getCreatedBy() ``` **Return Value** Type: String #### getDateCreate() **Signature** ```java public Integer getDateCreate() ``` **Return Value** Type: Integer #### getDateDelete() **Signature** ```java public Integer getDateDelete() ``` **Return Value** Type: Integer #### getDateUpdate() **Signature** ```java public Integer getDateUpdate() ``` **Return Value** Type: Integer #### getDeletedBy() **Signature** ```java public String getDeletedBy() ``` **Return Value** Type: String #### getDescription() **Signature** ```java public String getDescription() ``` **Return Value** Type: String #### getEnterpriseSubteamId() **Signature** ```java public String getEnterpriseSubteamId() ``` **Return Value** Type: String #### getHandle() **Signature** ```java public String getHandle() ``` **Return Value** Type: String #### getId() **Signature** ```java public String getId() ``` **Return Value** Type: String #### getName() **Signature** ```java public String getName() ``` **Return Value** Type: String #### getPrefs() **Signature** ```java public Slack.SubteamUpdatedEvent.Prefs getPrefs() ``` **Return Value** Type: Slack.SubteamUpdatedEvent.Prefs #### getTeamId() **Signature** ```java public String getTeamId() ``` **Return Value** Type: String #### getUpdatedBy() **Signature** ```java public String getUpdatedBy() ``` **Return Value** Type: String #### getUserCount() **Signature** ```java public Integer getUserCount() ``` **Return Value** Type: Integer #### getUsers() **Signature** ```java public List getUsers() ``` **Return Value** Type: List #### isAutoProvision() **Signature** ```java public Boolean isAutoProvision() ``` **Return Value** Type: Boolean #### isExternal() **Signature** ```java public Boolean isExternal() ``` **Return Value** Type: Boolean #### isSubteam() **Signature** ```java public Boolean isSubteam() ``` **Return Value** Type: Boolean #### isUsergroup() **Signature** ```java public Boolean isUsergroup() ``` **Return Value** Type: Boolean #### setAutoProvision(autoProvision) **Signature** ```java public void setAutoProvision(Boolean autoProvision) ``` **Parameters** _autoProvision_ Type: Boolean **Return Value** Type: void #### setAutoType(autoType) **Signature** ```java public void setAutoType(String autoType) ``` **Parameters** _autoType_ Type: String **Return Value** Type: void #### setChannelCount(channelCount) **Signature** ```java public void setChannelCount(Integer channelCount) ``` **Parameters** _channelCount_ Type: Integer **Return Value** Type: void #### setCreatedBy(createdBy) **Signature** ```java public void setCreatedBy(String createdBy) ``` **Parameters** _createdBy_ Type: String **Return Value** Type: void #### setDateCreate(dateCreate) **Signature** ```java public void setDateCreate(Integer dateCreate) ``` **Parameters** _dateCreate_ Type: Integer **Return Value** Type: void #### setDateDelete(dateDelete) **Signature** ```java public void setDateDelete(Integer dateDelete) ``` **Parameters** _dateDelete_ Type: Integer **Return Value** Type: void #### setDateUpdate(dateUpdate) **Signature** ```java public void setDateUpdate(Integer dateUpdate) ``` **Parameters** _dateUpdate_ Type: Integer **Return Value** Type: void #### setDeletedBy(deletedBy) **Signature** ```java public void setDeletedBy(String deletedBy) ``` **Parameters** _deletedBy_ Type: String **Return Value** Type: void #### setDescription(description) **Signature** ```java public void setDescription(String description) ``` **Parameters** _description_ Type: String **Return Value** Type: void #### setEnterpriseSubteamId(enterpriseSubteamId) **Signature** ```java public void setEnterpriseSubteamId(String enterpriseSubteamId) ``` **Parameters** _enterpriseSubteamId_ Type: String **Return Value** Type: void #### setExternal(isExternal) **Signature** ```java public void setExternal(Boolean isExternal) ``` **Parameters** _isExternal_ Type: Boolean **Return Value** Type: void #### setHandle(handle) **Signature** ```java public void setHandle(String handle) ``` **Parameters** _handle_ Type: String **Return Value** Type: void #### setId(id) **Signature** ```java public void setId(String id) ``` **Parameters** _id_ Type: String **Return Value** Type: void #### setName(name) **Signature** ```java public void setName(String name) ``` **Parameters** _name_ Type: String **Return Value** Type: void #### setPrefs(prefs) **Signature** ```java public void setPrefs(Slack.SubteamUpdatedEvent.Prefs prefs) ``` **Parameters** _prefs_ Type: Slack.SubteamUpdatedEvent.Prefs **Return Value** Type: void #### setSubteam(isSubteam) **Signature** ```java public void setSubteam(Boolean isSubteam) ``` **Parameters** _isSubteam_ Type: Boolean **Return Value** Type: void #### setTeamId(teamId) **Signature** ```java public void setTeamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: void #### setUpdatedBy(updatedBy) **Signature** ```java public void setUpdatedBy(String updatedBy) ``` **Parameters** _updatedBy_ Type: String **Return Value** Type: void #### setUserCount(userCount) **Signature** ```java public void setUserCount(Integer userCount) ``` **Parameters** _userCount_ Type: Integer **Return Value** Type: void #### setUsergroup(isUsergroup) **Signature** ```java public void setUsergroup(Boolean isUsergroup) ``` **Parameters** _isUsergroup_ Type: Boolean **Return Value** Type: void #### setUsers(users) **Signature** ```java public void setUsers(List users) ``` **Parameters** _users_ Type: List **Return Value** Type: void ## TeamAccessGrantedEvent Class Represents the [team_access_granted event](https://api.slack.com/events/team_access_granted). This event notifies your app when access to a set of teams was granted to your org app. ### TeamAccessGrantedEvent Methods The following are methods for `TeamAccessGrantedEvent`. #### getEventTs() **Signature** ```java public String getEventTs() ``` **Return Value** Type: String #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getTeamIds() **Signature** ```java public List getTeamIds() ``` **Return Value** Type: List\ #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### setEventTs(eventTs) **Signature** ```java public void setEventTs(String eventTs) ``` **Parameters** _eventTs_ Type: String **Return Value** Type: void #### setTeamIds(teamIds) **Signature** ```java public void setTeamIds(List teamIds) ``` **Parameters** _teamIds_ Type: List\ **Return Value** Type: void ## TeamAccessRevokedEvent Class Represents the [team_access_revoked event](https://api.slack.com/events/team_access_revoked). This event notifies your app when access to a set of teams was revoked from your org app. ### TeamAccessRevokedEvent Methods The following are methods for `TeamAccessRevokedEvent`. #### getEventTs() **Signature** ```java public String getEventTs() ``` **Return Value** Type: String #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getTeamIds() **Signature** ```java public List getTeamIds() ``` **Return Value** Type: List\ #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### setEventTs(eventTs) **Signature** ```java public void setEventTs(String eventTs) ``` **Parameters** _eventTs_ Type: String **Return Value** Type: void #### setTeamIds(teamIds) **Signature** ```java public void setTeamIds(List teamIds) ``` **Parameters** _teamIds_ Type: List\ **Return Value** Type: void ## TeamDomainChangeEvent Class Represents the [team_domain_change event](https://api.slack.com/events/team_domain_change). This event notifies the app when the workspace domain has changed. ### TeamDomainChangeEvent Methods The following are methods for `TeamDomainChangeEvent`. #### getDomain() **Signature** ```java public String getDomain() ``` **Return Value** Type: String #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUrl() **Signature** ```java public String getUrl() ``` **Return Value** Type: String ### setDomain(domain) **Signature** ```java public void setDomain(String domain) ``` **Parameters** _domain_ Type: String **Return Value** Type: void ### setUrl(url) **Signature** ```java public void setUrl(String url) ``` **Parameters** _url_ Type: String **Return Value** Type: void ## TeamJoinEvent Class Represents the [team_join event](https://api.slack.com/events/team_join). This event notifies your app when a new member has joined. ### TeamJoinEvent Methods The following are methods for `TeamJoinEvent`. #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUser() **Signature** ```java public Slack.User getUser() ``` **Return Value** Type: Slack.User #### setUser(user) **Signature** ```java public void setUser(Slack.User user) ``` **Parameters** _user_ Type: Slack.User **Return Value** Type: void ## TeamRenameEvent Class Represents the [team_rename event](https://api.slack.com/events/team_rename). This event notifies your app when the workspace name has changed. ### TeamRenameEvent Methods The following are methods for `TeamRenameEvent`. #### getName() **Signature** ```java public String getName() ``` **Return Value** Type: String #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### setName(name) **Signature** ```java public void setName(String name) ``` **Parameters** _name_ Type: String **Return Value** Type: void ## TokensRevokedEvent Class Represents the [tokens_revoked event](https://api.slack.com/events/tokens_revoked). This event notifies your app when the API tokens for your app were revoked. ### TokensRevokedEvent Methods The following are methods for `TokensRevokedEvent`. #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getTokens() **Signature** ```java public Slack.TokensRevokedEvent.Tokens getTokens() ``` **Return Value** Type: Slack.TokensRevokedEvent.Tokens #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### setTokens(tokens) **Signature** ```java public void setTokens(Slack.TokensRevokedEvent.Tokens tokens) ``` **Parameters** _tokens_ Type: Slack.TokensRevokedEvent.Tokens **Return Value** Type: void ## TokensRevokedEvent.Tokens Class ### TokensRevokedEvent.Tokens Methods The following are methods for `TokensRevokedEvent.Tokens`. #### getBot() **Signature** ```java public List getBot() ``` **Return Value** Type: List #### getOauth() **Signature** ```java public List getOauth() ``` **Return Value** Type: List #### setBot(bot) **Signature** ```java public void setBot(List bot) ``` **Parameters** _bot_ Type: List **Return Value** Type: void #### setOauth(oauth) **Signature** ```java public void setOauth(List oauth) ``` **Parameters** _oauth_ Type: List **Return Value** Type: void ## UserChangeEvent Class Represents the [user_change event](https://api.slack.com/events/user_change). This event notifies your app when a member's data has changed. ### UserChangeEvent Methods The following are methods for `UserChangeEvent`. #### getCacheTs() **Signature** ```java public Integer getCacheTs() ``` **Return Value** Type: Integer #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUser() **Signature** ```java public Slack.User getUser() ``` **Return Value** Type: Slack.User #### setCacheTs(cacheTs) **Signature** ```java public void setCacheTs(Integer cacheTs) ``` **Parameters** _cacheTs_ Type: Integer **Return Value** Type: void ## UserResourceDeniedEvent Class Represents the [user_resource_denied event](https://api.slack.com/events/user_resource_denied). This event notifies your app when a user resource was denied to your app. ### UserResourceDeniedEvent Methods The following are methods for `UserResourceDeniedEvent`. #### getScopes() **Signature** ```java public List getScopes() ``` **Return Value** Type: List\ #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getTriggerId() **Signature** ```java public String getTriggerId() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### setScopes(scopes) **Signature** ```java public void setScopes(List scopes) ``` **Parameters** _scopes_ Type: List\ **Return Value** Type: void #### setTriggerId(triggerId) **Signature** ```java public void setTriggerId(String triggerId) ``` **Parameters** _triggerId_ Type: String **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void ## UserResourceGrantedEvent Class Deprecated. See [Deprecated Events](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/events_mapping.md#deprecated-events). Represents the [user_resource_granted event](https://api.slack.com/events/user_resource_granted). This event notifies your app when a user resource was granted to your app. ### UserResourceGrantedEvent Methods The following are methods for `UserResourceGrantedEvent`. #### getScopes() **Signature** ```java public List getScopes() ``` **Return Value** Type: List\ #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getTriggerId() **Signature** ```java public String getTriggerId() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### setScopes(scopes) **Signature** ```java public void setScopes(List scopes) ``` **Parameters** _scopes_ Type: List\ **Return Value** Type: void #### setTriggerId(triggerId) **Signature** ```java public void setTriggerId(String triggerId) ``` **Parameters** _triggerId_ Type: String **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void ## UserResourceRemovedEvent Class Deprecated. See [Deprecated Events](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/events_mapping.md#deprecated-events). Represents the [user_resource_removed event](https://api.slack.com/events/user_resource_removed). This event notifies your app when a user resource was removed from your app. ### UserResourceRemovedEvent Methods The following are methods for `UserResourceRemovedEvent`. #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getTriggerId() **Signature** ```java public String getTriggerId() ``` **Return Value** Type: String #### getType() **Signature** ```java ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### setTriggerId(triggerId) **Signature** ```java public void setTriggerId(String triggerId) ``` **Parameters** _triggerId_ Type: String **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void # Work with Fields Use the `Field` class to work with fields in Slack. ## Field Class Represents a field. ### Field Methods The following are methods for `Field`. #### getTitle() **Signature** ```java public String getTitle() ``` **Return Value** Type: String #### getValue() **Signature** ```java public String getValue() ``` **Return Value** Type: String #### isValueShortEnough() **Signature** ```java public Boolean isValueShortEnough() ``` **Return Value** Type: Boolean #### setTitle(title) **Signature** ```java public void setTitle(String title) ``` **Parameters** _title_ Type: String **Return Value** Type: void #### setValue(value) **Signature** ```java public void setValue(String value) ``` **Parameters** _value_ Type: String **Return Value** Type: void #### setValueShortEnough(valueShortEnough) **Signature** ```java public void setValueShortEnough(Boolean valueShortEnough) ``` **Parameters** _valueShortEnough_ Type: Boolean **Return Value** Type: void # Work with Files The following are Apex classes for the Slack `files` [API methods](https://api.slack.com/methods?filter=files). ## File Class Represents information about a file shared with a workspace. **Usage** See [Slack's `file` object type](https://api.slack.com/types/file). ### File Methods The following are methods for `File`. #### getAppId() **Signature** ```java public String getAppId() ``` **Return Value** Type: String #### getAppName() **Signature** ```java public String getAppName() ``` **Return Value** Type: String #### getCc() **Signature** ```java public List getCc() ``` **Return Value** Type: List #### getChannelActionsCount() **Signature** ```java public Integer getChannelActionsCount() ``` **Return Value** Type: Integer #### getChannelActionsTs() **Signature** ```java public String getChannelActionsTs() ``` **Return Value** Type: String #### getChannels() **Signature** ```java public List getChannels() ``` **Return Value** Type: List\ #### getConvertedPdf() **Signature** ```java public String getConvertedPdf() ``` **Return Value** Type: String #### getCreated() **Signature** ```java public Integer getCreated() ``` **Return Value** Type: Integer #### getDeanimate() **Signature** ```java public String getDeanimate() ``` **Return Value** Type: String #### getDeanimateGif() **Signature** ```java public String getDeanimateGif() ``` **Return Value** Type: String #### getEditLink() **Signature** ```java public String getEditLink() ``` **Return Value** Type: String #### getEditor() **Signature** ```java public String getEditor() ``` **Return Value** Type: String #### getExternalId() **Signature** ```java public String getExternalId() ``` **Return Value** Type: String #### getExternalType() **Signature** ```java public String getExternalType() ``` **Return Value** Type: String #### getExternalUrl() **Signature** ```java public String getExternalUrl() ``` **Return Value** Type: String #### getFiletype() **Signature** ```java public String getFiletype() ``` **Return Value** Type: String #### getFrom() **Signature** ```java public List getFrom() ``` **Return Value** Type: List #### getGroups() **Signature** ```java public List getGroups() ``` **Return Value** Type: List\ #### getHeaders() **Signature** ```java public Slack.File.Headers getHeaders() ``` **Return Value** Type: Slack.File.Headers #### getId() **Signature** ```java public String getId() ``` **Return Value** Type: String #### getImageExifRotation() **Signature** ```java public Integer getImageExifRotation() ``` **Return Value** Type: Integer #### getIms() **Signature** ```java public List getIms() ``` **Return Value** Type: List\ #### getLastEditor() **Signature** ```java public String getLastEditor() ``` **Return Value** Type: String #### getLines() **Signature** ```java public Integer getLines() ``` **Return Value** Type: Integer #### getLinesMore() **Signature** ```java public Integer getLinesMore() ``` **Return Value** Type: Integer #### getMediaDisplayType() **Signature** ```java public String getMediaDisplayType() ``` **Return Value** Type: String #### getMimetype() **Signature** ```java public String getMimetype() ``` **Return Value** Type: String #### getMode() **Signature** ```java public String getMode() ``` **Return Value** Type: String #### getName() **Signature** ```java public String getName() ``` **Return Value** Type: String #### getOriginalAttachmentCount() **Signature** ```java public Integer getOriginalAttachmentCount() ``` **Return Value** Type: Integer #### getOriginalHeight() **Signature** ```java public String getOriginalHeight() ``` **Return Value** Type: String #### getOriginalWidth() **Signature** ```java public String getOriginalWidth() ``` **Return Value** Type: String #### getPermalink() **Signature** ```java public String getPermalink() ``` **Return Value** Type: String #### getPermalinkPublic() **Signature** ```java public String getPermalinkPublic() ``` **Return Value** Type: String #### getPinnedInfo() **Signature** ```java public Map getPinnedInfo() ``` **Return Value** Type: Map #### getPjpeg() **Signature** ```java public String getPjpeg() ``` **Return Value** Type: String #### getPlainText() **Signature** ```java public String getPlainText() ``` **Return Value** Type: String #### getPrettyType() **Signature** ```java public String getPrettyType() ``` **Return Value** Type: String #### getPreview() **Signature** ```java public String getPreview() ``` **Return Value** Type: String #### getPreviewHighlight() **Signature** ```java public String getPreviewHighlight() ``` **Return Value** Type: String #### getPreviewPlainText() **Signature** ```java public String getPreviewPlainText() ``` **Return Value** Type: String #### getShares() **Signature** ```java public Slack.File.Shares getShares() ``` **Return Value** Type: Slack.File.Shares #### getSimplifiedHtml() **Signature** ```java public String getSimplifiedHtml() ``` **Return Value** Type: String #### getSize() **Signature** ```java public Integer getSize() ``` **Return Value** Type: Integer #### getSubject() **Signature** ```java public String getSubject() ``` **Return Value** Type: String #### getThumb64() **Signature** ```java public String getThumb64() ``` **Return Value** Type: String #### getThumb64Gif() **Signature** ```java public String getThumb64Gif() ``` **Return Value** Type: String #### getThumb64Height() **Signature** ```java public String getThumb64Height() ``` **Return Value** Type: String #### getThumb64Width() **Signature** ```java public String getThumb64Width() ``` **Return Value** Type: String #### getThumb80() **Signature** ```java public String getThumb80() ``` **Return Value** Type: String #### getThumb80Gif() **Signature** ```java public String getThumb80Gif() ``` **Return Value** Type: String #### getThumb80Height() **Signature** ```java public String getThumb80Height() ``` **Return Value** Type: String #### getThumb80Width() **Signature** ```java public String getThumb80Width() ``` **Return Value** Type: String #### getThumb160() **Signature** ```java public String getThumb160() ``` **Return Value** Type: String #### getThumb160Gif() **Signature** ```java public String getThumb160Gif() ``` **Return Value** Type: String #### getThumb160Height() **Signature** ```java public String getThumb160Height() ``` **Return Value** Type: String #### getThumb160Width() **Signature** ```java public String getThumb160Width() ``` **Return Value** Type: String #### getThumb360() **Signature** ```java public String getThumb360() ``` **Return Value** Type: String #### getThumb360Gif() **Signature** ```java public String getThumb360Gif() ``` **Return Value** Type: String #### getThumb360Height() **Signature** ```java public String getThumb360Height() ``` **Return Value** Type: String #### getThumb360Width() **Signature** ```java public String getThumb360Width() ``` **Return Value** Type: String #### getThumb480() **Signature** ```java public String getThumb480() ``` **Return Value** Type: String #### getThumb480Gif() **Signature** ```java public String getThumb480Gif() ``` **Return Value** Type: String #### getThumb480Height() **Signature** ```java public String getThumb480Height() ``` **Return Value** Type: String #### getThumb480Width() **Signature** ```java public String getThumb480Width() ``` **Return Value** Type: String #### getThumb720() **Signature** ```java public String getThumb720() ``` **Return Value** Type: String #### getThumb720Gif() **Signature** ```java public String getThumb720Gif() ``` **Return Value** Type: String #### getThumb720Height() **Signature** ```java public String getThumb720Height() ``` **Return Value** Type: String #### getThumb720Width() **Signature** ```java public String getThumb720Width() ``` **Return Value** Type: String #### getThumb800() **Signature** ```java public String getThumb800() ``` **Return Value** Type: String #### getThumb800Gif() **Signature** ```java public String getThumb800Gif() ``` **Return Value** Type: String #### getThumb800Height() **Signature** ```java public String getThumb800Height() ``` **Return Value** Type: String #### getThumb800Width() **Signature** ```java public String getThumb800Width() ``` **Return Value** Type: String #### getThumb960() **Signature** ```java public String getThumb960() ``` **Return Value** Type: String #### getThumb960Gif() **Signature** ```java public String getThumb960Gif() ``` **Return Value** Type: String #### getThumb960Height() **Signature** ```java public String getThumb960Height() ``` **Return Value** Type: String #### getThumb960Width() **Signature** ```java public String getThumb960Width() ``` **Return Value** Type: String #### getThumb1024() **Signature** ```java public String getThumb1024() ``` **Return Value** Type: String #### getThumb1024Gif() **Signature** ```java public String getThumb1024Gif() ``` **Return Value** Type: String #### getThumb1024Height() **Signature** ```java public String getThumb1024Height() ``` **Return Value** Type: String #### getThumb1024Width() **Signature** ```java public String getThumb1024Width() ``` **Return Value** Type: String #### getThumbGif() **Signature** ```java public String getThumbGif() ``` **Return Value** Type: String #### getThumbPdf() **Signature** ```java public String getThumbPdf() ``` **Return Value** Type: String #### getThumbPdfHeight() **Signature** ```java public String getThumbPdfHeight() ``` **Return Value** Type: String #### getThumbPdfWidth() **Signature** ```java public String getThumbPdfWidth() ``` **Return Value** Type: String #### getThumbTiny() **Signature** ```java public String getThumbTiny() ``` **Return Value** Type: String #### getThumbVideo() **Signature** ```java public String getThumbVideo() ``` **Return Value** Type: String #### getTimestamp() **Signature** ```java public Integer getTimestamp() ``` **Return Value** Type: Integer #### getTitle() **Signature** ```java public String getTitle() ``` **Return Value** Type: String #### getTo() **Signature** ```java public List getTo() ``` **Return Value** Type: List #### getUpdated() **Signature** ```java public Integer getUpdated() ``` **Return Value** Type: Integer #### getUrlPrivate() **Signature** ```java public String getUrlPrivate() ``` **Return Value** Type: String #### getUrlPrivateDownload() **Signature** ```java public String getUrlPrivateDownload() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### getUsername() **Signature** ```java public String getUsername() ``` **Return Value** Type: String #### isDisplayAsBot() **Signature** ```java public Boolean isDisplayAsBot() ``` **Return Value** Type: Boolean #### isEditable() **Signature** ```java public Boolean isEditable() ``` **Return Value** Type: Boolean #### isExternal() **Signature** ```java public Boolean isExternal() ``` **Return Value** Type: Boolean #### isHasMore() **Signature** ```java public Boolean isHasMore() ``` **Return Value** Type: Boolean #### isHasRichPreview() **Signature** ```java public Boolean isHasRichPreview() ``` **Return Value** Type: Boolean #### isNonOwnerEditable() **Signature** ```java public Boolean isNonOwnerEditable() ``` **Return Value** Type: Boolean #### isPreviewTruncated() **Signature** ```java public Boolean isPreviewTruncated() ``` **Return Value** Type: Boolean #### ispublic() **Signature** ```java public Boolean ispublic() ``` **Return Value** Type: Boolean #### isPublicUrlShared() **Signature** ```java public Boolean isPublicUrlShared() ``` **Return Value** Type: Boolean #### isSentToSelf() **Signature** ```java public Boolean isSentToSelf() ``` **Return Value** Type: Boolean #### isStarred() **Signature** ```java public Boolean isStarred() ``` **Return Value** Type: Boolean #### setAppId(appId) **Signature** ```java public void setAppId(String appId) ``` **Parameters** _appId_ Type: String **Return Value** Type: void #### setAppName(appName) **Signature** ```java public void setAppName(String appName) ``` **Parameters** _appName_ Type: String **Return Value** Type: void #### setCc(cc) **Signature** ```java public void setCc(List cc) ``` **Parameters** _cc_ Type: List **Return Value** Type: void #### setChannelActionsCount(channelActionsCount) **Signature** ```java public void setChannelActionsCount(Integer channelActionsCount) ``` **Parameters** _channelActionsCount_ Type: Integer **Return Value** Type: void #### setChannelActionsTs(channelActionsTs) **Signature** ```java public void setChannelActionsTs(String channelActionsTs) ``` **Parameters** _channelActionsTs_ Type: String **Return Value** Type: void #### setChannels(channels) **Signature** ```java public void setChannels(List channels) ``` **Parameters** _channels_ Type: List\ **Return Value** Type: void #### setConvertedPdf(convertedPdf) **Signature** ```java public void setConvertedPdf(String convertedPdf) ``` **Parameters** _convertedPdf_ Type: String **Return Value** Type: void #### setCreated(created) **Signature** ```java public void setCreated(Integer created) ``` **Parameters** _created_ Type: Integer **Return Value** Type: void #### setDeanimateGif(deanimateGif) **Signature** ```java public void setDeanimateGif(String deanimateGif) ``` **Parameters** _deanimatedGif_ Type: String **Return Value** Type: void #### setDisplayAsBot(displayAsBot) **Signature** ```java public void setDisplayAsBot(Boolean displayAsBot) ``` **Parameters** _displayAsBot_ Type: Boolean **Return Value** Type: void #### setEditable(editable) **Signature** ```java public void setEditable(Boolean editable) ``` **Parameters** _editable_ Type: Boolean **Return Value** Type: void #### setEditLink(editLink) **Signature** ```java public void setEditLink(String editLink) ``` **Parameters** _editLink_ Type: String **Return Value** Type: void #### setEditor(editor) **Signature** ```java public void setEditor(String editor) ``` **Parameters** _editor_ Type: String **Return Value** Type: void #### setExternal(external) **Signature** ```java public void setExternal(Boolean external) ``` **Parameters** _external_ Type: Boolean **Return Value** Type: void #### setExternalId(externalId) **Signature** ```java public void setExternalId(String externalId) ``` **Parameters** _externalId_ Type: String **Return Value** Type: void #### setExternalType(externalType) **Signature** ```java public void setExternalType(String externalType) ``` **Parameters** _externalType_ Type: String **Return Value** Type: void #### setExternalUrl(externalUrl) **Signature** ```java public void setExternalUrl(String externalUrl) ``` **Parameters** _externalUrl_ Type: String **Return Value** Type: void #### setFiletype(filetype) **Signature** ```java public void setFiletype(String filetype) ``` **Parameters** _filetype_ Type: String **Return Value** Type: void #### setFrom(fromValue) **Signature** ```java public void setFrom(List fromValue) ``` **Parameters** _fromValue_ Type: List **Return Value** Type: void #### setGroups(groups) **Signature** ```java public void setGroups(List groups) ``` **Parameters** _groups_ Type: List\ **Return Value** Type: void #### setHasMore(hasMore) **Signature** ```java public void setHasMore(Boolean hasMore) ``` **Parameters** _hasMore_ Type: Boolean **Return Value** Type: void #### setHasRichPreview(hasRichPreview) **Signature** ```java public void setHasRichPreview(Boolean hasRichPreview) ``` **Parameters** _hasRichPreview_ Type: Boolean **Return Value** Type: void #### setId(id) **Signature** ```java public void setId(String id) ``` **Parameters** _id_ Type: String **Return Value** Type: void #### setImageExifRotation(imageExifRotation) **Signature** ```java public void setImageExifRotation(Integer imageExifRotation) ``` **Parameters** _imageExifRotation_ Type: Integer **Return Value** Type: void #### setIms(ims) **Signature** ```java public void setIms(List ims) ``` **Parameters** _ims_ Type: List\ **Return Value** Type: void #### setLastEditor(lastEditor) **Signature** ```java public void setLastEditor(String lastEditor) ``` **Parameters** _lastEditor_ Type: String **Return Value** Type: void #### setLines(lines) **Signature** ```java public void setLines(Integer lines) ``` **Parameters** _lines_ Type: Integer **Return Value** Type: void #### setLinesMore(linesMore) **Signature** ```java public void setLinesMore(Integer linesMore) ``` **Parameters** _linesMore_ Type: Integer **Return Value** Type: void #### setMediaDisplayType(mediaDisplayType) **Signature** ```java public void setMediaDisplayType(String mediaDisplayType) ``` **Parameters** _mediaDisplayType_ Type: String **Return Value** Type: void #### setMimetype(mimetype) **Signature** ```java public void setMimetype(String mimetype) ``` **Parameters** _mimetype_ Type: String **Return Value** Type: void #### setMode(mode) **Signature** ```java public void setMode(String mode) ``` **Parameters** _mode_ Type: String **Return Value** Type: void #### setName(name) **Signature** ```java public void setName(String name) ``` **Parameters** _name_ Type: String **Return Value** Type: void #### setNonOwnerEditable(nonOwnerEditable) **Signature** ```java public void setNonOwnerEditable(Boolean nonOwnerEditable) ``` **Parameters** _nonOwnerEditable_ Type: Boolean **Return Value** Type: void #### setOriginalAttachmentCount(originalAttachmentCount) **Signature** ```java public void setOriginalAttachmentCount(Integer originalAttachmentCount) ``` **Parameters** _originalAttachmentCount_ Type: Integer **Return Value** Type: void #### setOriginalHeight(originalHeight) **Signature** ```java public void setOriginalHeight(String originalHeight) ``` **Parameters** _originalHeight_ Type: String **Return Value** Type: void #### setOriginalWidth(originalWidth) **Signature** ```java public void setOriginalWidth(String originalWidth) ``` **Parameters** _originalWidth_ Type: String **Return Value** Type: void #### setPermalink(permalink) **Signature** ```java public void setPermalink(String permalink) ``` **Parameters** _permalink_ Type: String **Return Value** Type: void #### setPermalinkPublic(permalinkPublic) **Signature** ```java public void setPermalinkPublic(String permalinkPublic) ``` **Parameters** _permalinkPublic_ Type: String **Return Value** Type: void #### setPinnedInfo(pinnedInfo) **Signature** ```java public void setPinnedInfo(Map pinnedInfo) ``` **Parameters** _pinnedInfo_ Type: Map **Return Value** Type: void #### setPjpeg(pjpeg) **Signature** ```java public void setPjpeg(String pjpeg) ``` **Parameters** _pjpeg_ Type: String **Return Value** Type: void #### setPlainText(plainText) **Signature** ```java public void setPlainText(String plainText) ``` **Parameters** _plainText_ Type: String **Return Value** Type: void #### setPrettyType(prettyType) **Signature** ```java public void setPrettyType(String prettyType) ``` **Parameters** _prettyType_ Type: String **Return Value** Type: void #### setPreview(preview) **Signature** ```java public void setPreview(String preview) ``` **Parameters** _preview_ Type: String **Return Value** Type: void #### setPreviewHighlight(previewHighlight) **Signature** ```java public void setPreviewHighlight(String previewHighlight) ``` **Parameters** _previewHighlight_ Type: String **Return Value** Type: void #### setPreviewPlainText(previewPlainText) **Signature** ```java public void setPreviewPlainText(String previewPlainText) ``` **Parameters** _previewPlainText_ Type: String **Return Value** Type: void #### setPreviewTruncated(previewTruncated) **Signature** ```java public void setPreviewTruncated(Boolean previewTruncated) ``` **Parameters** _previewTruncated_ Type: Boolean **Return Value** Type: void #### setpublic(\_public) **Signature** ```java public void setpublic(Boolean _public) ``` **Parameters** _\_public_ Type: Boolean **Return Value** Type: void #### setPublicUrlShared(publicUrlShared) **Signature** ```java public void setPublicUrlShared(Boolean publicUrlShared) ``` **Parameters** _publicUrlShared_ Type: Boolean **Return Value** Type: void #### setSentToSelf(sentToSelf) **Signature** ```java public void setSentToSelf(Boolean sentToSelf) ``` **Parameters** _sentToSelf_ Type: Boolean **Return Value** Type: void #### setShares(shares) **Signature** ```java public void setShares(Slack.File.Shares shares) ``` **Parameters** _shares_ Type: Slack.File.Shares **Return Value** Type: void #### setSize(size) **Signature** ```java public void setSize(Integer size) ``` **Parameters** _size_ Type: Integer **Return Value** Type: void #### setStarred(starred) **Signature** ```java public void setStarred(Boolean starred) ``` **Parameters** _starred_ Type: Boolean **Return Value** Type: void #### setSubject(subject) **Signature** ```java public void setSubject(String subject) ``` **Parameters** _subject_ Type: String **Return Value** Type: void #### setThumb64(thumb64) **Signature** ```java public void setThumb64(String thumb64) ``` **Parameters** _thumb64_ Type: String **Return Value** Type: void #### setThumb64Gif(thumb64Gif) **Signature** ```java public void setThumb64Gif(String thumb64Gif) ``` **Parameters** _thumb64Gif_ Type: String **Return Value** Type: void #### setThumb64Height(thumb64Height) **Signature** ```java public void setThumb64Height(String thumb64Height) ``` **Parameters** _thumb64Height_ Type: String **Return Value** Type: void #### setThumb64Width(thumb64Width) **Signature** ```java public void setThumb64Width(String thumb64Width) ``` **Parameters** _thumb64Width_ Type: String **Return Value** Type: void #### setThumb80(thumb80) **Signature** ```java public void setThumb80(String thumb80) ``` **Parameters** _thumb80_ Type: String **Return Value** Type: void #### setThumb80Gif(thumb80Gif) **Signature** ```java public void setThumb80Gif(String thumb80Gif) ``` **Parameters** _thumb80Gif_ Type: String **Return Value** Type: void #### setThumb80Height(thumb80Height) **Signature** ```java public void setThumb80Height(String thumb80Height) ``` **Parameters** _thumb80Height_ Type: String **Return Value** Type: void #### setThumb80Width(thumb80Width) **Signature** ```java public void setThumb80Width(String thumb80Width) ``` **Parameters** _thumb80Width_ Type: String **Return Value** Type: void #### setThumb160(thumb160) **Signature** ```java public void setThumb160(String thumb160) ``` **Parameters** _thumb160_ Type: String **Return Value** Type: void #### setThumb160Gif(thumb160Gif) **Signature** ```java public void setThumb160Gif(String thumb160Gif) ``` **Parameters** _thumb160Gif_ Type: String **Return Value** Type: void #### setThumb160Height(thumb160Height) **Signature** ```java public void setThumb160Height(String thumb160Height) ``` **Parameters** _thumb160Height_ Type: String **Return Value** Type: void #### setThumb160Width(thumb160Width) **Signature** ```java public void setThumb160Width(String thumb160Width) ``` **Parameters** _thumb160Width_ Type: String **Return Value** Type: void #### setThumb360(thumb360) **Signature** ```java public void setThumb360(String thumb360) ``` **Parameters** _thumb360_ Type: String **Return Value** Type: void #### setThumb360Gif(thumb360Gif) **Signature** ```java public void setThumb360Gif(String thumb360Gif) ``` **Parameters** _thumb360Gif_ Type: String **Return Value** Type: void #### setThumb360Height(thumb360Height) **Signature** ```java public void setThumb360Height(String thumb360Height) ``` **Parameters** _thumb360Height_ Type: String **Return Value** Type: void #### setThumb360Width(thumb360Width) **Signature** ```java public void setThumb360Width(String thumb360Width) ``` **Parameters** _thumb360Width_ Type: String **Return Value** Type: void #### setThumb480(thumb480) **Signature** ```java public void setThumb480(String thumb480) ``` **Parameters** _thumb480_ Type: String **Return Value** Type: void #### setThumb480Gif(thumb480Gif) **Signature** ```java public void setThumb480Gif(String thumb480Gif) ``` **Parameters** _thumb480Gif_ Type: String **Return Value** Type: void #### setThumb480Height(thumb480Height) **Signature** ```java public void setThumb480Height(String thumb480Height) ``` **Parameters** _thumb480Height_ Type: String **Return Value** Type: void #### setThumb480Width(thumb480Width) **Signature** ```java public void setThumb480Width(String thumb480Width) ``` **Parameters** _thumb480Width_ Type: String **Return Value** Type: void #### setThumb720(thumb720) **Signature** ```java public void setThumb720(String thumb720) ``` **Parameters** _thumb720_ Type: String **Return Value** Type: void #### setThumb720Gif(thumb720Gif) **Signature** ```java public void setThumb720Gif(String thumb720Gif) ``` **Parameters** _thumb720Gif_ Type: String **Return Value** Type: void #### setThumb720Height(thumb720Height) **Signature** ```java public void setThumb720Height(String thumb720Height) ``` **Parameters** _thumb720Height_ Type: String **Return Value** Type: void #### setThumb720Width(thumb720Width) **Signature** ```java public void setThumb720Width(String thumb720Width) ``` **Parameters** _thumb720Width_ Type: String **Return Value** Type: void #### setThumb800(thumb800) **Signature** ```java public void setThumb800(String thumb800) ``` **Parameters** _thumb800_ Type: String **Return Value** Type: void #### setThumb800Gif(thumb800Gif) **Signature** ```java public void setThumb800Gif(String thumb800Gif) ``` **Parameters** _thumb800Gif_ Type: String **Return Value** Type: void #### setThumb800Height(thumb800Height) **Signature** ```java public void setThumb800Height(String thumb800Height) ``` **Parameters** _thumb800Height_ Type: String **Return Value** Type: void #### setThumb800Width(thumb800Width) **Signature** ```java public void setThumb800Width(String thumb800Width) ``` **Parameters** _thumb800Width_ Type: String **Return Value** Type: void #### setThumb960(thumb960) **Signature** ```java public void setThumb960(String thumb960) ``` **Parameters** _thumb960_ Type: String **Return Value** Type: void #### setThumb960Gif(thumb960Gif) **Signature** ```java public void setThumb960Gif(String thumb960Gif) ``` **Parameters** _thumb960Gif_ Type: String **Return Value** Type: void #### setThumb960Height(thumb960Height) **Signature** ```java public void setThumb960Height(String thumb960Height) ``` **Parameters** _thumb960Height_ Type: String **Return Value** Type: void #### setThumb960Width(thumb960Width) **Signature** ```java public void setThumb960Width(String thumb960Width) ``` **Parameters** _thumb960Width_ Type: String **Return Value** Type: void #### setThumb1024(thumb1024) **Signature** ```java public void setThumb1024(String thumb1024) ``` **Parameters** _thumb1024_ Type: String **Return Value** Type: void #### setThumb1024Gif(thumb1024Gif) **Signature** ```java public void setThumb1024Gif(String thumb1024Gif) ``` **Parameters** _thumb1024Gif_ Type: String **Return Value** Type: void #### setThumb1024Height(thumb1024Height) **Signature** ```java public void setThumb1024Height(String thumb1024Height) ``` **Parameters** _thumb1024Height_ Type: String **Return Value** Type: void #### setThumb1024Width(thumb1024Width) **Signature** ```java public void setThumb1024Width(String thumb1024Width) ``` **Parameters** _thumb1024Width_ Type: String **Return Value** Type: void #### setThumbGif(thumbGif) **Signature** ```java public void setThumbGif(String thumbGif) ``` **Parameters** _thumbGif_ Type: String **Return Value** Type: void #### setThumbPdf(thumbPdf) **Signature** ```java public void setThumbPdf(String thumbPdf) ``` **Parameters** _thumbPdf_ Type: String **Return Value** Type: void #### setThumbPdfHeight(thumbPdfHeight) **Signature** ```java public void setThumbPdfHeight(String thumbPdfHeight) ``` **Parameters** _thumbPdfHeight_ Type: String **Return Value** Type: void #### setThumbPdfWidth(thumbPdfWidth) **Signature** ```java public void setThumbPdfWidth(String thumbPdfWidth) ``` **Parameters** _thumbPdfWidth_ Type: String **Return Value** Type: void #### setThumbTiny(thumbTiny) **Signature** ```java public void setThumbTiny(String thumbTiny) ``` **Parameters** _thumbTiny_ Type: String **Return Value** Type: void #### setThumbVideo(thumbVideo) **Signature** ```java public void setThumbVideo(String thumbVideo) ``` **Parameters** _thumbVideo_ Type: String **Return Value** Type: void #### setTimestamp(timestamp) **Signature** ```java public void setTimestamp(Integer timestamp) ``` **Parameters** _timestamp_ Type: Integer **Return Value** Type: void #### setTitle(title) **Signature** ```java public void setTitle(String title) ``` **Parameters** _title_ Type: String **Return Value** Type: void #### setTo(to) **Signature** ```java public void setTo(List to) ``` **Parameters** _to_ Type: List **Return Value** Type: void #### setUpdated(updated) **Signature** ```java public void setUpdated(Integer updated) ``` **Parameters** _updated_ Type: Integer **Return Value** Type: void #### setUrlPrivate(urlPrivate) **Signature** ```java public void setUrlPrivate(String urlPrivate) ``` **Parameters** _urlPrivate_ Type: String **Return Value** Type: void #### setUrlPrivateDownload(urlPrivateDownload) **Signature** ```java public void setUrlPrivateDownload(String urlPrivateDownload) ``` **Parameters** _urlPrivateDownload_ Type: String **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void #### setUsername(username) **Signature** ```java public void setUsername(String username) ``` **Parameters** _username_ Type: String **Return Value** Type: void --- ## File.Address Class ### File.Address Methods The following are methods for `File.Address`. #### getAddress() **Signature** ```java public String getAddress() ``` **Return Value** Type: String #### getName() **Signature** ```java public String getName() ``` **Return Value** Type: String #### getOriginal() **Signature** ```java public String getOriginal() ``` **Return Value** Type: String #### setAddress(address) **Signature** ```java public void setAddress(String address) ``` **Parameters** _address_ Type: String **Return Value** Type: void #### setName(name) **Signature** ```java public void setName(String name) ``` **Parameters** _name_ Type: String **Return Value** Type: void #### SetOriginal(original) **Signature** ```java public void setOriginal(String original) ``` **Parameters** _original_ Type: String **Return Value** Type: void --- ## File.Headers Class ### File.Headers Methods The following are methods for `File.Headers`. #### getDate() **Signature** ```java public String getDate() ``` **Return Value** Type: String #### getInReplyTo() **Signature** ```java public String getInReplyTo() ``` **Return Value** Type: String #### getReplyTo() **Signature** ```java public String getReplyTo() ``` **Return Value** Type: String #### getMessageId() **Signature** ```java public String getMessageId() ``` **Return Value** Type: String #### setDate(dateValue) **Signature** ```java public void setDate(String dateValue) ``` **Parameters** _dateValue_ Type: String **Return Value** Type: void #### setInReplyTo(inReplyTo) **Signature** ```java public void setInReplyTo(String inReplyTo) ``` **Parameters** _inReplyTo_ Type: String **Return Value** Type: void #### setReplyTo(replyTo) **Signature** ```java public void setReplyTo(String replyTo) ``` **Parameters** _replyTo_ Type: String **Return Value** Type: void #### setMessageId(messageId) **Signature** ```java public void setMessageId(String messageId) ``` **Parameters** _messageId_ Type: String **Return Value** Type: void --- ## File.PinnedInfo Class ### File.PinnedInfo Methods The following are methods for `File.PinnedInfo`. #### getPinnedBy() **Signature** ```java public String getPinnedBy() ``` **Return Value** Type: String #### getPinnedTs() **Signature** ```java public Integer getPinnedTs() ``` **Return Value** Type: Integer #### setPinnedBy(pinnedBy) **Signature** ```java public void setPinnedBy(String pinnedBy) ``` **Parameters** _pinnedBy_ Type: String **Return Value** Type: void #### setPinnedTs(pinnedTs) **Signature** ```java public void setPinnedTs(Integer pinnedTs) ``` **Parameters** _pinnedTs_ Type: Integer **Return Value** Type: void --- ## File.ShareDetail Class ### File.ShareDetail Methods The following are methods for `File.ShareDetail`. #### getChannelName() **Signature** ```java public String getChannelName() ``` **Return Value** Type: String #### getLatestReply() **Signature** ```java public String getLatestReply() ``` **Return Value** Type: String #### getReplyCount() **Signature** ```java public Integer getReplyCount() ``` **Return Value** Type: Integer #### getReplyUsers() **Signature** ```java public List getReplyUsers() ``` **Return Value** Type: List\ #### getReplyUsersCount() **Signature** ```java public Integer getReplyUsersCount() ``` **Return Value** Type: Integer #### getShareUserId() **Signature** ```java public String getShareUserId() ``` **Return Value** Type: String #### getTeamId() **Signature** ```java public String getTeamId() ``` **Return Value** Type: String #### getThreadTs() **Signature** ```java public String getThreadTs() ``` **Return Value** Type: String #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### setChannelName(channelName) **Signature** ```java public void setChannelName(String channelName) ``` **Parameters** _channelName_ Type: String **Return Value** Type: void #### setLatestReply(latestReply) **Signature** ```java public void setLatestReply(String latestReply) ``` **Parameters** _latestReply_ Type: String **Return Value** Type: void #### setReplyCount(replyCount) **Signature** ```java public void setReplyCount(Integer replyCount) ``` **Parameters** _replyCount_ Type: Integer **Return Value** Type: void #### setReplyUsers(replyUsers) **Signature** ```java public void setReplyUsers(List replyUsers) ``` **Parameters** _replyUsers_ Type: List\ **Return Value** Type: void #### setReplyUsersCount(replyUsersCount) **Signature** ```java public void setReplyUsersCount(Integer replyUsersCount) ``` **Parameters** _replyUsersCount_ Type: Integer **Return Value** Type: void #### setShareUserId(shareUserId) **Signature** ```java public void setShareUserId(String shareUserId) ``` **Parameters** _shareUserId_ Type: String **Return Value** Type: void #### setTeamId(teamId) **Signature** ```java public void setTeamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: void #### setThreadTs(threadTs) **Signature** ```java public void setThreadTs(String threadTs) ``` **Parameters** _threadTs_ Type: String **Return Value** Type: void #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void --- ## File.Shares Class Represents information about a file share, such as to a private or public channel. ### File.Shares Methods The following are methods for `File.Shares`. #### getPrivateChannels() **Signature** ```java public Map> getPrivateChannels() ``` **Return Value** Type: Map> #### getPublicChannels() **Signature** ```java public Map> getPublicChannels() ``` **Return Value** Type: Map> #### setPrivateChannels(privateChannels) **Signature** ```java public void setPrivateChannels(Map> privateChannels) ``` **Parameters** _privateChannels_ Type: Map> **Return Value** Type: void #### setPublicChannels(publicChannels) **Signature** ```java public void setPublicChannels(Map> publicChannels) ``` **Parameters** _publicChannels_ Type: Map> **Return Value** Type: void --- ## FileComment Class ### FileComment Methods The following are methods for `FileComment`. #### getChannel() **Signature** ```java public String getChannel() ``` **Return Value** Type: String #### getComment() **Signature** ```java public String getComment() ``` **Return Value** Type: String #### getCreated() **Signature** ```java public Integer getCreated() ``` **Return Value** Type: Integer #### getId() **Signature** ```java public String getId() ``` **Return Value** Type: String #### getTimestamp() **Signature** ```java public Integer getTimestamp() ``` **Return Value** Type: Integer #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### isIntro() **Signature** ```java public Boolean isIntro() ``` **Return Value** Type: Boolean #### setChannel(channel) **Signature** ```java public void setChannel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: void #### setComment(comment) **Signature** ```java public void setComment(String comment) ``` **Parameters** _comment_ Type: String **Return Value** Type: void #### setCreated(created) **Signature** ```java public void setCreated(Integer created) ``` **Parameters** _created_ Type: Integer **Return Value** Type: void #### setDeanimate(deanimate) **Signature** ```java public void setDeanimate(String deanimate) ``` **Parameters** _deanimate_ Type: String **Return Value** Type: void #### setId(id) **Signature** ```java public void setId(String id) ``` **Parameters** _id_ Type: String **Return Value** Type: void #### setIntro(intro) **Signature** ```java public void setIntro(Boolean intro) ``` **Parameters** _intro_ Type: Boolean **Return Value** Type: void #### setTimestamp(timestamp) **Signature** ```java public void setTimestamp(Integer timestamp) ``` **Parameters** _timestamp_ Type: Integer **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void --- ## FilesDeleteRequest Class Sends a request to delete a file. **Usage** See Slack’s [files.delete method](https://api.slack.com/methods/files.delete). ### FilesDeleteRequest Methods The following are methods for `FilesDeleteRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.FilesDeleteRequest.Builder builder() ``` **Return Value** Type: Slack.FilesDeleteRequest.Builder --- ## FilesDeleteRequest.Builder Class Contains methods to build an instance of the `Slack.FilesDeleteRequest` class. A Builder object is obtained by invoking one of the `FilesDeleteRequest.builder` methods defined by the `FilesDeleteRequest` class. ### FilesDeleteRequest.Builder Methods The following are methods for `FilesDeleteRequest.Builder`. #### build() Required. Returns an instance of `Slack.FilesDeleteRequest`. **Signature** ```java public Slack.FilesDeleteRequest build() ``` **Return Value** Type: Slack.FilesDeleteRequest #### file(file) Required. The ID of file to delete. **Signature** ```java public Slack.FilesDeleteRequest.Builder file(String file) ``` **Parameters** _file_ Type: String The ID of the file to delete **Return Value** Type: Slack.FilesDeleteRequest.Builder --- ## FilesDeleteResponse Class Deletes a file. **Usage** See Slack’s [files.delete method](https://api.slack.com/methods/files.delete). ### FilesDeleteResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). --- ## FilesInfoRequest Class Sends a request to get information about a file. **Usage** See Slack’s [files.info method](https://api.slack.com/methods/files.info). ### FilesInfoRequest Methods The following are methods for `FilesInfoRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.FilesInfoRequest.Builder builder() ``` **Return Value** Type: Slack.FilesInfoRequest.Builder --- ## FilesInfoRequest.Builder Class Contains methods to build an instance of the `Slack.FilesInfoRequest` class. A Builder object is obtained by invoking one of the `FilesInfoRequest.builder` methods defined by the `FilesInfoRequest` class. ### FilesInfoRequest.Builder Methods The following are methods for `FilesInfoRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of `Slack.FilesInfoRequest`. **Signature** ```java public Slack.FilesInfoRequest build() ``` **Return Value** Type: Slack.FilesInfoRequest #### count(count) **Signature** ```java public Slack.FilesInfoRequest.Builder count(Integer count) ``` **Parameters** _count_ Type: Integer **Return Value** Type: Slack.FilesInfoRequest.Builder #### file(file) Required. The ID of the file to retrieve information for. **Signature** ```java public Slack.FilesInfoRequest.Builder file(String file) ``` **Parameters** _file_ Type: String **Return Value** Type: Slack.FilesInfoRequest.Builder #### page(page) **Signature** ```java public Slack.FilesInfoRequest.Builder page(Integer page) ``` **Parameters** _page_ Type: Integer **Return Value** Type: Slack.FilesInfoRequest.Builder --- ## FilesInfoResponse Class Gets information about a file. **Usage** See Slack’s [files.info method](https://api.slack.com/methods/files.info). ### FilesInfoResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `FilesInfoResponse`. #### getContent() **Signature** ```java public String getContent() ``` **Return Value** Type: String #### getContentHighlightCss() **Signature** ```java public String getContentHighlightCss() ``` **Return Value** Type: String #### getContentHighlightHtml() **Signature** ```java public String getContentHighlightHtml() ``` **Return Value** Type: String #### getFile() **Signature** ```java public Slack.File getFile() ``` **Return Value** Type: Slack.File #### isTruncated() **Signature** ```java public Boolean isTruncated() ``` **Return Value** Type: Boolean #### setContent(content) **Signature** ```java public void setContent(String content) ``` **Parameters** _content_ Type: String #### setContentHighlightCss(contentHighlightCss) **Signature** ```java public void setContentHighlightCss(String contentHighlightCss) ``` **Parameters** _contentHighlightCss_ Type: String **Return Value** Type: void #### setContentHighlightHtml(contentHighlightHtml) **Signature** ```java public void setContentHighlightHtml(String contentHighlightHtml) ``` **Parameters** _contentHighlightHtml_ Type: String **Return Value** Type: void #### setFile(file) **Signature** ```java public void setFile(Slack.File file) ``` **Parameters** _file_ Type: Slack.File **Return Value** Type: void #### setTruncated(truncated) **Signature** ```java public void setTruncated(Boolean truncated) ``` **Parameters** _truncated_ Type: Boolean **Return Value** Type: void --- ## FilesListRequest Class Sends a request to retrieve a list of files for a team, in a channel, or from a user with applied filters. **Usage** See Slack’s [files.list method](https://api.slack.com/methods/files.list). ### FilesListRequest Methods The following are methods for `FilesListRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.FilesListRequest.Builder builder() ``` **Return Value** Type: Slack.FilesListRequest.Builder --- ## FilesListRequest.Builder Class Contains methods to build an instance of the `Slack.FilesListRequest` class. A Builder object is obtained by invoking one of the `FilesListRequest.builder` methods defined by the `FilesListRequest` class. ### FilesListRequest.Builder Methods The following are methods for `FilesListRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of `Slack.FilesListRequest`. **Signature** ```java public Slack.FilesListRequest build() ``` **Return Value** Type: Slack.FilesListRequest #### channel(channel) **Signature** ```java public Slack.FilesListRequest.Builder channel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: Slack.FilesListRequest.Builder #### count(count) **Signature** ```java public Slack.FilesListRequest.Builder count(Integer count) ``` **Parameters** _count_ Type: Integer **Return Value** Type: Slack.FilesListRequest.Builder #### page(page) **Signature** ```java public Slack.FilesListRequest.Builder page(Integer page) ``` **Parameters** _page_ Type: Integer **Return Value** Type: Slack.FilesListRequest.Builder #### showFilesHiddenByLimit(showFilesHiddenByLimit) **Signature** ```java public Slack.FilesListRequest.Builder showFilesHiddenByLimit(Boolean showFilesHiddenByLimit) ``` **Parameters** _showFilesHiddenByLimit_ Type: Boolean **Return Value** Type: Slack.FilesListRequest.Builder #### teamId(teamId) **Signature** ```java public Slack.FilesListRequest.Builder teamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: Slack.FilesListRequest.Builder #### tsFrom(tsFrom) **Signature** ```java public Slack.FilesListRequest.Builder tsFrom(String tsFrom) ``` **Parameters** _tsFrom_ Type: String **Return Value** Type: Slack.FilesListRequest.Builder #### tsTo(tsTo) **Signature** ```java public Slack.FilesListRequest.Builder tsTo(String tsTo) ``` **Parameters** _tsTo_ Type: String **Return Value** Type: Slack.FilesListRequest.Builder #### types(types) **Signature** ```java public Slack.FilesListRequest.Builder types(List types) ``` **Parameters** _types_ Type: List\ **Return Value** Type: Slack.FilesListRequest.Builder #### user(user) **Signature** ```java public Slack.FilesListRequest.Builder user(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: Slack.FilesListRequest.Builder --- ## FilesListResponse Class Retrieves a list of files for a team, in a channel, or from a user with applied filters. **Usage** See Slack’s [files.list method](https://api.slack.com/methods/files.list). ### FilesListResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `FilesListResponse`. #### getFiles() **Signature** ```java public List getFiles() ``` **Return Value** Type: List #### getPaging() **Signature** ```java public Slack.Paging getPaging() ``` **Return Value** Type: [Slack.Paging](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_paging.md) #### setFiles(files) **Signature** ```java public void setFiles(List files) ``` **Parameters** _files_ Type: List **Return Value** Type: void #### setPaging(paging) **Signature** ```java public void setPaging(Slack.Paging paging) ``` **Parameters** _paging_ Type: [Slack.Paging](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_paging.md) **Return Value** Type: void --- ## FilesRemoteAddRequest Class Sends a request to add a file from a remote service. **Usage** See Slack’s [files.remote.add method](https://api.slack.com/methods/files.remote.add). ### FilesRemoteAddRequest Methods The following are methods for `FilesRemoteAddRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.FilesRemoteAddRequest.Builder builder() ``` **Return Value** Type: Slack.FilesRemoteAddRequest.Builder --- ## FilesRemoteAddRequest.Builder Class Contains methods to build an instance of the `Slack.FilesRemoteAddRequest` class. A Builder object is obtained by invoking one of the `FilesRemoteAddRequest.builder` methods defined by the `FilesRemoteAddRequest` class. ### FilesRemoteAddRequest.Builder Methods The following are methods for `FilesRemoteAddRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of `Slack.FilesRemoteAddRequest`. **Signature** ```java public Slack.FilesRemoteAddRequest build() ``` **Return Value** Type: Slack.FilesRemoteAddRequest #### externalId(externalId) Required. The creator-defined GUID for the file. **Signature** ```java public Slack.FilesRemoteAddRequest.Builder externalId(String externalId) ``` **Parameters** _externalId_ Type: String **Return Value** Type: Slack.FilesRemoteAddRequest.Builder #### externalUrl(externalUrl) Required. The URL of the remote file. **Signature** ```java public Slack.FilesRemoteAddRequest.Builder externalUrl(String externalUrl) ``` **Parameters** _externalUrl_ Type: String **Return Value** Type: Slack.FilesRemoteAddRequest.Builder #### filetype(filetype) **Signature** ```java public Slack.FilesRemoteAddRequest.Builder filetype(String filetype) ``` **Parameters** _filetype_ Type: String **Return Value** Type: Slack.FilesRemoteAddRequest.Builder #### title(title) Required. The title of the file being shared. **Signature** ```java public Slack.FilesRemoteAddRequest.Builder title(String title) ``` **Parameters** _title_ Type: String **Return Value** Type: Slack.FilesRemoteAddRequest.Builder --- ## FilesRemoteAddResponse Class Adds a file from a remote service. **Usage** See Slack’s [files.remote.add method](https://api.slack.com/methods/files.remote.add). ### FilesRemoteAddResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `FilesRemoteAddResponse`. #### getFile() **Signature** ```java public Slack.File getFile() ``` **Return Value** Type: Slack.File #### setFile(file) **Signature** ```java public void setFile(Slack.File file) ``` **Parameters** _file_ Type: Slack.File **Return Value** Type: void --- ## FilesRemoteInfoRequest Class Sends a request to retrieve information about a remote file that’s added to Slack. **Usage** See Slack’s [files.remote.info method](https://api.slack.com/methods/files.remote.info). ### FilesRemoteInfoRequest Methods The following are methods for `FilesRemoteInfoRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.FilesRemoteInfoRequest.Builder builder() ``` **Return Value** Type: Slack.FilesRemoteInfoRequest.Builder --- ## FilesRemoteInfoRequest.Builder Class Contains methods to build an instance of the `Slack.FilesRemoteInfoRequest` class. A Builder object is obtained by invoking one of the `FilesRemoteInfoRequest.builder` methods defined by the `FilesRemoteInfoRequest` class. ### FilesRemoteInfoRequest.Builder Methods The following are methods for `FilesRemoteInfoRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of `Slack.FilesRemoteInfoRequest`. **Signature** ```java public Slack.FilesRemoteInfoRequest build() ``` **Return Value** Type: Slack.FilesRemoteInfoRequest #### externalId(externalId) **Signature** ```java public Slack.FilesRemoteInfoRequest.Builder externalId(String externalId) ``` **Return Value** Type: Slack.FilesRemoteInfoRequest.Builder #### file(file) **Signature** ```java public Slack.FilesRemoteInfoRequest.Builder file(String file) ``` **Parameters** _file_ Type: String **Return Value** Type: Slack.FilesRemoteInfoRequest.Builder --- ## FilesRemoteInfoResponse Class Retrieves information about a remote file that’s added to Slack. **Usage** See Slack’s [files.remote.info method](https://api.slack.com/methods/files.remote.info). ### FilesRemoteInfoResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `FilesRemoteInfoResponse`. #### getFile() **Signature** ```java public Slack.File getFile() ``` **Return Value** Type: Slack.File #### setFile(file) **Signature** ```java public void setFile(Slack.File file) ``` **Parameters** _file_ Type: Slack.File **Return Value** Type: void --- ## FilesRemoteListRequest Class Sends a request to retrieve a list of files that’s added to Slack for a team, in a channel, or from a user with applied filters. **Usage** See Slack’s [files.remote.list method](https://api.slack.com/methods/files.remote.list). ### FilesRemoteListRequest Methods The following are methods for `FilesRemoteListRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.FilesRemoteListRequest.Builder builder() ``` **Return Value** Type: Slack.FilesRemoteListRequest.Builder --- ## FilesRemoteListRequest.Builder Class Contains methods to build an instance of the `Slack.FilesRemoteListRequest` class. A Builder object is obtained by invoking one of the `FilesRemoteListRequest.builder` methods defined by the `FilesRemoteListRequest` class. ### FilesRemoteListRequest.Builder Methods The following are methods for `FilesRemoteListRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of `Slack.FilesRemoteListRequest`. **Signature** ```java public Slack.FilesRemoteListRequest build() ``` **Return Value** Type: Slack.FilesRemoteListRequest #### channel(channel) **Signature** ```java public Slack.FilesRemoteListRequest.Builder channel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: Slack.FilesRemoteListRequest.Builder #### cursor(cursor) **Signature** ```java public Slack.FilesRemoteListRequest.Builder cursor(String cursor) ``` **Parameters** _cursor_ Type: String **Return Value** Type: Slack.FilesRemoteListRequest.Builder #### limitValue(limitValue) **Signature** ```java public Slack.FilesRemoteListRequest.Builder limitValue(Integer limitValue) ``` **Parameters** _limitValue_ Type: Integer **Return Value** Type: Slack.FilesRemoteListRequest.Builder #### tsFrom(tsFrom) **Signature** ```java public Slack.FilesRemoteListRequest.Builder tsFrom(String tsFrom) ``` **Parameters** _tsFrom_ Type: String **Return Value** Type: Slack.FilesRemoteListRequest.Builder #### tsTo(tsTo) **Signature** ```java public Slack.FilesRemoteListRequest.Builder tsTo(String tsTo) ``` **Parameters** _tsTo_ Type: String **Return Value** Type: Slack.FilesRemoteListRequest.Builder --- ## FilesRemoteListResponse Class Retrieves a list of files that’s added to Slack for a team, in a channel, or from a user with applied filters. **Usage** See Slack’s [files.remote.list method](https://api.slack.com/methods/files.remote.list). ### FilesRemoteListResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `FilesRemoteListResponse`. #### getFiles() **Signature** ```java public List getFiles() ``` **Return Value** Type: List #### getResponseMetadata() **Signature** ```java public Slack.ResponseMetadata getResponseMetadata() ``` **Return Value** Type: [Slack.ResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#responsemetadata-class) #### setFiles(files) **Signature** ```java public void setFiles(List files) ``` **Parameters** _files_ Type: List **Return Value** Type: void #### setResponseMetadata(metadata) **Signature** ```java public void setResponseMetadata(Slack.ResponseMetadata responseMetadata) ``` **Parameters** _responseMetadata_ Type: [Slack.ResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#responsemetadata-class) **Return Value** Type: void --- ## FilesRemoteRemoveRequest Class Sends a request to remove a remote file. **Usage** See Slack’s [files.remote.remove method](https://api.slack.com/methods/files.remote.remove). ### FilesRemoteRemoveRequest Methods The following are methods for `FilesRemoteRemoveRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.FilesRemoteRemoveRequest.Builder builder() ``` **Return Value** Type: Slack.FilesRemoteRemoveRequest.Builder --- ## FilesRemoteRemoveRequest.Builder Class Contains methods to build an instance of the `Slack.FilesRemoteRemoveRequest` class. A Builder object is obtained by invoking one of the `FilesRemoteRemoveRequest.builder` methods defined by the `FilesRemoteRemoveRequest` class. ### FilesRemoteRemoveRequest.Builder Methods The following are methods for `FilesRemoteRemoveRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of `Slack.FilesRemoteRemoveRequest`. **Signature** ```java public Slack.FilesRemoteRemoveRequest build() ``` **Return Value** Type: Slack.FilesRemoteRemoveRequest #### externalId(externalId) **Signature** ```java public Slack.FilesRemoteRemoveRequest.Builder externalId(String externalId) ``` **Parameters** _externalId_ Type: String **Return Value** Type: Slack.FilesRemoteRemoveRequest.Builder #### file(file) **Signature** ```java public Slack.FilesRemoteRemoveRequest.Builder file(String file) ``` **Parameters** _file_ Type: String **Return Value** Type: Slack.FilesRemoteRemoveRequest.Builder --- ## FilesRemoteRemoveResponse Class Removes a remote file. **Usage** See Slack’s [files.remote.remove method](https://api.slack.com/methods/files.remote.remove) ### FilesRemoteRemoveResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). --- ## FilesRemoteShareRequest Class Sends a request to share a remote file into a channel. **Usage** See Slack’s [files.remote.share method](https://api.slack.com/methods/files.remote.share) ### FilesRemoteShareRequest Methods The following are methods for `FilesRemoteShareRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.FilesRemoteShareRequest.Builder builder() ``` **Return Value** Type: Slack.FilesRemoteShareRequest.Builder --- ## FilesRemoteShareRequest.Builder Class Contains methods to build an instance of the `Slack.FilesRemoteShareRequest` class. A Builder object is obtained by invoking one of the `FilesRemoteShareRequest.builder` methods defined by the `FilesRemoteShareRequest` class. ### FilesRemoteShareRequest.Builder Methods The following are methods for `FilesRemoteShareRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of `Slack.FilesRemoteShareRequest`. **Signature** ```java public Slack.FilesRemoteShareRequest build() ``` **Return Value** Type: Slack.FilesRemoteShareRequest #### channels(channels) Required. The comma-separated list of channel IDs where the file is shared. **Signature** ```java public Slack.FilesRemoteShareRequest.Builder channels(List channels) ``` **Parameters** _channels_ Type: List\ **Return Value** Type: Slack.FilesRemoteShareRequest.Builder #### externalId(externalId) **Signature** ```java public Slack.FilesRemoteShareRequest.Builder externalId(String externalId) ``` **Parameters** _externalId_ Type: String **Return Value** Type: Slack.FilesRemoteShareRequest.Builder #### file(file) **Signature** ```java public Slack.FilesRemoteShareRequest.Builder file(String file) ``` **Parameters** _file_ Type: String **Return Value** Type: Slack.FilesRemoteShareRequest.Builder --- ## FilesRemoteShareResponse Class Shares a remote file into a channel. **Usage** See Slack’s [files.remote.share method](https://api.slack.com/methods/files.remote.share). ### FilesRemoteShareResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `FilesRemoteShareResponse`. #### getFile() **Signature** ```java public Slack.File getFile() ``` **Return Value** Type: Slack.File #### setFile(file) **Signature** ```java public void setFile(Slack.File file) ``` **Parameters** _file_ Type: Slack.File **Return Value** Type: void --- ## FilesRemoteUpdateRequest Class Sends a request to update an existing remote file. **Usage** See Slack’s [files.remote.update method](https://api.slack.com/methods/files.remote.update). ### FilesRemoteUpdateRequest Methods The following are methods for `FilesRemoteUpdateRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.FilesRemoteUpdateRequest.Builder builder() ``` **Return Value** Type: Slack.FilesRemoteUpdateRequest.Builder --- ## FilesRemoteUpdateRequest.Builder Class Contains methods to build an instance of the `Slack.FilesRemoteUpdateRequest` class. A Builder object is obtained by invoking one of the `FilesRemoteUpdateRequest.builder` methods defined by the `FilesRemoteUpdateRequest` class. ### FilesRemoteUpdateRequest.Builder Methods The following are methods for `FilesRemoteUpdateRequest.Builder`. These methods are optional unless specified otherwise. #### build() Returns an instance of the `Slack.FilesRemoteUpdateRequest` object. **Signature** ```java public Slack.FilesRemoteUpdateRequest build() ``` **Return Value** Type: Slack.FilesRemoteUpdateRequest #### externalId(externalId) **Signature** ```java public Slack.FilesRemoteUpdateRequest.Builder externalId(String externalId) ``` **Parameters** _externalId_ Type: String **Return Value** Type: Slack.FilesRemoteUpdateRequest.Builder #### externalUrl(externalUrl) **Signature** ```java public Slack.FilesRemoteUpdateRequest.Builder externalUrl(String externalUrl) ``` **Parameters** _externalUrl_ Type: String **Return Value** Type: Slack.FilesRemoteUpdateRequest.Builder #### filetype(filetype) **Signature** ```java public Slack.FilesRemoteUpdateRequest.Builder filetype(String filetype) ``` **Parameters** _filetype_ Type: String **Return Value** Type: Slack.FilesRemoteUpdateRequest.Builder #### title(title) **Signature** public Slack.FilesRemoteUpdateRequest.Builder title(String title) **Parameters** _title_ Type: String **Return Value** Type: Slack.FilesRemoteUpdateRequest.Builder --- ## FilesRemoteUpdateResponse Class Updates an existing remote file. **Usage** See Slack’s [files.remote.update method](https://api.slack.com/methods/files.remote.update). ### FilesRemoteUpdateResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `FilesRemoteUpdateResponse`. #### getFile() **Signature** ```java public Slack.File getFile() ``` **Return Value** Type: Slack.File #### setFile(file) **Signature** ```java public void setFile(Slack.File file) ``` **Parameters** _file_ Type: Slack.File **Return Value** Type: void --- ## FilesRevokePublicURLRequest Class Sends a request to revoke public or external sharing access for a file. **Usage** See Slack’s [files.revokePublicURL method](https://api.slack.com/methods/files.revokePublicURL). ### FilesRevokePublicURLRequest Methods The following are methods for `FilesRevokePublicURLRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.FilesRevokePublicURLRequest.Builder builder() ``` **Return Value** Type: Slack.FilesRevokePublicURLRequest.Builder --- ## FilesRevokePublicURLRequest.Builder Class Contains methods to build an instance of the `Slack.FilesRevokePublicURLRequest` class. A Builder object is obtained by invoking one of the `FilesRevokePublicURLRequest.builder` methods defined by the `FilesRevokePublicURLRequest` class. ### FilesRevokePublicURLRequest.Builder Methods The following are methods for `FilesRevokePublicURLRequest.Builder`. #### build() Required. Returns an instance of `Slack.FilesRevokePublicURLRequest`. **Signature** ```java public Slack.FilesRevokePublicURLRequest build() ``` **Return Value** Type: Slack.FilesRevokePublicURLRequest #### file(file) Required. The file to revoke. **Signature** ```java public Slack.FilesRevokePublicURLRequest.Builder file(String file) ``` **Parameters** _file_ Type: String **Return Value** Type: Slack.FilesRevokePublicURLRequest.Builder --- ## FilesRevokePublicURLResponse Class Revokes public or external sharing access for a file. **Usage** See Slack’s [files.revokePublicURL method](https://api.slack.com/methods/files.revokePublicURL). ### FilesRevokePublicURLResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `FilesRevokePublicURLResponse`. #### getFile() **Signature** ```java public Slack.File getFile() ``` **Return Value** Type: Slack.File #### setFile(file) **Signature** ```java public void setFile(Slack.File file) ``` **Parameters** _file_ Type: Slack.File **Return Value** Type: void --- ## FilesSharedPublicURLRequest Class Sends a request to enable a file for public or external sharing. **Usage** See Slack’s [files.sharedPublicURL method](https://api.slack.com/methods/files.sharedPublicURL). ### FilesSharedPublicURLRequest Methods The following are methods for `FilesSharedPublicURLRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.FilesSharedPublicURLRequest.Builder builder() ``` **Return Value** Type: Slack.FilesSharedPublicURLRequest.Builder --- ## FilesSharedPublicURLRequest.Builder Class Contains methods to build an instance of the `Slack.FilesSharedPublicURLRequest` class. A Builder object is obtained by invoking one of the `FilesRevokeSharedURLRequest.builder` methods defined by the `FilesRevokeSharedURLRequest` class. ### FilesSharedPublicURLRequest.Builder Methods The following are methods for `FilesSharedPublicURLRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of `Slack.FilesSharedPublicURLRequest`. **Signature** ```java public Slack.FilesSharedPublicURLRequest build() ``` **Return Value** Type: Slack.FilesSharedPublicURLRequest #### file(file) Required. The file to share. **Signature** ```java public Slack.FilesSharedPublicURLRequest.Builder file(String file) ``` **Parameters** _file_ Type: String **Return Value** Type: Slack.FilesSharedPublicURLRequest.Builder --- ## FilesSharedPublicURLResponse Class Enables a file for public or external sharing. **Usage** See Slack’s [files.sharedPublicURL method](https://api.slack.com/methods/files.sharedPublicURL). ### FilesSharedPublicURLResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `FilesSharedPublicURLResponse`. #### getFile() **Signature** ```java public Slack.File getFile() ``` **Return Value** Type: Slack.File #### setFile(file) **Signature** ```java public void setFile(Slack.File file) ``` **Parameters** _file_ Type: Slack.File **Return Value** Type: void # Work with Latest Messages Use the `Latest` classes to work with the latest message in a channel or conversation. ## Latest Class Represents the latest message. ### Latest Methods The following are methods for `Latest`. #### getBotId() **Signature** ```java public String getBotId() ``` **Return Value** Type: String #### getBotLink() **Signature** ```java public String getBotLink() ``` **Return Value** Type: String #### getBotProfile() **Signature** ```java public Slack.BotProfile getBotProfile() ``` **Return Value** Type: [Slack.BotProfile](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_bot.md#botprofile-class) #### getClientMsgId() **Signature** ```java public String getClientMsgId() ``` **Return Value** Type: String #### getEdited() **Signature** ```java public Slack.Latest.Edited getEdited() ``` **Return Value** Type: Slack.Latest.Edited #### getFiles() **Signature** ```java public List getFiles() ``` **Return Value** Type: List #### getParentUserId() **Signature** ```java public String getParentUserId() ``` **Return Value** Type: String #### getReactions() **Signature** ```java public List getReactions() ``` **Return Value** Type: List #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getTeam() **Signature** ```java public String getTeam() ``` **Return Value** Type: String #### getText() **Signature** ```java public String getText() ``` **Return Value** Type: String #### getThreadTs() **Signature** ```java public String getThreadTs() ``` **Return Value** Type: String #### getTopic() **Signature** ```java public String getTopic() ``` **Return Value** Type: String #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### getUsername() **Signature** ```java public String getUsername() ``` **Return Value** Type: String #### getXFiles() **Signature** ```java public List getXFiles() ``` **Return Value** Type: List\ #### isDisplayAsBot() **Signature** ```java public Boolean isDisplayAsBot() ``` **Return Value** Type: Boolean #### isUpload() **Signature** ```java public Boolean isUpload() ``` **Return Value** Type: Boolean #### setBotId(botId) **Signature** ```java public void setBotId(String botId) ``` **Parameters** _botId_ Type: String **Return Value** Type: void #### setBotLink(botLink) **Signature** ```java public void setBotLink(String botLink) ``` **Parameters** _botLink_ Type: String **Return Value** Type: void #### setBotProfile(botProfile) **Signature** ```java public void setBotProfile(Slack.BotProfile botProfile) ``` **Parameters** _botProfile_ Type: [Slack.BotProfile](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_bot.md#botprofile-class) **Return Value** Type: void #### setClientMsgId(clientMsgId) **Signature** ```java public void setClientMsgId(String clientMsgId) ``` **Parameters** _clientMsgId_ Type: String **Return Value** Type: void #### setDisplayAsBot(displayAsBot) **Signature** ```java public void setDisplayAsBot(Boolean displayAsBot) ``` **Parameters** _displayAsBot_ Type: Boolean **Return Value** Type: void #### setEdited(edited) **Signature** ```java public void setEdited(Slack.Latest.Edited edited) ``` **Parameters** _edited_ Type: Slack.Latest.Edited **Return Value** Type: void #### setFiles(files) **Signature** ```java public void setFiles(List files) ``` **Parameters** _files_ Type: List<[Slack.File](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_files.md)> **Return Value** Type: void #### setParentUserId(parentUserId) **Signature** ```java public void setParentUserId(String parentUserId) ``` **Parameters** _parentUserId_ Type: String **Return Value** Type: void #### setReactions(reactions) **Signature** ```java public void setReactions(List reactions) ``` **Parameters** _reactions_ Type: List **Return Value** Type: void #### setSubtype(subtype) **Signature** ```java public void setSubtype(String subtype) ``` **Parameters** _subtype_ Type: String **Return Value** Type: void #### setTeam(team) **Signature** ```java public void setTeam(String team) ``` **Parameters** _team_ Type: String **Return Value** Type: void #### setText(text) **Signature** ```java public void setText(String text) ``` **Parameters** _text_ Type: String **Return Value** Type: void #### setThreadTs(threadTs) **Signature** ```java public void setThreadTs(String threadTs) ``` **Parameters** _threadTs_ Type: String **Return Value** Type: void #### setTopic(topic) **Signature** ```java public void setTopic(String topic) ``` **Parameters** _topic_ Type: String **Return Value** Type: void #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void #### setType(type) **Signature** ```java public void setType(String type) ``` **Parameters** _type_ Type: String **Return Value** Type: void #### setUpload(upload) **Signature** ```java public void setUpload(Boolean upload) ``` **Parameters** _upload_ Type: Boolean **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void #### setUsername(username) **Signature** ```java public void setUsername(String username) ``` **Parameters** _username_ Type: String **Return Value** Type: void #### setXFiles(xFiles) **Signature** ```java public void setXFiles(List xFiles) ``` **Parameters** _xFiles_ Type: List\ **Return Value** Type: void --- ## Latest.Edited Class ### Latest.Edited Methods The following are methods for `Latest.Edited`. #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void # Work with Message Context Use the `MessageContext` class to work with messages. ## MessageContext Class Contains information about messages. ### MessageContext Methods `MessageContext` has the following methods. #### getTs() Gets the timestamp of the message. **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getUserId() Gets the ID of the user who initiated the shortcut. **Signature** ```java public String getUserId() ``` **Return Value** Type: String #### getText() The text of the message. **Signature** ```java public string getText() ``` **Return Value** Type: String # Work with Messages Use the `Message` classes to work with messages in a channel or conversation. ## Message Class Represents a message in a channel or conversation. ### Message Methods The following are methods for `Message`. #### getBotId() **Signature** ```java public String getBotId() ``` **Return Value** Type: String #### getBotLink() **Signature** ```java public String getBotLink() ``` **Return Value** Type: String #### getBotProfile() **Signature** ```java public Slack.BotProfile getBotProfile() ``` **Return Value** Type: [Slack.BotProfile](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_bot.md#botprofile-class) #### getChannel() **Signature** ```java public String getChannel() ``` **Return Value** Type: String #### getClientMsgId() **Signature** ```java public String getClientMsgId() ``` **Return Value** Type: String #### getComment() **Signature** ```java public Slack.Message.MessageItem getComment() ``` **Return Value** Type: Slack.Message.MessageItem #### getEdited() **Signature** ```java public Slack.Message.Edited getEdited() ``` **Return Value** Type: Slack.Message.Edited #### getFile() **Signature** ```java public Slack.File getFile() ``` **Return Value** Type: Slack.File #### getFiles() **Signature** ```java public List getFiles() ``` **Return Value** Type: List #### getIcons() **Signature** ```java public Slack.Message.Icons getIcons() ``` **Return Value** Type: Slack.Message.Icons #### getInviter() **Signature** ```java public String getInviter() ``` **Return Value** Type: String #### getItem() **Signature** ```java public Slack.Message.MessageItem getItem() ``` **Return Value** Type: Slack.Message.MessageItem #### getItemType() **Signature** ```java public String getItemType() ``` **Return Value** Type: String #### getLastRead() **Signature** ```java public String getLastRead() ``` **Return Value** Type: String #### getLatestReply() **Signature** ```java public String getLatestReply() ``` **Return Value** Type: String #### getParentUserId() **Signature** ```java public String getParentUserId() ``` **Return Value** Type: String #### getPinnedTo() **Signature** ```java public List getPinnedTo() ``` **Return Value** Type: List\ #### getPurpose() **Signature** ```java public String getPurpose() ``` **Return Value** Type: String #### getReactions() **Signature** ```java public List getReactions() ``` **Return Value** Type: List #### getReplyCount() **Signature** ```java public Integer getReplyCount() ``` **Return Value** Type: Integer #### getReplyUsers() **Signature** ```java public List getReplyUsers() ``` **Return Value** Type: List\ #### getReplyUsersCount() **Signature** ```java public Integer getReplyUsersCount() ``` **Return Value** Type: Integer #### getRoot() **Signature** ```java public Slack.Message.MessageRoot getRoot() ``` **Return Value** Type: Slack.Message.MessageRoot #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getTeam() **Signature** ```java public String getTeam() ``` **Return Value** Type: String #### getText() **Signature** ```java public String getText() ``` **Return Value** Type: String #### getThreadTs() **Signature** ```java public String getThreadTs() ``` **Return Value** Type: String #### getTopic() **Signature** ```java public String getTopic() ``` **Return Value** Type: String #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### getUsername() **Signature** ```java public String getUsername() ``` **Return Value** Type: String #### getXFiles() **Signature** ```java public List getXFiles() ``` **Return Value** Type: List\ #### isDisplayAsBot() **Signature** ```java public Boolean isDisplayAsBot() ``` **Return Value** Type: Boolean #### isHidden() **Signature** ```java public Boolean isHidden() ``` **Return Value** Type: Boolean #### isIntro() **Signature** ```java public Boolean isIntro() ``` **Return Value** Type: Boolean #### isLocked() **Signature** ```java public Boolean isIntro() ``` **Return Value** Type: Boolean #### isStarred() **Signature** ```java public Boolean isStarred() ``` **Return Value** Type: Boolean #### isSubscribed() **Signature** ```java public Boolean isSubscribed() ``` **Return Value** Type: Boolean #### isThreadBroadcast() **Signature** ```java public Boolean isThreadBroadcast() ``` **Return Value** Type: Boolean #### isUnfurlLinks() **Signature** ```java public Boolean isUnfurlLinks() ``` **Return Value** Type: Boolean #### isUnfurlMedia() **Signature** ```java public Boolean isUnfurlMedia() ``` **Return Value** Type: Boolean #### isUpload() **Signature** ```java public Boolean isUpload() ``` **Return Value** Type: Boolean #### isWibblr() **Signature** ```java public Boolean isWibblr() ``` **Return Value** Type: Boolean #### setBotId(botId) **Signature** ```java public void setBotId(String botId) ``` **Parameters** _botId_ Type: String **Return Value** Type: void #### setBotLink(botLink) **Signature** ```java public void setBotLink(String botLink) ``` **Parameters** _botLink_ Type: String **Return Value** Type: void #### setBotProfile(botProfile) **Signature** ```java public void setBotProfile(Slack.BotProfile botProfile) ``` **Parameters** _botProfile_ Type: [Slack.BotProfile](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_bot.md#botprofile-class) **Return Value** Type: void #### setChannel(channel) **Signature** ```java public void setChannel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: void #### setClientMsgId(clientMsgId) **Signature** ```java public void setClientMsgId(String clientMsgId) ``` **Parameters** _clientMsgId_ Type: String **Return Value** Type: void #### setComment(comment) **Signature** ```java public void setComment(Slack.Message.MessageItem comment) ``` **Parameters** _comment_ Type: Slack.Message.MessageItem **Return Value** Type: void #### setDisplayAsBot(displayAsBot) **Signature** ```java public void setDisplayAsBot(Boolean displayAsBot) ``` **Parameters** _displayAsBot_ Type: Boolean **Return Value** Type: void #### setEdited(edited) **Signature** ```java public void setEdited(Slack.Message.Edited edited) ``` **Parameters** _edited_ Type: Slack.Message.Edited **Return Value** Type: void #### setFile(file) **Signature** ```java public void setFile(Slack.File file) ``` **Parameters** _file_ Type: [Slack.File](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_files.md) **Return Value** Type: void #### setFiles(files) **Signature** ```java public void setFiles(List files) ``` **Parameters** _files_ Type: List<[Slack.File](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_files.md)> **Return Value** Type: void #### setHidden(hidden) **Signature** ```java public void setHidden(Boolean hidden) ``` **Parameters** _hidden_ Type: Boolean **Return Value** Type: void #### setIcons(icons) **Signature** ```java public void setIcons(Slack.Message.Icons icons) ``` **Parameters** _icons_ Type: Slack.Message.Icons **Return Value** Type: void #### setIntro(intro) **Signature** ```java public void setIntro(Boolean intro) ``` **Parameters** _intro_ Type: Boolean **Return Value** Type: void #### setInviter(inviter) **Signature** ```java public void setInviter(String inviter) ``` **Parameters** _inviter_ Type: String **Return Value** Type: void #### setItem(item) **Signature** ```java public void setItem(Slack.Message.MessageItem item) ``` **Parameters** _item_ Type: Slack.Message.MessageItem **Return Value** Type: void #### setItemType(itemType) **Signature** ```java public void setItemType(String itemType) ``` **Parameters** _itemType_ Type: String **Return Value** Type: void #### setLastRead(lastRead) **Signature** ```java public void setLastRead(String lastRead) ``` **Parameters** _lastRead_ Type: String **Return Value** Type: void #### setLatestReply(latestReply) **Signature** ```java public void setLatestReply(String latestReply) ``` **Parameters** _latestReply_ Type: String **Return Value** Type: void #### setLocked(locked) **Signature** ```java public void setLocked(Boolean locked) ``` **Parameters** _locked_ Type: Booleean **Return Value** Type: void #### setParentUserId(parentUserId) **Signature** ```java public void setParentUserId(String parentUserId) ``` **Parameters** _parentUserId_ Type: String **Return Value** Type: void #### setPinnedTo(pinnedTo) **Signature** ```java public void setPinnedTo(List pinnedTo) ``` **Parameters** _pinnedTo_ Type: List\ **Return Value** Type: void #### setPurpose(purpose) **Signature** ```java public void setPurpose(String purpose) ``` **Parameters** _purpose_ Type: String **Return Value** Type: void #### setReactions(reactions) **Signature** ```java public void setReactions(List reactions) ``` **Parameters** _reactions_ Type: List **Return Value** Type: void #### setReplyCount(replyCount) **Signature** ```java public void setReplyCount(Integer replyCount) ``` **Parameters** _replyCount_ Type: Integer **Return Value** Type: void #### setReplyUsers(replyUsers) **Signature** ```java public void setReplyUsers(List replyUsers) ``` **Parameters** _replyUsers_ Type: List\ **Return Value** Type: void #### setReplyUsersCount(replyUsersCount) **Signature** ```java public void setReplyUsersCount(Integer replyUsersCount) ``` **Parameters** _replyUsersCount_ Type: Integer **Return Value** Type: void #### setRoot(root) **Signature** ```java public void setRoot(Slack.Message.MessageRoot root) ``` **Parameters** _root_ Type: Slack.Message.MessageRoot **Return Value** Type: void #### setStarred(starred) **Signature** ```java public void setStarred(Boolean starred) ``` **Parameters** _starred_ Type: Boolean **Return Value** Type: void #### setSubscribed(subscribed) **Signature** ```java public void setSubscribed(Boolean subscribed) ``` **Parameters** _subscribed_ Type: Boolean **Return Value** Type: void #### setSubtype(subtype) **Signature** ```java public void setSubtype(String subtype) ``` **Parameters** _subtype_ Type: String **Return Value** Type: void #### setTeam(team) **Signature** ```java public void setTeam(String team) ``` **Parameters** _team_ Type: String **Return Value** Type: void #### setText(text) **Signature** ```java public void setText(String text) ``` **Parameters** _text_ Type: String **Return Value** Type: void #### setThreadBroadcast(threadBroadcast) **Signature** ```java public void setThreadBroadcast(Boolean threadBroadcast) ``` **Parameters** _threadBroadcast_ Type: Boolean **Return Value** Type: void #### setThreadTs(threadTs) **Signature** ```java public void setThreadTs(String threadTs) ``` **Parameters** _threadTs_ Type: String **Return Value** Type: void #### setTopic(topic) **Signature** ```java public void setTopic(String topic) ``` **Parameters** _topic_ Type: String **Return Value** Type: void #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: **Return Value** Type: void #### setType(type) **Signature** ```java public void setType(String type) ``` **Parameters** _type_ Type: **Return Value** Type: void #### setUnfurlLinks(unfurlLinks) **Signature** ```java public void setUnfurlLinks(Boolean unfurlLinks) ``` **Parameters** _unfurlLinks_ Type: **Return Value** Type: void #### setUnfurlMedia(unfurlMedia) **Signature** ```java public void setUnfurlMedia(Boolean unfurlMedia) ``` **Parameters** _unfurlMedia_ Type: Boolean **Return Value** Type: void #### setUpload(upload) **Signature** ```java public void setUpload(Boolean upload) ``` **Parameters** _upload_ Type: Boolean **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void #### setUsername(username) **Signature** ```java public void setUsername(String username) ``` **Parameters** _username_ Type: String **Return Value** Type: void #### setWibblr(wibblr) **Signature** ```java public void setWibblr(Boolean wibblr) ``` **Parameters** _wibblr_ Type: **Return Value** Type: void #### setXFiles(xFiles) **Signature** ```java public void setXFiles(List xFiles) ``` **Parameters** _xFiles_ Type: List\ **Return Value** Type: void --- ## Message.Edited Class ### Message.Edited Methods The following are methods for `Message.Edited`. #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Return Value** Type: String #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void --- ## Message.Icons Class ### Message.Icons Methods The following are methods for `Message.Icons`. #### getEmoji() **Signature** ```java public String getEmoji() ``` **Return Value** Type: String #### getImage36() **Signature** ```java public String getImage36() ``` **Return Value** Type: String #### getImage48() **Signature** ```java public String getImage48() ``` **Return Value** Type: String #### getImage64() **Signature** ```java public String getImage64() ``` **Return Value** Type: String #### getImage72() **Signature** ```java public String getImage72() ``` **Return Value** Type: String #### setEmoji(emoji) **Signature** ```java public void setEmoji(String emoji) ``` **Parameters** _emoji_ Type: String **Return Value** Type: void #### setImage36() **Signature** ```java public void setImage36(String image36) ``` **Parameters** _image36_ Type: String **Return Value** Type: void #### setImage48(image48) **Signature** ```java public void setImage48(String image48) ``` **Parameters** _image48_ Type: String **Return Value** Type: void #### setImage64(image64) **Signature** ```java public void setImage64(String image64) ``` **Parameters** _image64_ Type: String **Return Value** Type: void #### setImage72(image72) **Signature** ```java public void setImage72(String image72) ``` **Parameters** _image72_ Type: String **Return Value** Type: void --- ## Message.MessageItem Class ### Message.MessageItem Methods The following are methods for `Message.MessageItem`. #### getComment() **Signature** ```java public String getComment() ``` **Return Value** Type: String #### getCreated() **Signature** ```java public String getCreated() ``` **Return Value** Type: String #### getEditLink() **Signature** ```java public String getEditLink() ``` **Return Value** Type: String #### getExternalType() **Signature** ```java public String getExternalType() ``` **Return Value** Type: String #### getFiletype() **Signature** ```java public String getFiletype() ``` **Return Value** Type: String #### getId() **Signature** ```java public String getId() ``` **Return Value** Type: String #### getLines() **Signature** ```java public Integer getLines() ``` **Return Value** Type: Integer #### getLinesMore() **Signature** ```java public Integer getLinesMore() ``` **Return Value** Type: Integer #### getMimetype() **Signature** ```java public String getMimetype() ``` **Return Value** Type: String #### getMode() **Signature** ```java public String getMode() ``` **Return Value** Type: String #### getName() **Signature** ```java public String getName() ``` **Return Value** Type: String #### getPermalink() **Signature** ```java public String getPermalink() ``` **Return Value** Type: String #### getPrettyType() **Signature** ```java public String getPrettyType() ``` **Return Value** Type: String #### getPreview() **Signature** ```java public String getPreview() ``` **Return Value** Type: String #### getPreviewHighlight() **Signature** ```java public String getPreviewHighlight() ``` **Return Value** Type: String #### getSize() **Signature** ```java public Integer getSize() ``` **Return Value** Type: Integer #### getTimestamp() **Signature** ```java public String getTimestamp() ``` **Return Value** Type: String #### getTitle() **Signature** ```java public String getTitle() ``` **Return Value** Type: String #### getUrlPrivate() **Signature** ```java public String getUrlPrivate() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### getUsername() **Signature** ```java public String getUsername() ``` **Return Value** Type: String #### isDisplayAsBot() **Signature** ```java public Boolean isDisplayAsBot() ``` **Return Value** Type: Boolean #### isEditable() **Signature** ```java public Boolean isEditable() ``` **Return Value** Type: Boolean #### isExternal() **Signature** ```java public Boolean isExternal() ``` **Return Value** Type: Boolean #### isHasRichPreview() **Signature** ```java public Boolean isHasRichPreview() ``` **Return Value** Type: Boolean #### isIntro() **Signature** ```java public Boolean isHasRichPreview() ``` **Return Value** Type: Boolean #### isPermalinkPublic() **Signature** ```java public Boolean isPermalinkPublic() ``` **Return Value** Type: Boolean #### isPreviewTruncated() **Signature** ```java public Boolean isPreviewTruncated() ``` **Return Value** Type: Boolean #### ispublic() **Signature** ```java public Boolean ispublic() ``` **Return Value** Type: Boolean #### isPublicUrlShared() **Signature** ```java public Boolean isPublicUrlShared() ``` **Return Value** Type: Boolean #### isStarred() **Signature** ```java public Boolean isStarred() ``` **Return Value** Type: Boolean #### isUrlPrivateDownload() **Signature** ```java public Boolean isUrlPrivateDownload() ``` **Return Value** Type: Boolean #### setComment(comment) **Signature** ```java public void setComment(String comment) ``` **Parameters** _comment_ Type: String **Return Value** Type: void #### setCreated(created) **Signature** ```java public void setCreated(String created) ``` **Parameters** _created_ Type: String **Return Value** Type: void #### setDisplayAsBot(displayAsBot) **Signature** ```java public void setDisplayAsBot(Boolean displayAsBot) ``` **Parameters** _displayAsBot_ Type: Boolean **Return Value** Type: void #### setEditable(editable) **Signature** ```java public void setEditable(Boolean editable) ``` **Parameters** _editable_ Type: Boolean **Return Value** Type: void #### setEditLink(editLink) **Signature** ```java public void setEditLink(String editLink) ``` **Parameters** _editLink_ Type: String **Return Value** Type: void #### setExternal(external) **Signature** ```java public void setExternal(Boolean external) ``` **Parameters** _external_ Type: Boolean **Return Value** Type: void #### setExternalType(externalType) **Signature** ```java public void setExternalType(String externalType) ``` **Parameters** _externalType_ Type: String **Return Value** Type: void #### setFiletype(filetype) **Signature** ```java public void setFiletype(String filetype) ``` **Parameters** _filetype_ Type: String **Return Value** Type: void #### setHasRichPreview(hasRichPreview) **Signature** ```java public void setHasRichPreview(Boolean hasRichPreview) ``` **Parameters** _hasRichPreview_ Type: Boolean **Return Value** Type: void #### setId(id) **Signature** ```java public void setId(String id) ``` **Parameters** _id_ Type: String **Return Value** Type: void #### setIntro(intro) **Signature** ```java public void setIntro(Boolean intro) ``` **Parameters** _intro_ Type: Boolean **Return Value** Type: void #### setLines(lines) **Signature** ```java public void setLines(Integer lines) ``` **Parameters** _lines_ Type: Integer **Return Value** Type: void #### setLinesMore(linesMore) **Signature** ```java public void setLinesMore(Integer linesMore) ``` **Parameters** _linesMore_ Type: Integer **Return Value** Type: void #### setMimetype(mimetype) **Signature** ```java public void setMimetype(String mimetype) ``` **Parameters** _mimetype_ Type: String **Return Value** Type: void #### setMode(mode) **Signature** ```java public void setMode(String mode) ``` **Parameters** _mode_ Type: String **Return Value** Type: void #### setName() **Signature** ```java public void setName(String name) ``` **Parameters** _name_ Type: String **Return Value** Type: void #### setPermalink(permalink) **Signature** ```java public void setPermalink(String permalink) ``` **Parameters** _permalink_ Type: String **Return Value** Type: void #### setPermalinkPublic(permalinkPublic) **Signature** ```java public void setPermalinkPublic(Boolean permalinkPublic) ``` **Parameters** _permalinkPublic_ Type: Boolean **Return Value** Type: void #### setPrettyType(prettyType) **Signature** ```java public void setPrettyType(String prettyType) ``` **Parameters** _prettyType_ Type: String **Return Value** Type: void #### setPreview(preview) **Signature** ```java public void setPreview(String preview) ``` **Parameters** _preview_ Type: String **Return Value** Type: void #### setPreviewHighlight(previewHighlight) **Signature** ```java public void setPreviewHighlight(String previewHighlight) ``` **Parameters** _previewHighlight_ Type: String **Return Value** Type: void #### setPreviewTruncated(previewTruncated) **Signature** ```java public void setPreviewTruncated(Boolean previewTruncated) ``` **Parameters** _previewTruncated_ Type: Boolean **Return Value** Type: void #### setpublic(\_public) **Signature** ```java public void setpublic(Boolean _public) ``` **Parameters** _\_public_ Type: Boolean **Return Value** Type: void #### setPublicUrlShared(publicUrlShared) **Signature** ```java public void setPublicUrlShared(Boolean publicUrlShared) ``` **Parameters** _publicUrlShared_ Type: Boolean **Return Value** Type: void #### setSize(size) **Signature** ```java public void setSize(Integer size) ``` **Parameters** _size_ Type: Integer **Return Value** Type: void #### setStarred(starred) **Signature** ```java public void setStarred(Boolean starred) ``` **Parameters** _starred_ Type: Boolean **Return Value** Type: void #### setTimestamp(timestamp) **Signature** ```java public void setTimestamp(String timestamp) ``` **Parameters** _timestamp_ Type: String **Return Value** Type: void #### setTitle(title) **Signature** ```java public void setTitle(String title) ``` **Parameters** _title_ Type: String **Return Value** Type: void #### setUrlPrivate(urlPrivate) **Signature** ```java public void setUrlPrivate(String urlPrivate) ``` **Parameters** _urlPrivate_ Type: String **Return Value** Type: void #### setUrlPrivateDownload(urlPrivateDownload) **Signature** ```java public void setUrlPrivateDownload(Boolean urlPrivateDownload) ``` **Parameters** _urlPrivateDownload_ Type: Boolean **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void #### setUsername(username) **Signature** ```java public void setUsername(String username) ``` **Parameters** _username_ Type: String **Return Value** Type: void --- ## Message.MessageRoot Class ### Message.MessageRoot Methods The following are methods for `Message.MessageRoot`. #### getBotId() **Signature** ```java public String getBotId() ``` **Return Value** Type: String #### getBotProfile() **Signature** ```java public Slack.BotProfile getBotProfile() ``` **Return Value** Type: [Slack.BotProfile](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_bot.md#botprofile-class) #### getEdited() **Signature** ```java public Slack.Message.Edited getEdited() ``` **Return Value** Type: Slack.Message.Edited #### getIcons() **Signature** ```java public Slack.Message.Icons getIcons() ``` **Return Value** Type: Slack.Message.Icons #### getLastRead() **Signature** ```java public String getLastRead() ``` **Return Value** Type: String #### getLatestReply() **Signature** ```java public String getLatestReply() ``` **Return Value** Type: String #### getParentUserId() **Signature** ```java public String getParentUserId() ``` **Return Value** Type: String #### getReplyCount() **Signature** ```java public Integer getReplyCount() ``` **Return Value** Type: Integer #### getReplyUsers() **Signature** ```java public List getReplyUsers() ``` **Return Value** Type: List\ #### getReplyUsersCount() **Signature** ```java public Integer getReplyUsersCount() ``` **Return Value** Type: Integer #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getTeam() **Signature** ```java public String getTeam() ``` **Return Value** Type: String #### getText() **Signature** ```java public String getText() ``` **Return Value** Type: String #### getThreadTs() **Signature** ```java public String getThreadTs() ``` **Return Value** Type: String #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUnreadCount() **Signature** ```java public Integer getUnreadCount() ``` **Return Value** Type: Integer #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### getUsername() **Signature** ```java public String getUsername() ``` **Return Value** Type: String #### isMrkdwn() **Signature** ```java public Boolean isMrkdwn() ``` **Return Value** Type: Boolean #### isSubscribed() **Signature** ```java public Boolean isSubscribed() ``` **Return Value** Type: String #### setBotId(botId) **Signature** ```java public void setBotId(String botId) ``` **Parameters** _botId_ Type: String **Return Value** Type: void #### setBotProfile(botProfile) **Signature** ```java public void setBotProfile(Slack.BotProfile botProfile) ``` **Parameters** _botProfile_ Type: [Slack.BotProfile](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_bot.md#botprofile-class) **Return Value** Type: void #### setEdited(edited) **Signature** ```java public void setEdited(Slack.Message.Edited edited) ``` **Parameters** _edited_ Type: Slack.Message.Edited **Return Value** Type: void #### setIcons(icons) **Signature** ```java public void setIcons(Slack.Message.Icons icons) ``` **Parameters** _icons_ Type: Slack.Message.Icons **Return Value** Type: void #### setLastRead(lastRead) **Signature** ```java public void setLastRead(String lastRead) ``` **Parameters** _lastRead_ Type: String **Return Value** Type: void #### setLatestReply(latestReply) **Signature** ```java public void setLatestReply(String latestReply) ``` **Parameters** _latestReply_ Type: String **Return Value** Type: void #### setMrkdwn(mrkdwn) **Signature** ```java public void setMrkdwn(Boolean mrkdwn) ``` **Parameters** _mrkdwn_ Type: Boolean **Return Value** Type: void #### setParentUserId(parentUserId) **Signature** ```java public void setParentUserId(String parentUserId) ``` **Parameters** _parentUserId_ Type: String **Return Value** Type: void #### setReplyCount(replyCount) **Signature** ```java public void setReplyCount(Integer replyCount) ``` **Parameters** _replyCount_ Type: Integer **Return Value** Type: void #### setReplyUsers(replyUsers) **Signature** ```java public void setReplyUsers(List replyUsers) ``` **Parameters** _replyUsers_ Type: List\ **Return Value** Type: void #### setReplyUsersCount(replyUsersCount) **Signature** ```java public void setReplyUsersCount(Integer replyUsersCount) ``` **Parameters** _replyUsersCount_ Type: Integer **Return Value** Type: void #### setSubscribed(subscribed) **Signature** ```java public void setSubscribed(Boolean subscribed) ``` **Parameters** _subscribed_ Type: Boolean **Return Value** Type: void #### setSubtype(subtype) **Signature** ```java public void setSubtype(String subtype) ``` **Parameters** _subtype_ Type: String **Return Value** Type: void #### setTeam(team) **Signature** ```java public void setTeam(String team) ``` **Parameters** _team_ Type: String **Return Value** Type: void #### setText(text) **Signature** ```java public void setText(String text) ``` **Parameters** _text_ Type: String **Return Value** Type: void #### setThreadTs(threadTs) **Signature** ```java public void setThreadTs(String threadTs) ``` **Parameters** _threadTs_ Type: String **Return Value** Type: void #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void #### setType(type) **Signature** ```java public void setType(String type) ``` **Parameters** _type_ Type: String **Return Value** Type: void #### setUnreadCount(unreadCount) **Signature** ```java public void setUnreadCount(Integer unreadCount) ``` **Parameters** _unreadCount_ Type: Integer **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void #### setUsername(username) **Signature** ```java public void setUsername(String username) ``` **Parameters** _username_ Type: String **Return Value** Type: void ## Message.MessageRootReply Class ### Message.MessageRootReply Methods The following are methods for `Message.MessageRootReply`. #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void # Work with Migration Exchange The following are Apex classes for the Slack `migration.exchange` [API method](https://api.slack.com/methods/migration.exchange). ## MigrationExchangeRequest Class For Enterprise Grid workspaces, sends a request to map local user IDs to global user IDs. ### MigrationExchangeRequest Methods The following are methods for `MigrationExchangeRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.MigrationExchangeRequest.Builder builder() ``` **Return Value** Type: Slack.MigrationExchangeRequest.Builder --- ## MigrationExchangeRequest.Builder Class Contains methods to build an instance of the `Slack.MigrationExchangeRequest` class. A Builder object is obtained by invoking one of the `MigrationExchangeRequest.Builder` methods defined by the `MigrationExchangeRequest class`. ### MigrationExchangeRequest.Builder Methods The following are methods for `MigrationExchangeRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of `Slack.MigrationExchangeRequest`. **Signature** ```java public Slack.MigrationExchangeRequest build() ``` **Return Value** Type: Slack.MigrationExchangeRequest #### teamId(teamId) **Signature** ```java public Slack.MigrationExchangeRequest.Builder teamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: Slack.MigrationExchangeRequest.Builder #### toOld(toOld) **Signature** ```java public Slack.MigrationExchangeRequest.Builder toOld(Boolean toOld) ``` **Parameters** _toOld_ Type: Boolean **Return Value** Type: Slack.MigrationExchangeRequest.Builder #### users(users) Required. A comma-separated list of user IDs, up to 400 per request. **Signature** ```java public Slack.MigrationExchangeRequest.Builder users(List users) ``` **Parameters** _users_ Type: List<String> --- ## MigrationExchangeResponse Class For Enterprise Grid workspaces, map local user IDs to global user IDs. ### MigrationExchangeResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `MigrationExchangeResponse`. #### getEnterpriseId() **Signature** ```java public String getEnterpriseId() ``` **Return Value** Type: String #### getInvalidUserIds() **Signature** ```java public List getInvalidUserIds() ``` **Return Value** Type: List<String> #### getTeamId() **Signature** ```java public String getTeamId() ``` **Return Value** Type: String # Work with Modals The following are Apex classes to work with modals. ## ModalHandler Interface Implement this interface to return a modal view. ### ModalHandler Methods `ModalHandler` has the following method. #### call() Enables you to create an instance of modal view with the view reference parameters. **Signature** ```java public Slack.ModalView call() ``` **Return Value** Type: Slack.ModalView --- ## ModalView Class Creates a modal view. A view is a visual area within a modal. See [Defining view objects](https://api.slack.com/reference/surfaces/views). ### ModalView Methods The following are methods for `ModalView`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.ModalView.Builder builder() ``` **Return Value** Type: Slack.ModalView.Builder --- ## ModalView.Builder Class Contains methods to build an instance of the `Slack.ModalView` class. A Builder object is obtained by invoking one of the `ModalView.Builder` methods defined by the `ModalView` class. ### ModalView.Builder Methods The following are methods for `ModalView.Builder`. #### build() Returns an instance of the `Slack.ModalView` object. **Signature** ```java public Slack.ModalView build() ``` **Return Value** Type: Slack.ModalView #### clearOnClose(clearOnClose) Sets the `clearOnClose` boolean value on the modal view object. **Signature** ```java public Slack.ModalView.Builder clearOnClose(Boolean clearOnClose) ``` **Parameters** _clearOnClose_ Specifies whether clicking on the close button clears all views in a modal and closes it. This value defaults to false. Type: Boolean **Return Value** Type: Slack.ModalView.Builder #### externalId(externalId) Sets the `externalId` value on the modal view object. **Signature** ```java public Slack.ModalView.Builder externalId(String externalId) ``` **Parameters** _externalId_ Type: String A custom identifier that must be unique for all views on a per-team basis. **Return Value** Type:Slack.ModalView.Builder #### viewReference(viewReference) Sets the view to be displayed in the modal. **Signature** ```java public Slack.ModalView.Builder viewReference(Slack.ViewReference viewReference) ``` **Parameters** _viewReference_ Type: Slack.ViewReference The view to be displayed in the modal. **Return Value** Type: Slack.ModalView.Builder # Work with Options Use these Apex classes to implement a [Select](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/elements.md#select) component or a data provider specified by the `datasource` key on an [External Select](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/elements.md#external-select) component. **tip:** The [sample app](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/setup-install-app.md) has several examples that use the Select and External Select components. ## Option Class Creates an option for the [Select](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/elements.md#select) or [External Select](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/elements.md#external-select) component. For the External Select component, construct your data using `List` and return it using `Slack.OptionDataResponse`. Alternatively, specify the values or use an expression in the view definition for the [Select](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/elements.md#select) or [External Select](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/elements.md#external-select) component. ### Usage Construct `List` to build a list of values for the Select component. ```java public class DataProviderOpportunityLookup { private static final String NO_OPPORTUNITY = 'Account has no Opportunity'; private static final String MISSING_OR_INCORRECT_ACCOUNT_ID = 'Account Id is missing or is incorrect'; /* Use List to retrieve all opportunities by accountId. Return result in the format List to the view. */ public static List getOpportunitiesByAccount(String accountId) { List oppOptions; if (String.isNotBlank(accountId)) { List opps = queryOpportunities(accountId); oppOptions = new List(); if (!opps.isEmpty()) { for (Opportunity opp : opps) { Slack.Option oppOption = new Slack.Option(opp.Name, opp.Id); oppOptions.add(oppOption); } } else { oppOptions.add(new Slack.Option(NO_OPPORTUNITY, NO_OPPORTUNITY)); } } else { oppOptions = new List{ new Slack.Option(MISSING_OR_INCORRECT_ACCOUNT_ID, MISSING_OR_INCORRECT_ACCOUNT_ID) }; System.debug(MISSING_OR_INCORRECT_ACCOUNT_ID); } return oppOptions; } } ``` See the [sample app](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/setup-install-app.md) for a full example. Alternatively, use the `Slack.Option` class to build your option list for the External Select component and return it using `Slack.OptionDataResponse`. ```java public class DataProviderAccountLookup { public static Slack.OptionDataResponse getAccountsByName(String value) { List accounts; if (String.isNotBlank(value)) { String name = '%' + value + '%'; accounts = [SELECT Id, Name FROM Account WHERE Name LIKE :name WITH SECURITY_ENFORCED LIMIT 10]; } List accountOptions = new List(); if (accounts != null) { for (Account account : accounts) { Slack.Option option = new Slack.Option(account.Name, account.Id); accountOptions.add(option); } } return new Slack.OptionDataResponse(accountOptions); } } ``` ### Option Constructor `Option` has the following constructor. #### Option(text, value) Creates an instance of the `Slack.Option` class with the text and value. **Signature** ```java public Option(String text, String value) ``` **Parameters** _text_ Type: String The text to display on the component. _value_ Type: String The value of the option. ### Option Methods The following are methods for `Option`. #### getText() Gets the display text for the component. **Signature** ```java public String getText() ``` **Return Type** Type: String #### getValue() Gets the value of the option. **Signature** ```java public String getValue() ``` **Return Type** Type: String --- ## OptionDataResponse Class The data to return for the [External Select](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/elements.md#external-select) component using a `List` or `List`. ### Usage Construct `Slack.OptionDataResponse` with `List` or `List`. **important:** Constructing a `Slack.OptionDataResponse` with a combination of `Slack.Option` and `Slack.OptionGroup` isn’t supported. If both are present in the `Slack.OptionDataResponse`, the UI doesn't update. ### OptionDataResponse Constructors The following are constructors for `OptionDataResponse`. #### OptionDataResponse(options) **Signature** ```java public OptionDataResponse(List options) ``` **Parameters** _options_ Type: List #### OptionDataResponse(optionGroups) **Signature** ```java public OptionDataResponse(List optionGroups) ``` **Parameters** _optionGroups_ Type: List ### OptionDataResponse Methods The following are methods for `OptionDataResponse`. #### getOptionGroups() **Signature** ```java public List getOptionGroups() ``` **Return Value** Type: List #### getOptions() **Signature** ```java public List getOptions() ``` **Return Value** Type: List --- ## OptionGroup Class Creates an option group for the [Select](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/elements.md#select) or [External Select](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/elements.md#external-select) component. For the External Select component, construct your data using `List` and return it using `Slack.OptionDataResponse`. Alternatively, specify the values or use an expression in the view definition for the [Select](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/elements.md#select) or [External Select](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/elements.md#external-select) component. ### Usage Use the `Slack.OptionGroup` class to build your option groups for the External Select component. See [Apex Data Providers for External Select Component](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/data-providers.md#apex-data-providers-for-external-select-component). Alternatively, construct your data using `List` for the Select component. ```java public class DataProviderOpportunityLookup { private static final String NO_OPPORTUNITY = 'Account has no Opportunity'; private static final String MISSING_OR_INCORRECT_ACCOUNT_ID = 'Account Id is missing or is incorrect'; public static List getOpportunitiesByStage(String accountId) { List opportunityOptionGroup; if (String.isNotBlank(accountId)) { List opportunities = queryOpportunities(accountId); opportunityOptionGroup = new List(); if (!opportunities.isEmpty()) { List newOptions = new List(); List inProgressOptions = new List(); List closedOptions = new List(); for (Opportunity opp : opportunities) { switch on opp.StageName { when 'New' { Slack.Option newOption = new Slack.Option(opp.Id, opp.Name); newOptions.add(newOption); } when 'In Progress' { Slack.Option inProgressOption = new Slack.Option(opp.Id, opp.Name); inProgressOptions.add(inProgressOption); } when 'Closed' { Slack.Option closedOption = new Slack.Option(opp.Id, opp.Name); closedOptions.add(closedOption); } } } Slack.OptionGroup newOptionGroup = new Slack.OptionGroup('New Opportunities', newOptions); opportunityOptionGroup.add(newOptionGroup); Slack.OptionGroup inProgressOptionGroup = new Slack.OptionGroup('In Progress Opportunities', inProgressOptions); opportunityOptionGroup.add(inProgressOptionGroup); Slack.OptionGroup closedOptionGroup = new Slack.OptionGroup('Closed Opportunities', closedOptions); opportunityOptionGroup.add(closedOptionGroup); } else { opportunityOptionGroup.add(getEmptyOptionGroup()); } } else { opportunityOptionGroup.add(getEmptyOptionGroup()); System.debug(MISSING_OR_INCORRECT_ACCOUNT_ID); } return opportunityOptionGroup; } } ``` See the [sample app](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/setup-install-app.md) for a full example. ### OptionGroup Constructor `OptionGroup` has the following constructor. #### OptionGroup(label, options) Creates an instance of the `Slack.OptionGroup` class with the label and options. **Signature** ```java public OptionGroup(String label, List options) ``` **Parameters** _label_ Type: String The text label for the option group. _options_ Type: List A list of options to choose from. ### OptionGroup Methods The following are methods for `OptionGroup`. #### getLabel() Gets the text label of the option group. **Signature** ```java public String getLabel() ``` **Return Type** Type: String #### getOptions() Gets the list of options. **Signature** ```java public List getOptions() ``` **Return Type** Type: List ## See Also [Apex Data Providers for External Select Component](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/data-providers.md#apex-data-providers-for-external-select-component). # Work with Paging Use the `Paging` class to work with paging information, such as pagination on a list of files matching a search query or a list of access log entries. ## Paging Class Represents paging information, such as the page of records returned from a search query. Use `Paging` with [`SearchResult`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_search.md) to work with results returned from a search query. See [Slack's search.all method](https://api.slack.com/methods/search.all). ### Paging Methods The following are methods for `Paging`. #### getCount() Gets the number of records per page. **Signature** ```java public Integer getCount() ``` **Return Value** Type: Integer #### getIid() **Signature** ```java public String getIid() ``` **Return Value** Type: String #### getPage() Gets the page of records returned. **Signature** ```java public Integer getPage() ``` **Return Value** Type: Integer #### getPages() Gets the total number of pages matching the query. **Signature** ```java public Integer getPages() ``` **Return Value** Type: Integer #### getPerPage() **Signature** ```java public Integer getPerPage() ``` **Return Value** Type: Integer #### getSpill() **Signature** ```java public Integer getSpill() ``` **Return Value** Type: Integer #### getTotal() **Signature** ```java public Integer getTotal() ``` **Return Value** Type: Integer #### setCount(count) **Signature** ```java public void setCount(Integer count) ``` **Parameters** _count_ Type: Integer **Return Value** Type: void #### setIid(iid) **Signature** ```java public void setIid(String iid) ``` **Parameters** _iid_ Type: String **Return Value** Type: void #### setPage(page) **Signature** ```java public void setPage(Integer page) ``` **Parameters** _page_ Type: Integer **Return Value** Type: void #### setPages(pages) **Signature** ```java public void setPages(Integer pages) ``` **Parameters** _pages_ Type: Integer **Return Value** Type: void #### setPerPage(perPage) **Signature** ```java public void setPerPage(Integer perPage) ``` **Parameters** _perPage_ Type: Integer **Return Value** Type: void #### setSpill(spill) **Signature** ```java public void setSpill(Integer spill) ``` **Parameters** _spill_ Type: Integer **Return Value** Type: void #### setTotal(total) **Signature** ```java public void setTotal(Integer total) ``` **Parameters** _total_ Type: Integer **Return Value** Type: void # Work with Pins The following are Apex classes for the Slack `pins` [API methods](https://api.slack.com/methods?filter=pins). ## PinsAddRequest Class Sends a request to pin an item to a channel. **Usage** See Slack’s [pins.add method](https://api.slack.com/methods/pins.add). ### PinsAddRequest Methods The following are methods for `PinsAddRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.PinsAddRequest.Builder builder() ``` **Return Value** Type: Slack.PinsAddRequest.Builder --- ## PinsAddRequest.Builder Class Contains methods to build an instance of the `Slack.PinsAddRequest` class. A Builder object is obtained by invoking one of the `PinsAddRequest.builder` methods defined by the `PinsAddRequest` class. ### PinsAddRequest.Builder Methods The following are methods for `PinsAddRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of `Slack.PinsAddRequest`. **Signature** ```java public Slack.PinsAddRequest build() ``` **Return Value** Type: Slack.PinsAddRequest #### channel(channel) Required. The channel to pin the message to. **Signature** ```java public Slack.PinsAddRequest.Builder channel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: Slack.PinsAddRequest.Builder #### file(file) **Signature** ```java public Slack.PinsAddRequest.Builder file(String file) ``` **Parameters** _file_ Type: String **Return Value** Type: Slack.PinsAddRequest.Builder #### fileComment(fileComment) **Signature** ```java public Slack.PinsAddRequest.Builder fileComment(String fileComment) ``` **Parameters** _fileComment_ Type: String **Return Value** Type: Slack.PinsAddRequest.Builder #### timestamp(timestamp) Required. The timestamp for the message pinned within the conversation. **Signature** ```java public Slack.PinsAddRequest.Builder timestamp(String timestamp) ``` **Parameters** _timestamp_ Type: String **Return Value** Type: Slack.PinsAddRequest.Builder --- ## PinsAddResponse Class Pins an item to a channel. **Usage** See Slack’s [pins.add method](https://api.slack.com/methods/pins.add). ### PinsAddResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `PinsAddResponse`. #### getResponseMetadata() **Signature** ```java public Slack.ErrorResponseMetadata getResponseMetadata() ``` **Return Value** Type: [Slack.ErrorResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#errorresponsemetadata-class) #### setResponseMetadata(responseMetadata) **Signature** ```java public void setResponseMetadata(Slack.ErrorResponseMetadata responseMetadata) ``` **Parameters** _responseMetadata_ Type: [Slack.ErrorResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#errorresponsemetadata-class) **Return Value** Type: void --- ## PinsListRequest Class Sends a request to list items that are pinned to a channel. **Usage** See Slack’s [pins.list method](https://api.slack.com/methods/pins.list). ### PinsListRequest Methods The following are methods for `PinsListRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.PinsListRequest.Builder builder() ``` **Return Value** Type: Slack.PinsListRequest.Builder --- ## PinsListRequest.Builder Class Contains methods to build an instance of the `Slack.PinsListRequest` class. A Builder object is obtained by invoking one of the `PinsListRequest.builder` methods defined by the `PinsListRequest` class. ### PinsListRequestBuilder Methods The following are methods for `PinsListRequest.Builder`. #### build() Required. Returns an instance of `Slack.PinsListRequest`. **Signature** ```java public Slack.PinsListRequest build() ``` **Return Value** Type: Slack.PinsListRequest #### channel(channel) Required. The channel to get pinned items for. **Signature** ```java public Slack.PinsListRequest.Builder channel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: Slack.PinsListRequest.Builder --- ## PinsListResponse Class Lists items that are pinned to a channel. **Usage** See Slack’s [pins.list method](https://api.slack.com/methods/pins.list). ### PinsListResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `PinsListResponse`. #### getItems() **Signature** ```java public List getItems() ``` **Return Value** Type: List #### setItems(items) **Signature** ```java public void setItems(List items) ``` **Parameters** _items_ Type: List **Return Value** Type: void --- ## PinsListResponse.MessageItem Class Contains methods to build an instance of the `Slack.PinsListResponse` class. ### PinsListResponse.MessageItem Methods The following are methods for `PinsListResponse.MessageItem`. #### getChannel() **Signature** ```java public String getChannel() ``` **Return Value** Type: String #### getCreatedBy() **Signature** ```java public String getCreatedBy() ``` **Return Value** Type: String #### getComment() **Signature** ```java public Slack.FileComment getComment() ``` **Return Value** Type: Slack.FileComment #### getFile() **Signature** ```java public Slack.File getFile() ``` **Return Value** Type: Slack.File #### getMessage() **Signature** ```java public Slack.Message getMessage() ``` **Return Value** Type: [Slack.Message](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_messages.md) #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### setChannel(channel) **Signature** ```java public void setChannel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: void #### setComment(comment) **Signature** ```java public void setComment(Slack.FileComment comment) ``` **Parameters** _comment_ Type: Slack.FileComment **Return Value** Type: void #### setCreated(created) **Signature** ```java public void setCreated(Integer created) ``` **Parameters** _created_ Type: Integer **Return Value** Type: void #### setCreatedBy(createdBy) **Signature** ```java public void setCreatedBy(String createdBy) ``` **Parameters** _createdBy_ Type: String **Return Value** Type: void #### setFile(file) **Signature** ```java public void setFile(Slack.File file) ``` **Parameters** _file_ Type: Slack.File **Return Value** Type: void #### setMessage(message) **Signature** ```java public void setMessage(Slack.Message message) ``` **Parameters** _message_ Type: [Slack.Message](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_messages.md) **Return Value** Type: void #### setType(type) **Signature** ```java public void setType(String type) ``` **Parameters** _type_ Type: String **Return Value** Type: void --- ## PinsRemoveRequest Class Sends a request to unpin an item from a channel. **Usage** See Slack’s [pins.remove method](https://api.slack.com/methods/pins.remove). ### PinsRemoveRequest Methods The following are methods for `PinsRemoveRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.PinsRemoveRequest.Builder builder() ``` **Return Value** Type: Slack.PinsRemoveRequest.Builder --- ## PinsRemoveRequest.Builder Class Contains methods to build an instance of the `Slack.PinsRemoveRequest` class. A Builder object is obtained by invoking one of the `PinsRemoveRequest.builder` methods defined by the `PinsRemoveRequest` class. ### PinsRemoveRequest.Builder Methods The following are methods for `PinsRemoveRequest.Builder`. #### build() Required. Returns an instance of `Slack.PinsRemoveRequest`. **Signature** ```java public Slack.PinsRemoveRequest build() ``` **Return Value** Type: Slack.PinsRemoveRequest #### channel(channel) Required. The channel where the item is pinned to. **Signature** ```java public Slack.PinsRemoveRequest.Builder channel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: Slack.PinsRemoveRequest.Builder #### file(file) Required if `fileComment(fileComment)` or `timestamp(timestamp)` is not used. **Signature** ```java public Slack.PinsRemoveRequest.Builder file(String file) ``` **Parameters** _file_ Type: String **Return Value** Type: Slack.PinsRemoveRequest.Builder #### fileComment(fileComment) Required if `file(file)` or `timestamp(timestamp)` is not used. **Signature** ```java public Slack.PinsRemoveRequest.Builder fileComment(String fileComment) ``` **Parameters** _fileComment_ Type: String **Return Value** Type: Slack.PinsRemoveRequest.Builder #### timestamp(timestamp) Required if `file(file)` or `fileComment(fileComment)` is not used. Timestamp of the message to unpin. **Signature** ```java public Slack.PinsRemoveRequest.Builder timestamp(String timestamp) ``` **Parameters** _timestamp_ Type: String **Return Value** Type: Slack.PinsRemoveRequest.Builder --- ## PinsRemoveResponse Class Unpins an item to a channel. **Usage** See Slack’s [pins.remove method](https://api.slack.com/methods/pins.remove). ### PinsRemoveResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). # Work with Purposes Use the `Purpose` class to work with purposes for a channel or conversation. ## Purpose Class ### Purpose Methods The following are methods for `Purpose`. #### getCreator() **Signature** ```java public String getCreator() ``` **Return Value** Type: String #### getLastSet() **Signature** ```java public Integer getLastSet() ``` **Return Value** Type: Integer #### getValue() **Signature** ```java public String getValue() ``` **Return Value** Type: String #### setCreator(creator) **Signature** ```java public void setCreator(String creator) ``` **Parameters** _creator_ Type: String **Return Value** Type: void #### setLastSet(lastSet) **Signature** ```java public void setLastSet(Integer lastSet) ``` **Parameters** _lastSet_ Type: Integer **Return Value** Type: void #### setValue(value) **Signature** ```java public void setValue(String value) ``` **Parameters** _value_ Type: String **Return Value** Type: void # Work with Reactions The following are Apex classes for the Slack `reactions` [API methods](https://api.slack.com/methods?filter=reactions). ## Reaction Class Represents a Reaction. ### Reaction Methods The following are methods for `Reaction`. #### getCount() **Signature** ```java public Integer getCount() ``` **Return Value** Type: Integer #### getName() **Signature** ```java public String getName() ``` **Return Value** Type: String #### getUrl() **Signature** ```java public String getUrl() ``` **Return Value** Type: String #### getUsers() **Signature** ```java public List getUsers() ``` **Return Value** Type: List\ #### setCount(count) **Signature** ```java public void setCount(Integer count) ``` **Parameters** _count_ Type: Integer **Return Value** Type: void #### setName(name) **Signature** ```java public void setName(String name) ``` **Parameters** _name_ Type: String **Return Value** Type: void #### setUrl(url) **Signature** ```java public void setUrl(String url) ``` **Parameters** _url_ Type: String **Return Value** Type: void #### setUsers(users) **Signature** ```java public void setUsers(List users) ``` **Parameters** _users_ Type: List\ **Return Value** Type: void ## ReactionsAddRequest Class Sends a request to add a reaction to an item. **Usage** See Slack’s [reactions.add method](https://api.slack.com/methods/reactions.add). ### ReactionsAddRequest Methods The following are methods for `ReactionsAddRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.ReactionsAddRequest.Builder builder() ``` ## ReactionsAddRequest.Builder Class Contains methods to build an instance of the `Slack.ReactionsAddRequest` class. A Builder object is obtained by invoking one of the `ReactionsAddRequest.builder` methods defined by the `ReactionsAddRequest` class. ### ReactionsAddRequest.Builder Methods The following are methods for `ReactionsAddRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of `Slack.ReactionsAddRequest`. **Signature** ```java public Slack.ReactionsAddRequest build() ``` **Return Value** Type: Slack.ReactionsAddRequest #### channel(channel) Required. The channel where the message to add reaction to was posted. **Signature** ```java public Slack.ReactionsAddRequest.Builder channel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: Slack.ReactionsAddRequest.Builder #### file(file) **Signature** ```java public Slack.ReactionsAddRequest.Builder file(String file) ``` **Parameters** _file_ Type: String **Return Value** Type: Slack.ReactionsAddRequest.Builder #### fileComment(fileComment) **Signature** ```java public Slack.ReactionsAddRequest.Builder fileComment(String fileComment) ``` **Parameters** _fileComment_ Type: String **Return Value** Type: Slack.ReactionsAddRequest.Builder #### name(name) Required. The reaction (emoji) name. **Signature** ```java public Slack.ReactionsAddRequest.Builder name(String name) ``` **Parameters** _name_ Type: String **Return Value** Type: Slack.ReactionsAddRequest.Builder #### timestamp(timestamp) Required. The timestamp of the message to add reaction to. **Signature** ```java public Slack.ReactionsAddRequest.Builder timestamp(String timestamp) ``` **Parameters** _timestamp_ Type: String --- ## ReactionsAddResponse Class Adds a reaction to an item. **Usage** See Slack’s [reactions.add method](https://api.slack.com/methods/reactions.add). ### ReactionsAddResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). --- ## ReactionsGetRequest Class Sends a request to get reactions for an item. **Usage** See Slack’s [reactions.get method](https://api.slack.com/methods/reactions.get). In this example, the `ReactionsGetShortcutDispatcher` action runs when a user initiates your shortcut. It uses the `ReactionsGetRequest` class to parse the response in the view, displaying the message text and the number of reactions to it. ```java public class ReactionsGetShortcutDispatcher extends Slack.ShortcutDispatcher { public override Slack.ActionHandler invoke(Slack.ShortcutParameters parameters, Slack.RequestContext context) { return Slack.ActionHandler.Modal(new Handler(parameters, context), 'Reactions Get'); } public class Handler implements Slack.ModalHandler { Slack.ShortcutParameters parameters; Slack.RequestContext context; public Handler(Slack.ShortcutParameters parameters, Slack.RequestContext context) { this.parameters = parameters; this.context = context; } public Slack.ModalView call() { //name must match the DeveloperName of your SlackApp. Slack.App app = Slack.App.MySlackApp.get(); Slack.BotClient botClient = app.getBotClientForTeam(context.getTeamId()); Slack.ReactionsGetRequest req = new Slack.ReactionsGetRequest.builder() .channel(context.getChannelId()) .timestamp(context.getMessageContext().getTs()) .build(); Slack.ReactionsGetResponse response = BotClient.reactionsGet(req); Slack.ViewReference viewReference; if(response.getError() != null) { System.debug(response.getError()); viewReference = Slack.View.message_modal.get(); viewReference.setParameter('title', 'Shortcut error'); viewReference.setParameter('message', 'The shortcut failed with the error ' + response.getError() + '. Make sure you are using the shortcut in a channel where the bot for the current app is a member.'); } else { String messageText = response.getMessage().getText(); List reactions = response.getMessage().getReactions(); Integer reactionsCount = reactions != null ? reactions.size() : 0; viewReference = Slack.View.message_reactions.get(); viewReference.setParameter('messageText', messageText); viewReference.setParameter('reactionsCount', reactionsCount); } Slack.ModalView modalView = new Slack.ModalView.builder() .viewReference(viewReference) .build(); return modalView; } } } ``` The `message_reactions` view looks like this. ```yaml description: "This modal displays message text and reactions to it. It is meant to be used with the ReactionsGet api method." schema: properties: messageText: type: string required: true reactionsCount: type: number required: true components: - definition: modal properties: title: "View Message Reactions" components: - definition: section properties: text: text: "The following message has a reaction count of {!view.properties.reactionsCount}" type: "mrkdwn" - definition: section properties: text: text: "{!view.properties.messageText}" type: "mrkdwn" ``` See the [sample app](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/setup-install-app.md) for more information. ### ReactionsGetRequest Methods The following are methods for `ReactionsGetRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.ReactionsGetRequest.Builder builder() ``` **Return Value** Type: Slack.ReactionsGetRequest.Builder --- ## ReactionsGetRequest.Builder Class Contains methods to build an instance of the `Slack.ReactionsGetRequest` class. A Builder object is obtained by invoking one of the `ReactionsGetRequest.builder` methods defined by the `ReactionsGetRequest` class. ### ReactionsGetRequest.Builder Methods The following are methods for `ReactionsGetRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of `Slack.ReactionsGetRequest`. **Signature** ```java public Slack.ReactionsGetRequest build() ``` **Return Value** Type: Slack.ReactionsGetRequest #### channel(channel) The channel where the message to get reactions for was posted. **Signature** ```java public Slack.ReactionsGetRequest.Builder channel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: Slack.ReactionsGetRequest.Builder #### file(file) The file to get reactions for. **Signature** ```java public Slack.ReactionsGetRequest.Builder file(String file) ``` **Parameters** _file_ Type: String **Return Value** Type: Slack.ReactionsGetRequest.Builder #### fileComment(fileComment) The file comment to get reactions for. **Signature** ```java public Slack.ReactionsGetRequest.Builder fileComment(String fileComment) ``` **Parameters** _fileComment_ Type: String **Return Value** Type: Slack.ReactionsGetRequest.Builder #### full(full) Specifies whether to return the complete reaction list. **Signature** ```java public Slack.ReactionsGetRequest.Builder full(Boolean full) ``` **Parameters** _full_ Type: Boolean If true, always return the complete reaction list. **Return Value** Type: Slack.ReactionsGetRequest.Builder #### timestamp(timestamp) **Signature** ```java public Slack.ReactionsGetRequest.Builder timestamp(String timestamp) ``` **Parameters** _timestamp_ Type: String **Return Value** Type: Slack.ReactionsGetRequest.Builder --- ## ReactionsGetResponse Class Gets reactions for an item. **Usage** See Slack’s [reactions.get method](https://api.slack.com/methods/reactions.get). ### ReactionsGetResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `ReactionsGetResponse`. #### getMessage() **Signature** ```java public Slack.ReactionsGetResponse.Message getMessage() ``` **Return Value** Type: Slack.ReactionsGetResponse.Message #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### setChannel(channel) Sets the channel where the message to get reactions for was posted. **Signature** ```java public void setChannel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: void #### setMessage(message) **Signature** ```java public void setMessage(Slack.ReactionsGetResponse.Message message) ``` **Parameters** _message_ Type: Slack.ReactionsGetResponse.Message #### setType(type) **Signature** ```java public void setType(String type) ``` **Parameters** _type_ Type: String **Return Value** Type: void --- ## ReactionsGetResponse.Message Class ### ReactionsGetResponse.Message Methods The following are methods for `ReactionsGetResponse.Message`. #### getBotId() **Signature** ```java public String getBotId() ``` **Return Value** Type: String #### getBotProfile() **Signature** ```java public Slack.BotProfile getBotProfile() ``` **Return Value** Type: [Slack.BotProfile](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_bot.md#botprofile-class) #### getPermalink() **Signature** ```java public String getPermalink() ``` **Return Value** Type: String #### getReactions() **Signature** ```java public List getReactions() ``` **Return Value** Type: List #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getTeam() **Signature** ```java public String getTeam() ``` **Return Value** Type: String #### getText() **Signature** ```java public String getText() ``` **Return Value** Type: String #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### getUsername() **Signature** ```java public String getUsername() ``` **Return Value** Type: String #### setBotId(botId) **Signature** ```java public void setBotId(String botId) ``` **Parameters** _botId_ Type: String **Return Value** Type: void #### setBotProfile(botProfile) **Signature** ```java public void setBotProfile(Slack.BotProfile botProfile) ``` **Parameters** _botProfile_ Type: [Slack.BotProfile](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_bot.md#botprofile-class) **Return Value** Type: void #### setPermalink(permalink) **Signature** ```java public void setPermalink(String permalink) ``` **Parameters** _permalink_ Type: String **Return Value** Type: void #### setReactions(reactions) **Signature** ```java public void setReactions(List reactions) ``` **Parameters** _reactions_ Type: List **Return Value** Type: void #### setSubtype(subtype) **Signature** ```java public void setSubtype(String subtype) ``` **Parameters** _subtype_ Type: String **Return Value** Type: void #### setTeam(team) **Signature** ```java public void setTeam(String team) ``` **Parameters** _team_ Type: String #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void #### setType(type) **Signature** ```java public void setType(String type) ``` **Parameters** _type_ Type: String **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type String **Return Value** Type: void #### setUsername(username) **Signature** ```java public void setUsername(String username) ``` **Parameters** _username_ Type: String **Return Value** Type: void --- ## ReactionsListRequest Class Sends a request to list reactions made by a user. **Usage** See Slack's [reactions.list method](https://api.slack.com/methods/reactions.list). ### ReactionsListRequest Methods The following are methods for `ReactionsListRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.ReactionsListRequest.Builder builder() ``` **Return Value** Type: Slack.ReactionsListRequest.Builder --- ## ReactionsListRequest.Builder Class Contains methods to build an instance of the `Slack.ReactionsListRequest` class. A Builder object is obtained by invoking one of the `ReactionsListRequest.builder` methods defined by the `ReactionsListRequest` class. ### ReactionsListRequest.Builder Methods The following are methods for `ReactionsListRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of `Slack.ReactionsListRequest`. **Signature** ```java public Slack.ReactionsListRequest build() ``` **Return Value** Type: Slack.ReactionsListRequest #### count(count) **Signature** ```java public Slack.ReactionsListRequest.Builder count(Integer count) ``` **Parameters** _count_ Type: Integer **Return Value** Type: Slack.ReactionsListRequest.Builder #### full(full) **Signature** ```java public Slack.ReactionsListRequest.Builder full(Boolean full) ``` **Parameters** _full_ Type: Boolean **Return Value** Type: Slack.ReactionsListRequest.Builder #### limitValue(limitValue) **Signature** ```java public Slack.ReactionsListRequest.Builder limitValue(Integer limitValue) ``` **Parameters** _limitValue_ Type: Integer **Return Value** Type: [Slack.ReactionsListRequest.Builder](#reactionslistrequestbuilder-class) #### page(page) **Signature** ```java public Slack.ReactionsListRequest.Builder page(Integer page) ``` **Parameters** _page_ Type: Integer **Return Value** Type: Slack.ReactionsListRequest.Builder #### teamId(teamId) **Signature** ```java public Slack.ReactionsListRequest.Builder teamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: Slack.ReactionsListRequest.Builder #### user(user) **Signature** ```java public Slack.ReactionsListRequest.Builder user(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: Slack.ReactionsListRequest.Builder --- ## ReactionsListResponse Class Lists reactions made by a user. ### ReactionsListResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `ReactionsListResponse`. #### getItems() **Signature** ```java public List getItems() ``` **Return Value** Type: List #### getPaging() **Signature** ```java public Slack.Paging getPaging() ``` **Return Value** Type: [Slack.Paging](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_paging.md) #### setItems(items) **Signature** ```java public void setItems(List items) ``` **Parameters** _items_ Type: List **Return Value** Type: void #### setPaging(paging) **Signature** ```java public void setPaging(Slack.Paging paging) ``` **Parameters** _paging_ Type: [Slack.Paging](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_paging.md) --- ## ReactionsListReponse.Icons Class ### ReactionsListReponse.Icons Methods The following are methods for `ReactionsListResponse.Icons`. #### getImage36() **Signature** ```java public String getImage36() ``` **Return Value** Type: String #### getImage48() **Signature** ```java public String getImage48() ``` **Return Value** Type: String #### getImage64() **Signature** ```java public String getImage64() ``` **Return Value** Type: String #### getImage72() **Signature** ```java public String getImage72() ``` **Return Value** Type: String #### setImage36(image36) **Signature** ```java public void setImage36(String image36) ``` **Parameters** _image36_ Type: String **Return Value** Type: void #### setImage48(image48) **Signature** ```java public void setImage48(String image48) ``` **Parameters** _image48_ Type: String **Return Value** Type: void #### setImage64(image64) **Signature** ```java public void setImage64(String image64) ``` **Parameters** _image64_ Type: String **Return Value** Type: void #### setImage72(image72) **Signature** ```java public void setImage72(String image72) ``` **Parameters** _image72_ Type: String **Return Value** Type: void --- ## ReactionsListReponse.Item Class ### ReactionsListReponse.Item Methods The following are methods for `ReactionsListResponse.Item`. #### getChannel() **Signature** ```java public String getChannel() ``` **Return Value** Type: String #### getMessage() **Signature** ```java public Slack.ReactionsListResponse.Message getMessage() ``` **Return Value** Type: Slack.ReactionsListResponse.Message #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### setChannel(channel) **Signature** ```java public void setChannel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: void #### setMessage(message) **Signature** ```java public void setMessage(Slack.ReactionsListResponse.Message message) ``` **Parameters** _message_ Type: Slack.ReactionsListResponse.Message **Return Value** Type: void #### setType(type) **Signature** ```java public void setType(String type) ``` **Parameters** _type_ Type: String **Return Value** Type: void --- ## ReactionsListResponse.Message Class Represents a message in the response, which contains the channel ID for the message. **Usage** See Slack's [reactions.list method](https://api.slack.com/methods/reactions.list). ### ReactionsListResponse.Message Methods The following are methods for `ReactionsListResponse.Message`. #### getBotId() **Signature** ```java public String getBotId() ``` **Return Value** Type: String #### getBotProfile() **Signature** ```java public Slack.BotProfile getBotProfile() ``` **Return Value** Type: [Slack.BotProfile](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_bot.md#botprofile-class) #### getClientMsgId() **Signature** ```java public String getClientMsgId() ``` **Return Value** Type: String #### getFiles() **Signature** ```java public List getFiles() ``` **Return Value** Type: List<[Slack.File](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_files.md)> #### getIcons() **Signature** ```java public Slack.ReactionsListResponse.Icons getIcons() ``` **Return Value** Type: Slack.ReactionsListResponse.Icons #### getInviter() **Signature** ```java public String getInviter() ``` **Return Value** Type: String #### getLastRead() **Signature** ```java public String getLastRead() ``` **Return Value** Type: String #### getLatestReply() **Signature** ```java public String getLatestReply() ``` **Return Value** Type: String #### getParentUserId() **Signature** ```java public String getParentUserId() ``` **Return Value** Type: String #### getPermalink() **Signature** ```java public String getPermalink() ``` **Return Value** Type: String #### getReactions() **Signature** ```java public List getReactions() ``` **Return Value** Type: List #### getReplyCount() **Signature** ```java public Integer getReplyCount() ``` **Return Value** Type: Integer #### getReplyUsers() **Signature** ```java public List getReplyUsers() ``` **Return Value** Type: List\ #### getReplyUsersCount() **Signature** ```java public Integer getReplyUsersCount() ``` **Return Value** Type: Integer #### getSourceTeam() **Signature** ```java public String getSourceTeam() ``` **Return Value** Type: String #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getTeam() **Signature** ```java public String getTeam() ``` **Return Value** Type: String #### getText() **Signature** ```java public String getText() ``` **Return Value** Type: String #### getThreadTs() **Signature** ```java public String getThreadTs() ``` **Return Value** Type: String #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### getUsername() **Signature** ```java public String getUsername() ``` **Return Value** Type: String #### getUserProfile() **Signature** ```java public Slack.ReactionsListResponse.UserProfile getUserProfile() ``` **Return Value** Type: Slack.ReactionsListResponse.UserProfile #### getUserTeam() **Signature** ```java public String getUserTeam() ``` **Return Value** Type: String #### isDisplayAsBot() **Signature** ```java public Boolean isDisplayAsBot() ``` **Return Value** Type: Boolean #### isLocked() **Signature** ```java public Boolean isLocked() ``` **Return Value** Type: Boolean #### isSubscribed() **Signature** ```java public Boolean isSubscribed() ``` **Return Value** Type: Boolean #### isUpload() **Signature** ```java public Boolean isUpload() ``` **Return Value** Type: Boolean #### setBotId(botId) **Signature** ```java public void setBotId(String botId) ``` **Parameters** _botId_ Type: String **Return Value** Type: void #### setBotProfile(botProfile) **Signature** ```java public void setBotProfile(Slack.BotProfile botProfile) ``` **Parameters** _botProfile_ Type: [Slack.BotProfile](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_bot.md) **Return Value** Type: void #### setClientMsgId(clientMsgId) **Signature** ```java public void setClientMsgId(String clientMsgId) ``` **Parameters** _clientMsgId_ Type: String **Return Value** Type: void #### setDisplayAsBot(displayAsBot) **Signature** ```java public void setDisplayAsBot(Boolean displayAsBot) ``` **Parameters** _displayAsBot_ Type: Boolean **Return Value** Type: void #### setFiles(files) **Signature** ```java public void setFiles(List files) ``` **Parameters** _files_ Type: List<[Slack.File](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_files.md)> **Return Value** Type: void #### setIcons(icons) **Signature** ```java public void setIcons(Slack.ReactionsListResponse.Icons icons) ``` **Parameters** _icons_ Type: Slack.ReactionsListResponse.Icons **Return Value** Type: void #### setInviter(inviter) **Signature** ```java public void setInviter(String inviter) ``` **Parameters** _inviter_ Type: String **Return Value** Type: void #### setLastRead(lastRead) **Signature** ```java public void setLastRead(String lastRead) ``` **Parameters** _lastRead_ Type: String **Return Value** Type: void #### setLatestReply(latestReply) **Signature** ```java public void setLatestReply(String latestReply) ``` **Parameters** _latestReply_ Type: String **Return Value** Type: void #### setLocked(locked) **Signature** ```java public void setLocked(Boolean locked) ``` **Parameters** _locked_ Type: Boolean **Return Value** Type: void #### setParentUserId(parentUserId) **Signature** ```java public void setParentUserId(String parentUserId) ``` **Parameters** _parentUserId_ Type: String **Return Value** Type: void #### setPermalink(permalink) **Signature** ```java public void setPermalink(String permalink) ``` **Parameters** _permalink_ Type: String **Return Value** Type: void #### setReactions(reactions) **Signature** ```java public void setReactions(List reactions) ``` **Parameters** _reactions_ Type: List **Return Value** Type: void #### setReplyCount(replyCount) **Signature** ```java public void setReplyCount(Integer replyCount) ``` **Parameters** _replyCount_ Type: Integer **Return Value** Type: void #### setReplyUsers(replyUsers) **Signature** ```java public void setReplyUsers(List replyUsers) ``` **Parameters** _replyUsers_ Type: List\ **Return Value** Type: void #### setReplyUsersCount(replyUsersCount) **Signature** ```java public void setReplyUsersCount(Integer replyUsersCount) ``` **Parameters** _replyUsersCount_ Type: Integer **Return Value** Type: void #### setSourceTeam(sourceTeam) **Signature** ```java public void setSourceTeam(String sourceTeam) ``` **Parameters** _sourceTeam_ Type: String **Return Value** Type: void #### setSubscribed(subscribed) **Signature** ```java public void setSubscribed(Boolean subscribed) ``` **Parameters** _subscribed_ Type: Boolean **Return Value** Type: void #### setSubtype(subtype) **Signature** ```java public void setSubtype(String subtype) ``` **Parameters** _subtype_ Type: String **Return Value** Type: void #### setTeam(team) **Signature** ```java public void setTeam(String team) ``` **Parameters** _team_ Type: String **Return Value** Type: void #### setText(text) **Signature** ```java public void setText(String text) ``` **Parameters** _text_ Type: String **Return Value** Type: void #### setThreadTs(threadTs) **Signature** ```java public void setThreadTs(String threadTs) ``` **Parameters** _threadTs_ Type: String **Return Value** Type: void #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void #### setType(type) **Signature** ```java public void setType(String type) ``` **Parameters** _type_ Type: String **Return Value** Type: void #### setUpload(upload) **Signature** ```java public void setUpload(Boolean upload) ``` **Parameters** _upload_ Type: Boolean **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void #### setUsername(username) **Signature** ```java public void setUsername(String username) ``` **Parameters** _username_ Type: String **Return Value** Type: void #### setUserProfile(userProfile) **Signature** ```java public void setUserProfile(Slack.ReactionsListResponse.UserProfile userProfile) ``` **Parameters** _userProfile_ Type: Slack.ReactionsListResponse.UserProfile **Return Value** Type: void #### setUserTeam(userTeam) **Signature** ```java public void setUserTeam(String userTeam) ``` **Parameters** _userTeam_ Type: String **Return Value** Type: void --- ## ReactionsListResponse.MessageRootReply Class ### ReactionsListResponse.MessageRootReply Methods The following are methods for `ReactionsListResponse.MessageRootReply`. #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void --- ## ReactionsListResponse.UserProfile Class ### ReactionsListResponse.UserProfile Methods The following are methods for `ReactionsListResponse.UserProfile`. #### getAvatarHash() **Signature** ```java public String getAvatarHash() ``` **Return Value** Type: String #### getDisplayName() **Signature** ```java public String getDisplayName() ``` **Return Value** Type: String #### getFirstName() **Signature** ```java public String getFirstName() ``` **Return Value** Type: String #### getImage72() **Signature** ```java public String getImage72() ``` **Return Value** Type: String #### getName() **Signature** ```java public String getName() ``` **Return Value** Type: String #### getRealName() **Signature** ```java public String getRealName() ``` **Return Value** Type: String #### getTeam() **Signature** ```java public String getTeam() ``` **Return Value** Type: String #### isRestricted() **Signature** ```java public Boolean isRestricted() ``` **Return Value** Type: Boolean #### isUltraRestricted() **Signature** ```java public Boolean isUltraRestricted() ``` **Return Value** Type: Boolean #### setAvatarHash(avatarHash) **Signature** ```java public void setAvatarHash(String avatarHash) ``` **Parameters** _avatarHash_ Type: String **Return Value** Type: void #### setDisplayName(displayName) **Signature** ```java public void setDisplayName(String displayName) ``` **Parameters** _displayName_ Type: String **Return Value** Type: void #### setFirstName(firstName) **Signature** ```java public void setFirstName(String firstName) ``` **Parameters** _firstName_ Type: String **Return Value** Type: void #### setImage72(image72) **Signature** ```java public void setImage72(String image72) ``` **Parameters** _image72_ Type: String **Return Value** Type: void #### setName(name) **Signature** ```java public void setName(String name) ``` **Parameters** _name_ Type: String **Return Value** Type: void #### setRealName(realName) **Signature** ```java public void setRealName(String realName) ``` **Parameters** _realName_ Type: String **Return Value** Type: void #### setRestricted(restricted) **Signature** ```java public void setRestricted(Boolean restricted) ``` **Parameters** _restricted_ Type: Boolean **Return Value** Type: void #### setTeam(team) **Signature** ```java public void setTeam(String team) ``` **Parameters** _team_ Type: String **Return Value** Type: void #### setUltraRestricted(ultraRestricted) **Signature** ```java public void setUltraRestricted(Boolean ultraRestricted) ``` **Parameters** _ultraRestricted_ Type: Boolean **Return Value** Type: void --- ## ReactionsRemoveRequest Class Sends a request to remove a reaction from an item. **Usage** See Slack’s [reactions.remove method](https://api.slack.com/methods/reactions.remove). ### ReactionsRemoveRequest Methods The following are methods for `ReactionsRemoveRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.ReactionsRemoveRequest.Builder builder() ``` **Return Value** Type: Slack.ReactionsRemoveRequest.Builder --- ## ReactionsRemoveRequest.Builder Class Contains methods to build an instance of the `Slack.ReactionsRemoveRequest` class. A Builder object is obtained by invoking one of the `ReactionsRemoveRequest.builder` methods defined by the `ReactionsRemoveRequest` class. ### ReactionsRemoveRequest.Builder Methods The following are methods for `ReactionsRemoveRequest.Builder`. These methods are optional unless specified otherwise. One of `file(file)`, `fileComment(fileComment)`, or the combination of `channel(channel)` and `timestamp(timestamp)` must be specified. #### build() Required. Returns an instance of `Slack.ReactionsRemoveRequest`. **Signature** ```java public Slack.ReactionsRemoveRequest build() ``` **Return Value** Type: Slack.ReactionsRemoveRequest #### channel(channel) The channel where the message to remove reaction from was posted. **Signature** ```java public Slack.ReactionsRemoveRequest.Builder channel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: Slack.ReactionsRemoveRequest.Builder #### file(file) The file to remove reaction from. **Signature** ```java public Slack.ReactionsRemoveRequest.Builder file(String file) ``` **Parameters** _file_ Type: String **Return Value** Type: Slack.ReactionsRemoveRequest.Builder #### fileComment(fileComment) The file comment to get reactions for. **Signature** ```java public Slack.ReactionsRemoveRequest.Builder fileComment(String fileComment) ``` **Parameters** _fileComment_ Type: String **Return Value** Type: Slack.ReactionsRemoveRequest.Builder #### name(name) Required. The reaction (emoji) name. **Signature** ```java public Slack.ReactionsRemoveRequest.Builder full(Boolean full) ``` **Parameters** _name_ Type: String **Return Value** Type: Slack.ReactionsRemoveRequest.Builder #### timestamp(timestamp) Timestamp of the message to remove reaction from. **Signature** ```java public Slack.ReactionsRemoveRequest.Builder timestamp(String timestamp) ``` **Parameters** _timestamp_ Type: String **Return Value** Type: Slack.ReactionsRemoveRequest.Builder --- ## ReactionsRemoveResponse Class Removes a reaction from an item. **Usage** See Slack’s [reactions.remove method](https://api.slack.com/methods/reactions.remove). ### ReactionsRemoveResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). # Work with Reminders The following are Apex classes for the Slack `reminders` [API methods](https://api.slack.com/methods?filter=reminders). ## Reminder Class Represents a reminder. ### Reminder Methods. The following are methods for `Reminder`. #### getChannel()() **Signature** ```java public String getChannel() ``` **Return Value** Type: String #### getCompleteTs() **Signature** ```java public Integer getCompleteTs() ``` **Return Value** Type: Integer #### getCreator() **Signature** ```java public String getCreator() ``` **Return Value** Type: String #### getId() **Signature** ```java public String getId() ``` **Return Value** Type: String #### getItem() **Signature** ```java public Object getItem() ``` **Return Value** Type: Object #### getRecurrence() **Signature** ```java public Slack.Reminder.Recurrence getRecurrence() ``` **Return Value** Type: Slack.Reminder.Recurrence #### getText() **Signature** ```java public String getText() ``` **Return Value** Type: String #### getTime() **Signature** ```java public Integer getTime() ``` **Return Value** Type: Integer #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### isRecurring() **Signature** ```java public Boolean isRecurring() ``` **Return Value** Type: Boolean #### setChannel(channel) **Signature** ```java public void setChannel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: void #### setCompleteTs(completeTs) **Signature** ```java public void setCompleteTs(Integer completeTs) ``` **Parameters** _completeTs_ Type: Integer **Return Value** Type: void #### setCreator(creator) **Signature** ```java public void setCreator(String creator) ``` **Parameters** _creator_ Type: String **Return Value** Type: void #### setId(id) **Signature** ```java public void setId(String id) ``` **Parameters** _id_ Type: String **Return Value** Type: void #### setItem(item) **Signature** ```java public void setItem(Object item) ``` **Parameters** _item_ Type: Object **Return Value** Type: void #### setRecurrence(recurrence) **Signature** ```java public void setRecurrence(Slack.Reminder.Recurrence recurrence) ``` **Parameters** _recurrence_ Type: Slack.Reminder.Recurrence **Return Value** Type: void #### setRecurring(recurring) **Signature** ```java public void setRecurring(Boolean recurring) ``` **Parameters** _recurring_ Type: Boolean **Return Value** Type: void #### setText(text) **Signature** ```java public void setText(String text) ``` **Parameters** _text_ Type: String **Return Value** Type: void #### setTime(timeValue) **Signature** ```java public void setTime(Integer timeValue) ``` **Parameters** _timeValue_ Type: Integer **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void ## Reminder.Recurrence Class ### Reminder.Recurrence Methods The following are methods for `Reminder.Recurrence`. #### getFrequency() **Signature** ```java public String getFrequency() ``` **Return Value** Type: String #### getWeekdays() **Signature** ```java public List getWeekdays() ``` **Return Value** Type: List\ #### setFrequency(frequency) **Signature** ```java public void setFrequency(String frequency) ``` **Parameters** _frequency_ Type: String **Return Value** Type: void #### setWeekdays(weekdays) **Signature** ```java public void setWeekdays(List weekdays) ``` **Parameters** _weekdays_ Type: List\ **Return Value** Type: void ## RemindersAddRequest Class Sends a request to create a reminder. **Usage** See Slack’s [reminders.add method](https://api.slack.com/methods/reminders.add). ### RemindersAddRequest Methods The following are methods for `RemindersAddRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java static Slack.RemindersAddRequest.Builder builder() ``` **Return Value** Type: Slack.RemindersAddRequest.Builder ## RemindersAddRequest.Builder Class Contains methods to build an instance of the `Slack.RemindersAddRequest` class. A Builder object is obtained by invoking one of the `RemindersAddRequest.builder` methods defined by the `RemindersAddRequest` class. ### RemindersAddRequest.Builder Methods The following are methods for `RemindersAddRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of `Slack.RemindersAddRequest`. **Signature** ```java Slack.RemindersAddRequest build() ``` **Return Value** Type: Slack.RemindersAddRequest #### timeValue(timeValue) Required. The Unix timestamp for when this reminder should happen, up to five years from now. If within 24 hours, the number of seconds until the reminder. Or a natural language description (Ex. "in 15 minutes," or "every Thursday"). **Signature** ```java Slack.RemindersAddRequest.Builder timeValue(String timeValue) ``` **Parameters** _timeValue_ Type: String **Return Value** Type: Slack.RemindersAddRequest.Builder #### text(text) Required. The description of the reminder. **Signature** ```java Slack.RemindersAddRequest.Builder text(String text) ``` **Parameters** _text_ Type: String **Return Value** Type: Slack.RemindersAddRequest.Builder #### user(user) **Signature** ```java Slack.RemindersAddRequest.Builder user(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: Slack.RemindersAddRequest.Builder ## RemindersAddResponse Class Creates a reminder. **Usage** See Slack’s [reminders.add method](https://api.slack.com/methods/reminders.add). ### RemindersAddResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `RemindersAddResponse`. #### getReminder() **Signature** ```java public Slack.Reminder getReminder() ``` **Return Value** Type: Slack.Reminder #### setReminder(reminder) **Signature** ```java public void setReminder(Slack.Reminder reminder) ``` **Parameters** _reminder_ Type: Slack.Reminder **Return Value** Type: void ## RemindersCompleteRequest Class Sends a request to mark a reminder as complete. **Usage** See Slack’s [reminders.complete method](https://api.slack.com/methods/reminders.complete). ### RemindersCompleteRequest Methods The following are methods for `RemindersCompleteRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** public static Slack.RemindersCompleteRequest.Builder builder() **Return Value** Type: Slack.RemindersCompleteRequest.Builder ## RemindersCompleteRequest.Builder Class Contains methods to build an instance of the `Slack.RemindersCompleteRequest` class. A Builder object is obtained by invoking one of the `RemindersCompleteRequest.builder` methods defined by the `RemindersCompleteRequest` class. ### RemindersCompleteRequest.Builder Methods The following are methods for `RemindersCompleteRequest.Builder`. #### build() Required. Returns an instance of `Slack.RemindersCompleteRequest`. **Signature** ```java Slack.RemindersCompleteRequest build() ``` **Return Value** Type: Slack.RemindersCompleteRequest #### reminder(reminder) Required. The ID of the reminder to be marked as complete. **Signature** ```java Slack.RemindersCompleteRequest.Builder reminder(String reminder) ``` **Parameters** _reminder_ Type: String **Return Value** Type: Slack.RemindersCompleteRequest.Builder #### teamId(teamId) **Signature** ```java public Slack.RemindersCompleteRequest.Builder teamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: Slack.RemindersCompleteRequest.Builder ## RemindersCompleteResponse Class Marks a reminder as complete. **Usage** See Slack’s [reminders.complete method](https://api.slack.com/methods/reminders.complete). ### RemindersCompleteResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). ## RemindersDeleteRequest Class Sends a request to delete a reminder. **Usage** See Slack’s [reminders.delete method](https://api.slack.com/methods/reminders.delete). ### RemindersDeleteRequest Methods The following are methods for `RemindersDeleteRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java static Slack.RemindersDeleteRequest.Builder builder() ``` **Return Value** Type: Slack.RemindersDeleteRequest.Builder #### teamId(teamId) **Signature** ```java public Slack.RemindersCompleteRequest.Builder teamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: Slack.RemindersCompleteRequest.Builder ## RemindersDeleteRequest.Builder Class Contains methods to build an instance of the `Slack.RemindersDeleteRequest` class. A Builder object is obtained by invoking one of the `RemindersDeleteRequest.builder` methods defined by the `RemindersDeleteRequest` class. ### RemindersDeleteRequest.Builder Methods The following are methods for `RemindersDeleteRequest.Builder`. #### build() Required. Returns an instance of `Slack.RemindersDeleteRequest`. **Signature** ```java Slack.RemindersDeleteRequest build() ``` **Return Value** Type: Slack.RemindersDeleteRequest #### reminder(reminder) Required. The ID of the reminder. **Signature** ```java Slack.RemindersDeleteRequest.Builder reminder(String reminder) ``` **Parameters** _reminder_ Type: String **Return Value** Type: Slack.RemindersDeleteRequest.Builder ## RemindersDeleteResponse Class Deletes a reminder. **Usage** See Slack’s [reminders.delete method](https://api.slack.com/methods/reminders.delete). ### RemindersDeleteResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). ## RemindersInfoRequest Class Sends a request to get information about a reminder. **Usage** See Slack’s [reminders.info method](https://api.slack.com/methods/reminders.info). ### RemindersInfoRequest Methods The following are methods for `RemindersInfoRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java static Slack.RemindersInfoRequest.Builder builder() ``` **Return Value** Type: Slack.RemindersInfoRequest.Builder #### teamId(teamId) **Signature** ```java public Slack.RemindersCompleteRequest.Builder teamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: Slack.RemindersCompleteRequest.Builder ## RemindersInfoRequest.Builder Class Contains methods to build an instance of the `Slack.RemindersInfoRequest` class. A Builder object is obtained by invoking one of the `RemindersInfoRequest.builder` methods defined by the `RemindersInfoRequest` class. ### RemindersInfoRequest.Builder Methods The following are methods for `RemindersInfoRequest.Builder`. #### build() Required. Returns an instance of `Slack.RemindersInfoRequest`. **Signature** public Slack.RemindersInfoRequest build() **Return Value** Type: Slack.RemindersInfoRequest #### reminder(reminder) Required. The ID of the reminder. **Signature** ```java Slack.RemindersInfoRequest.Builder reminder(String reminder) ``` **Parameters** _reminder_ Type: String **Return Value** Type: Slack.RemindersInfoRequest.Builder ## RemindersInfoResponse Class Gets information about a reminder. **Usage** See Slack’s [reminders.info method](https://api.slack.com/methods/reminders.info). ### RemindersInfoResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `RemindersInfoResponse`. #### getReminder() **Signature** ```java public Slack.Reminder getReminder() ``` **Return Value** Type: Slack.Reminder #### setReminder(reminder) **Signature** ```java public void setReminder(Slack.Reminder reminder) ``` **Parameters** _reminder_ Type: Slack.Reminder **Return Value** Type: void ## RemindersListRequest Class Sends a request to list all reminders created by or for a given user. **Usage** See Slack’s [reminders.list method](https://api.slack.com/methods/reminders.list). ### RemindersListRequest Methods The following are methods for `RemindersListRequest`. #### builder() **Signature** ```java static Slack.RemindersListRequest.Builder builder() ``` **Return Value** Type: Slack.RemindersListRequest.Builder #### teamId(teamId) **Signature** ```java public Slack.RemindersCompleteRequest.Builder teamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: Slack.RemindersCompleteRequest.Builder ## RemindersListRequest.Builder Class Contains methods to build an instance of the `Slack.RemindersListRequest` class. A Builder object is obtained by invoking one of the `RemindersListRequest.builder` methods defined by the `RemindersListRequest` class. ### RemindersListRequest.Builder Methods The following are methods for `RemindersListRequest.Builder`. #### build() Required. Returns an instance of `Slack.RemindersListRequest`. **Signature** ```java Slack.RemindersListRequest build() ``` **Return Value** Type: Slack.RemindersListRequest ## RemindersListResponse Class Lists all reminders created by or for a given user. **Usage** See Slack’s [reminders.list method](https://api.slack.com/methods/reminders.list). ### RemindersListResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `RemindersListResponse`. #### getReminders() **Signature** ```java public List getReminders() ``` **Return Value** Type: List #### setReminders(reminders) **Signature** ```java public void setReminders(List reminders) ``` **Parameters** _reminders_ Type: List **Return Value** Type: void # Work with Requests The following are Apex classes for working with Slack actions. ## RequestContext Class Describes the context in which a particular Slack action is invoked. **Usage** `RequestContext` exposes information about the source of the action in Slack, performs custom logic, and obtains the correct Slack client to respond to Slack based on the request. Each action type receives different information in its `RequestContext`. ```java public override Slack.ActionHandler invoke(Map parameters, Slack.RequestContext context) { return Slack.ActionHandler.ack(new Handler(parameters, context)); ``` See [Shortcuts and Slash Commands](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/actions_interact.md). ### RequestContext Methods The following are methods for `RequestContext`. #### getActionPayload() Gets the action payload, such as the action name or type. **Signature** ```java public Slack.ActionPayload getActionPayload() ``` **Return Value** Type: Slack.ActionPayload #### getAppId() Gets the ID of the Slack app. **Signature** ```java public String getAppId() ``` **Return Value** Type: String #### getChannelId() Gets the channel ID. **Signature** ```java public String getChannelId() ``` **Return Value** Type: String #### getEnterpriseId() Gets the enterprise ID. See [Look for enterprise IDs](https://api.slack.com/enterprise/grid/developing#supporting-and-developing-apps-for-enterprise-grid__identifying-enterprise-grid-workspaces__look-for-enterprise-ids). **Signature** ```java public String getEnterpriseId() ``` **Return Value** Type: String #### getFormData() Gets the form field values from the modal view. **Signature** ```java public Map getFormData() ``` **Return Value** Type: Map #### getMessageContext() Gets the message context. **Signature** ```java public Slack.MessageContext getMessageContext() ``` **Return Value** Type: Slack.MessageContext #### getTeamId() **Signature** ```java public String getTeamId() ``` **Return Value** Type: String #### getTriggerId() **Signature** ```java public String getTriggerId() ``` **Return Value** Type: String #### getUserId() **Signature** ```java public String getUserId() ``` **Return Value** Type: String #### getViewContext() **Signature** ```java public Slack.ViewContext getViewContext() ``` **Return Value** Type: Slack.ViewContext --- ## RequestContext.Builder Class Contains methods to build an instance of the `Slack.RequestContext` class. A Builder object is obtained by invoking one of the `RequestContext.Builder` methods defined by the `RequestContext` class. ### RequestContext.Builder Methods The following are methods for `RequestContext.Builder`. #### actionPayload(actionPayload) **Signature** ```java public Slack.RequestContext.Builder actionPayload(Slack.ActionPayload actionPayload) ``` **Parameters** _actionPayload_ Type: Slack.ActionPayload **Return Value** Type: Slack.RequestContext.Builder #### appId(appId) **Signature** ```java public Slack.RequestContext.Builder appId(String appId) ``` **Parameters** _appId_ Type: String **Return Value** Type: Slack.RequestContext.Builder #### build() Returns an instance of the `Slack.RequestContext` object. **Signature** ```java public Slack.RequestContext build() ``` **Return Value** Type: Slack.RequestContext #### channelId(channelId) **Signature** ```java public Slack.RequestContext.Builder channelId(String channelId) ``` **Parameters** _channelId_ Type: String **Return Value** Type: Slack.RequestContext.Builder #### enterpriseId(enterpriseId) **Signature** ```java public Slack.RequestContext.Builder enterpriseId(String enterpriseId) ``` **Parameters** _enterpriseId_ Type: String **Return Value** Type: Slack.RequestContext.Builder #### formData(formData) **Signature** ```java public Slack.RequestContext.Builder formData(Map formData) ``` **Parameters** _formData_ Type: Map<String,Object> **Return Value** Type: Slack.RequestContext.Builder #### messageContext(messageContext) **Signature** ```java public Slack.RequestContext.Builder messageContext(Slack.MessageContext messageContext) ``` **Parameters** _messageContext_ Type: [Slack.MessageContext](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_message_context.md) **Return Value** Type: Slack.RequestContext.Builder #### teamId(teamId) **Signature** ```java public Slack.RequestContext.Builder teamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: Slack.RequestContext.Builder #### triggerId(triggerId) **Signature** ```java public Slack.RequestContext.Builder triggerId(String triggerId) ``` **Parameters** _triggerId_ Type: String **Return Value** Type: Slack.RequestContext.Builder #### userId(userId) **Signature** ```java public Slack.RequestContext.Builder userId(String userId) ``` **Parameters** _userId_ Type: String **Return Value** Type: Slack.RequestContext.Builder #### viewContext(viewContext) **Signature** ```java public Slack.RequestContext.Builder viewContext(Slack.ViewContext viewContext) ``` **Parameters** _viewContext_ Type: Slack.ViewContext **Return Value** Type: Slack.RequestContext.Builder # Work with Response Metadata The following are Apex classes to work with response metadata for errors and warnings. Slack returns response metadata as part of the Web API calls, which are helpful for debugging or error handling. Detailed errors and warnings are returned in the `messages` field in the response metadata. ## ResponseMetadata Class Represents response metadata from a Slack Web API call. ### Usage When receiving a response from Slack's API call, use `getResponseMetadata().getMessages()` to retrieve any error messages. This example shows how to retrieve the error messages from [`Slack.ChatPostMessageResponse`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_chat.md#chatpostmessageresponse-class). ```java Slack.ChatPostMessageRequest req = new Slack.ChatPostMessageRequest.builder() .channel((String) this.parameters.get('channelId')) .text('Details for record id' + recordId) .viewReference(viewReference) .build(); Slack.ChatPostMessageResponse response = userClient.ChatPostMessage(req); if (response.getError() != null) { System.debug(response.getResponseMetadata().getMessages()); } ``` ### ResponseMetadata Methods The following are methods for `ResponseMetadata`. #### getMessages() **Signature** ```java public List getMessages() ``` **Return Value** Type: List\ #### getNextCursor() Responses include the `next_cursor` value to navigate through additional results. See [Paginating through collections](https://api.slack.com/docs/pagination). **Signature** ```java public String getNextCursor() ``` **Return Value** Type: String #### getResponseMetadata() **Signature** ```java public Slack.ResponseMetadata getResponseMetadata() ``` **Return Value** Type: [Slack.ResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#responsemetadata-class) #### getWarnings() **Signature** ```java public List getWarnings() ``` **Return Value** Type: List\ #### setMessages(messages) **Signature** ```java public void setMessages(List messages) ``` **Parameters** _messages_ Type: List\ **Return Value** Type: void #### setNextCursor(nextCursor) **Signature** ```java public void setNextCursor(String nextCursor) ``` **Parameters** _messages_ Type: String **Return Value** Type: void #### ssetResponseMetadata(responseMetadata) **Signature** ```java public void setResponseMetadata(Slack.ResponseMetadata responseMetadata) ``` **Parameters** responseMetadata Type: [Slack.ResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#responsemetadata-class) **Return Value** Type: void #### setWarnings(warnings) **Signature** ```java public void setWarnings(List warnings) ``` **Parameters** _warnings_ Type: List\ **Return Value** Type: void ## ErrorResponseMetadata Class Represents response metadata for an error. ### ErrorResponseMetadata Methods The following are methods for `ErrorResponseMetadata`. #### getMessages() **Signature** ```java public List getMessages() ``` **Return Value** Type: List\ #### setMessages(messages) **Signature** ```java public void setMessages(List messages) ``` **Parameters** _messages_ Type: List\ **Return Value** Type: void ## WarningResponseMetadata Class Represents response metadata for a warning. ### WarningResponseMetadata Methods The following are methods for `WarningResponseMetadata`. #### getWarnings() **Signature** ```java public List getWarnings() ``` **Return Value** Type: List\ #### setWarnings(warnings) ```java public void setWarnings(List warnings) ``` **Parameters** _warnings_ Type: List\ **Return Value** Type: void # Work with Salesforce Orgs and Users Most businesses have multiple Salesforce orgs for specific purposes. Similarly, a Slack user can be on multiple workspaces and can have access to multiple Salesforce orgs. What does interacting with a Slack app look like for a user in a single workspace or multiple workspaces? An app can be installed in multiple workspaces for multiple users and connect to the same org. ![Multiple workspaces connecting to the same org](https://developer.salesforce.com/docs/media/multi1.png) Multiple apps installed in a workspace for multiple users can also connect to different orgs. ![Multiple workspaces connecting to different orgs](https://developer.salesforce.com/docs/media/multi2.png) **important:** Connecting a Slack app installed by multiple users in a workspace to different or multiple orgs isn't supported yet. You can build multiple Slack apps that all interact with the same managed package in the same namespace. You can have multiple SlackApp records in your package, but they must use unique developer names. # Work with Search The following are Apex classes for the Slack `search` [API methods](https://api.slack.com/methods?filter=search). ## MatchedItem Class Represents an item that matches a search query. ### MatchedItem Methods The following are methods for `MatchedItem`. #### getBotId() **Signature** ```java public String getBotId() ``` **Return Value** Type: String #### getCc() **Signature** ```java public List getCc() ``` **Return Value** Type: List #### getChannel() **Signature** ```java public Slack.Channel getChannel() ``` **Return Value** Type: [Slack.Channel](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_channels.md) #### getChannelActionsCount() **Signature** ```java public Integer getChannelActionsCount() ``` **Return Value** Type: Integer #### getChannelActionsTs() **Signature** ```java public String getChannelActionsTs() ``` **Return Value** Type: String #### getChannels() **Signature** ```java public List getChannels() ``` **Return Value** Type: List\ #### getComment() **Signature** ```java public String getComment() ``` **Return Value** Type: String #### getCreated() **Signature** ```java public String getCreated() ``` **Return Value** Type: String #### getDeanimateGif() **Signature** ```java public String getDeanimateGif() ``` **Return Value** Type: String #### getEditLink() **Signature** ```java public String getEditLink() ``` **Return Value** Type: String #### getEditor() **Signature** ```java public String getEditor() ``` **Return Value** Type: String #### getExternalId() **Signature** ```java public String getExternalId() ``` **Return Value** Type: String #### getExternalType() **Signature** ```java public String getExternalType() ``` **Return Value** Type: String #### getExternalUrl() **Signature** ```java public String getExternalUrl() ``` **Return Value** Type: String #### getFileId() **Signature** ```java public String getFileId() ``` **Return Value** Type: String #### getFiletype() **Signature** ```java public String getFiletype() ``` **Return Value** Type: String #### getFrom() **Signature** ```java public List getFrom() ``` **Return Value** Type: List #### getGroups() **Signature** ```java public List getGroups() ``` **Return Value** Type: List\ #### getId() The ID of the matching file item. **Signature** ```java public String getId() ``` **Return Value** Type: String #### getIid() Gets the ID of the matching message item. **Signature** ```java public String getIid() ``` **Return Value** Type: String #### getImageExifRotation() **Signature** ```java public Integer getImageExifRotation() ``` **Return Value** Type: Integer #### getIms() **Signature** ```java public List getIms() ``` **Return Value** Type: List\ #### getLastEditor() **Signature** ```java public String getLastEditor() ``` **Return Value** Type: String #### getLines() **Signature** ```java public Integer getLines() ``` **Return Value** Type: Integer #### getLinesMore() **Signature** ```java public Integer getLinesMore() ``` **Return Value** Type: Integer #### getMimetype() **Signature** ```java public String getMimetype() ``` **Return Value** Type: String #### getMode() **Signature** ```java public String getMode() ``` **Return Value** Type: String #### getName() **Signature** ```java public String getName() ``` **Return Value** Type: String #### getNext() **Signature** ```java public Slack.MatchedItem.OtherItem getNext() ``` **Return Value** Type: Slack.MatchedItem.OtherItem #### getNext2() **Signature** ```java public Slack.MatchedItem.OtherItem getNext2() ``` **Return Value** Type: Slack.MatchedItem.OtherItem #### getOriginalHeight() **Signature** ```java public String getOriginalHeight() ``` **Return Value** Type: String #### getOriginalWidth() **Signature** ```java public String getOriginalWidth() ``` **Return Value** Type: String #### getPermalink() **Signature** ```java public String getPermalink() ``` **Return Value** Type: String #### getPlainText() **Signature** ```java public String getPlainText() ``` **Return Value** Type: String #### getPrettyType() **Signature** ```java public String getPrettyType() ``` **Return Value** Type: String #### getPreview() **Signature** ```java public String getPreview() ``` **Return Value** Type: String #### getPreviewHighlight() **Signature** ```java public String getPreviewHighlight() ``` **Return Value** Type: String #### getPreviewPlainText() **Signature** ```java public String getPreviewPlainText() ``` **Return Value** Type: String #### getPrevious() **Signature** ```java public Slack.MatchedItem.OtherItem getPrevious() ``` **Return Value** Type: Slack.MatchedItem.OtherItem #### getPrevious2() **Signature** ```java public Slack.MatchedItem.OtherItem getPrevious2() ``` **Return Value** Type: Slack.MatchedItem.OtherItem #### getScore() **Signature** ```java public String getScore() ``` **Return Value** Type: String #### getSize() **Signature** ```java public Integer getSize() ``` **Return Value** Type: Integer #### getSourceTeam() **Signature** ```java public String getSourceTeam() ``` **Return Value** Type: String #### getSubject() **Signature** ```java public String getSubject() ``` **Return Value** Type: String #### getTeam() **Signature** ```java public String getTeam() ``` **Return Value** Type: String #### getText() **Signature** ```java public String getText() ``` **Return Value** Type: String #### getThumb64() **Signature** ```java public String getThumb64() ``` **Return Value** Type: String #### getThumb64Gif() **Signature** ```java public String getThumb64Gif() ``` **Return Value** Type: String #### getThumb64Height() **Signature** ```java public String getThumb64Height() ``` **Return Value** Type: String #### getThumb64Width() **Signature** ```java public String getThumb64Width() ``` **Return Value** Type: String #### getThumb80() **Signature** ```java public String getThumb80() ``` **Return Value** Type: String #### getThumb80Gif() **Signature** ```java public String getThumb80Gif() ``` **Return Value** Type: String #### getThumb80Height() **Signature** ```java public String getThumb80Height() ``` **Return Value** Type: String #### getThumb80Width() **Signature** ```java public String getThumb80Width() ``` **Return Value** Type: String #### getThumb160() **Signature** ```java public String getThumb160() ``` **Return Value** Type: String #### getThumb160Gif() **Signature** ```java public String getThumb160Gif() ``` **Return Value** Type: String #### getThumb160Height() **Signature** ```java public String getThumb160Height() ``` **Return Value** Type: String #### getThumb160Width() **Signature** ```java public String getThumb160Width() ``` **Return Value** Type: String #### getThumb360() **Signature** ```java public String getThumb360() ``` **Return Value** Type: String #### getThumb360Gif() **Signature** ```java public String getThumb360Gif() ``` **Return Value** Type: String #### getThumb360Height() **Signature** ```java public String getThumb360Height() ``` **Return Value** Type: String #### getThumb360Width() **Signature** ```java public String getThumb360Width() ``` **Return Value** Type: String #### getThumb480() **Signature** ```java public String getThumb480() ``` **Return Value** Type: String #### getThumb480Gif() **Signature** ```java public String getThumb480Gif() ``` **Return Value** Type: String #### getThumb480Height() **Signature** ```java public String getThumb480Height() ``` **Return Value** Type: String #### getThumb480Width() **Signature** ```java public String getThumb480Width() ``` **Return Value** Type: String #### getThumb720() **Signature** ```java public String getThumb720() ``` **Return Value** Type: String #### getThumb720Gif() **Signature** ```java public String getThumb720Gif() ``` **Return Value** Type: String #### getThumb720Height() **Signature** ```java public String getThumb720Height() ``` **Return Value** Type: String #### getThumb720Width() **Signature** ```java public String getThumb720Width() ``` **Return Value** Type: String #### getThumb800() **Signature** ```java public String getThumb800() ``` **Return Value** Type: String #### getThumb800Gif() **Signature** ```java public String getThumb800Gif() ``` **Return Value** Type: String #### getThumb800Height() **Signature** ```java public String getThumb800Height() ``` **Return Value** #### getThumb800Width() **Signature** ```java public String getThumb800Width() ``` **Return Value** Type: String #### getThumb960() **Signature** ```java public String getThumb960() ``` **Return Value** Type: String #### getThumb960Gif() **Signature** ```java public String getThumb960Gif() ``` **Return Value** Type: String #### getThumb960Height() **Signature** ```java public String getThumb960Height() ``` **Return Value** Type: String #### getThumb960Width() **Signature** ```java public String getThumb960Width() ``` **Return Value** Type: String #### getThumb1024() **Signature** ```java public String getThumb1024() ``` **Return Value** Type: String #### getThumb1024Gif() **Signature** ```java public String getThumb1024Gif() ``` **Return Value** Type: String #### getThumb1024Height() **Signature** ```java public String getThumb1024Height() ``` **Return Value** Type: String #### getThumb1024Width() **Signature** ```java public String getThumb1024Width() ``` **Return Value** Type: String #### getThumbPdf() **Signature** ```java public String getThumbPdf() ``` **Return Value** Type: String #### getThumbPdfHeight() **Signature** ```java public String getThumbPdfHeight() ``` **Return Value** Type: String #### getThumbPdfWidth() **Signature** ```java public String getThumbPdfWidth() ``` **Return Value** Type: String #### getThumbTiny() **Signature** ```java public String getThumbTiny() ``` **Return Value** Type: String #### getTimestamp() **Signature** ```java public String getTimestamp() ``` **Return Value** Type: String #### getTitle() **Signature** ```java public String getTitle() ``` **Return Value** Type: String #### getTo() **Signature** ```java public List getTo() ``` **Return Value** Type: List #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUpdated() **Signature** ```java public Integer getUpdated() ``` **Return Value** Type: Integer #### getUrlPrivate() **Signature** ```java public String getUrlPrivate() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### getUserTeam() **Signature** ```java public String getUsername() ``` **Return Value** Type: String #### getUsername() **Signature** ```java public String getUserTeam() ``` **Return Value** Type: String #### isDisplayAsBot() **Signature** ```java public Boolean isDisplayAsBot() ``` **Return Value** Type: Boolean #### isEditable() **Signature** ```java public Boolean isEditable() ``` **Return Value** Type: Boolean #### isExternal() **Signature** ```java public Boolean isExternal() ``` **Return Value** Type: Boolean #### isHasMore() **Signature** ```java public Boolean isHasMore() ``` **Return Value** Type: Booolean #### isHasRichPreview() **Signature** ```java public Boolean isHasRichPreview() ``` **Return Value** Type: Boolean #### isMpim() **Signature** ```java public Boolean isMpim() ``` **Return Value** Type: Boolean #### isNonOwnerEditable() **Signature** ```java public Boolean isNonOwnerEditable() ``` **Return Value** Type: Boolean #### isNoReactions() **Signature** ```java public Boolean isNoReactions() ``` **Return Value** Type: Boolean #### isPermalinkPublic() **Signature** ```java public Boolean isPermalinkPublic() ``` **Return Value** Type: Boolean #### isPreviewTruncated() **Signature** ```java public Boolean isPreviewTruncated() ``` **Return Value** Type: Boolean #### ispublic() **Signature** ```java public Boolean ispublic() ``` **Return Value** Type: Boolean #### isPublicUrlShared() **Signature** ```java public Boolean isPublicUrlShared() ``` **Return Value** Type: Boolean #### isSentToSelf() **Signature** ```java public Boolean isSentToSelf() ``` **Return Value** Type: Boolean #### isStarred() **Signature** ```java public Boolean isStarred() ``` **Return Value** Type: Boolean #### isTopFile() **Signature** ```java public Boolean isTopFile() ``` **Return Value** Type: Boolean #### isUrlPrivateDownload() **Signature** ```java public Boolean isUrlPrivateDownload() ``` **Return Value** Type: Boolean #### setBotId(botId) **Signature** ```java public void setBotId(String botId) ``` **Parameters** _botId_ Type: String **Return Value** Type: void #### setCc(cc) **Signature** ```java public void setCc(List cc) ``` **Parameters** _cc_ Type: List **Return Value** Type: void #### setChannel(channel) **Signature** ```java public void setChannel(Slack.Channel channel) ``` **Parameters** _channel_ Type: [Slack.Channel](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_channels.md) **Return Value** Type: void #### setChannelActionsCount(channelActionsCount) **Signature** ```java public void setChannelActionsCount(Integer channelActionsCount) ``` **Parameters** _channelActionsCount_ Type: Integer **Return Value** Type: void #### setChannelActionsTs(channelActionsTs) **Signature** ```java public void setChannelActionsTs(String channelActionsTs) ``` **Parameters** _channelActionsTs_ Type: String **Return Value** Type: void #### setChannels(channels) **Signature** ```java public void setChannels(List channels) ``` **Parameters** _channels_ Type: List\ **Return Value** Type: void #### setComment(comment) **Signature** ```java public void setComment(String comment) ``` **Parameters** _comment_ Type: String **Return Value** Type: void #### setCreated(created) **Signature** ```java public void setCreated(String created) ``` **Parameters** _created_ Type: String **Return Value** Type: void #### setDeanimateGif(deanimateGif) **Signature** ```java public void setDeanimateGif(String deanimateGif) ``` **Parameters** _deanimateGif_ Type: String **Return Value** Type: void #### setDisplayAsBot(displayAsBot) **Signature** ```java public void setDisplayAsBot(Boolean displayAsBot) ``` **Parameters** _displayAsBot_ Type: Boolean **Return Value** Type: void #### setEditable(editable) **Signature** ```java public void setEditable(Boolean editable) ``` **Parameters** _editable_ Type: Boolean **Return Value** Type: void #### setEditLink(editLink) **Signature** ```java public void setEditLink(String editLink) ``` **Parameters** _editLink_ Type: String **Return Value** Type: void #### setEditor(editor) **Signature** ```java public void setEditor(String editor) ``` **Parameters** _editor_ Type: String **Return Value** Type: void #### setExternal(external) **Signature** ```java public void setExternal(Boolean external) ``` **Parameters** _external_ Type: Boolean **Return Value** Type: void #### setExternalId(externalId) **Signature** ```java public void setExternalId(String externalId) ``` **Parameters** _externalId_ Type: String **Return Value** Type: void #### setExternalType(externalType) **Signature** ```java public void setExternalType(String externalType) ``` **Parameters** _externalType_ Type: String **Return Value** Type: void #### setExternalUrl(externalUrl) **Signature** ```java public void setExternalUrl(String externalUrl) ``` **Parameters** _externalUrl_ Type: String **Return Value** Type: void #### setFileId(fileId) **Signature** ```java public void setFileId(String fileId) ``` **Parameters** _fileId_ Type: String **Return Value** Type: void #### setFiletype(filetype) **Signature** ```java public void setFiletype(String filetype) ``` **Parameters** _filetype_ Type: String **Return Value** Type: void #### setFrom(fromValue) **Signature** ```java public void setFrom(List fromValue) ``` **Parameters** _fromValue_ Type: List **Return Value** Type: void #### setGroups(groups) **Signature** ```java public void setGroups(List groups) ``` **Parameters** _groups_ Type: List\ **Return Value** Type: void #### setHasMore(hasMore) **Signature** ```java public void setHasMore(Boolean hasMore) ``` **Parameters** _hasMore_ Type: Boolean **Return Value** Type: void #### setHasRichPreview(hasRichPreview) **Signature** ```java public void setHasRichPreview(Boolean hasRichPreview) ``` **Parameters** _hasRichPreview_ Type: Boolean **Return Value** Type: void #### setId(id) **Signature** ```java public void setId(String id) ``` **Parameters** _id_ Type: String **Return Value** Type: void #### setIid(iid) **Signature** ```java public void setIid(String iid) ``` **Parameters** _iid_ Type: String **Return Value** Type: void #### setImageExifRotation(imageExifRotation) **Signature** ```java public void setImageExifRotation(Integer imageExifRotation) ``` **Parameters** _imageExifRotation_ Type: Integer **Return Value** Type: void #### setIms(ims) **Signature** ```java public void setIms(List ims) ``` **Parameters** _ims_ Type: List\ **Return Value** Type: void #### setLastEditor(lastEditor) **Signature** ```java public void setLastEditor(String lastEditor) ``` **Parameters** _lastEditor_ Type: String **Return Value** Type: void #### setLines(lines) **Signature** ```java public void setLines(Integer lines) ``` **Parameters** _lines_ Type: Integer **Return Value** Type: void #### setLinesMore(linesMore) **Signature** ```java public void setLinesMore(Integer linesMore) ``` **Parameters** _linesMore_ Type: Integer **Return Value** Type: void #### setMimetype(mimetype) **Signature** ```java public void setMimetype(String mimetype) ``` **Parameters** _mimetype_ Type: mimetype **Return Value** Type: void #### setMode(mode) **Signature** ```java public void setMode(String mode) ``` **Parameters** _mode_ Type: String **Return Value** Type: void #### setMpim(mpim) **Signature** ```java public void setMpim(Boolean mpim) ``` **Parameters** _mpim_ Type: Boolean **Return Value** Type: void #### setName(name) **Signature** ```java public void setName(String name) ``` **Parameters** _name_ Type: String **Return Value** Type: void #### setNext(next) **Signature** ```java public void setNext(Slack.MatchedItem.OtherItem next) ``` **Parameters** _next_ Type: Slack.MatchedItem.OtherItem **Return Value** Type: void #### setNext2(next2) **Signature** ```java public void setNext2(Slack.MatchedItem.OtherItem next2) ``` **Parameters** _next2_ Type: Slack.MatchedItem.OtherItem **Return Value** Type: void #### setNonOwnerEditable(nonOwnerEditable) **Signature** ```java public void setNonOwnerEditable(Boolean nonOwnerEditable) ``` **Parameters** _nonOwnerEditable_ Type: Boolean **Return Value** Type: void #### setNoReactions(noReactions) **Signature** ```java public void setNoReactions(Boolean noReactions) ``` **Parameters** _noReactions_ Type: Boolean **Return Value** Type: void #### setOriginalHeight(originalHeight) **Signature** ```java public void setOriginalHeight(String originalHeight) ``` **Parameters** _originalHeight_ Type: String **Return Value** Type: void #### setOriginalWidth(originalWidth) **Signature** ```java public void setOriginalWidth(String originalWidth) ``` **Parameters** _originalWidth_ Type: String **Return Value** Type: void #### setPermalink(permalink) **Signature** ```java public void setPermalink(String permalink) ``` **Parameters** _permalink_ Type: String **Return Value** Type: void #### setPermalinkPublic(permalinkPublic) **Signature** ```java public void setPermalinkPublic(Boolean permalinkPublic) ``` **Parameters** _permalinkPublic_ Type: Boolean **Return Value** Type: void #### setPlainText(plainText) **Signature** ```java public void setPlainText(String plainText) ``` **Parameters** _plainText_ Type: String **Return Value** Type: void #### setPrettyType(prettyType) **Signature** ```java public void setPrettyType(String prettyType) ``` **Parameters** _prettyType_ Type: String **Return Value** Type: void #### setPreview(preview) **Signature** ```java public void setPreview(String preview) ``` **Parameters** _preview_ Type: String **Return Value** Type: void #### setPreviewHighlight(previewHighlight) **Signature** ```java public void setPreviewHighlight(String previewHighlight) ``` **Parameters** _previewHighlight_ Type: String **Return Value** Type: void #### setPreviewPlainText(previewPlainText) **Signature** ```java public void setPreviewPlainText(String previewPlainText) ``` **Parameters** _previewPlainText_ Type: String **Return Value** Type: void #### setPreviewTruncated(previewTruncated) **Signature** ```java public void setPreviewTruncated(Boolean previewTruncated) ``` **Parameters** _previewTruncated_ Type: Boolean **Return Value** Type: void #### setPrevious(previous) **Signature** ```java public void setPrevious(Slack.MatchedItem.OtherItem previous) ``` **Parameters** _previous_ Type: Slack.MatchedItem.OtherItem **Return Value** Type: void #### setPrevious2(previous2) **Signature** ```java public void setPrevious2(Slack.MatchedItem.OtherItem previous2) ``` **Parameters** _previous_ Type: Slack.MatchedItem.OtherItem **Return Value** Type: void #### setpublic(\_public) **Signature** ```java public void setpublic(Boolean _public) ``` **Parameters** _\_public_ Type: Boolean **Return Value** Type: void #### setPublicUrlShared(publicUrlShared) **Signature** ```java public void setPublicUrlShared(Boolean publicUrlShared) ``` **Parameters** _publicUrlShared_ Type: Boolean **Return Value** Type: void #### setScore(score) **Signature** ```java public void setScore(String score) ``` **Parameters** _score_ Type: String **Return Value** Type: void #### setSentToSelf(sentToSelf) **Signature** ```java public void setSentToSelf(Boolean sentToSelf) ``` **Parameters** _sentToSelf_ Type: Boolean **Return Value** Type: void #### setSize(size) **Signature** ```java public void setSize(Integer size) ``` **Parameters** _size_ Type: Integer **Return Value** Type: void #### setSourceTeam(sourceTeam) **Signature** ```java public void setSourceTeam(String sourceTeam) ``` **Parameters** _sourceTeam_ Type: String **Return Value** Type: void #### setStarred(starred) **Signature** ```java public void setStarred(Boolean starred) ``` **Parameters** _starred_ Type: Boolean **Return Value** Type: void #### setSubject(subject) **Signature** ```java public void setSubject(String subject) ``` **Parameters** _subject_ Type: String **Return Value** Type: void #### setTeam(team) **Signature** ```java public void setTeam(String team) ``` **Parameters** _team_ Type: String **Return Value** Type: void #### setText(text) **Signature** ```java public void setText(String text) ``` **Parameters** Type: String **Return Value** Type: void #### setThumb64(thumb64) **Signature** ```java public void setThumb64(String thumb64) ``` **Parameters** _thumb64_ Type: String **Return Value** Type: void #### setThumb64Gif(thumb64Gif) **Signature** ```java public void setThumb64Gif(String thumb64Gif) ``` **Parameters** _thumb64Gif_ Type: String **Return Value** Type: void #### setThumb64Height(thumb64Height) **Signature** ```java public void setThumb64Height(String thumb64Height) ``` **Parameters** _thumb64Height_ Type: String **Return Value** Type: void #### setThumb64Width(thumb64Width) **Signature** ```java public void setThumb64Width(String thumb64Width) ``` **Parameters** _thumb64Width_ Type: String **Return Value** Type: void #### setThumb80(thumb80) **Signature** ```java public void setThumb80(String thumb80) ``` **Parameters** _thumb80_ Type: String **Return Value** Type: void #### setThumb80Gif(thumb80Gif) **Signature** ```java public void setThumb80Gif(String thumb80Gif) ``` **Parameters** _thumb80Gif_ Type: String **Return Value** Type: void #### setThumb80Height(thumb80Height) **Signature** ```java public void setThumb80Height(String thumb80Height) ``` **Parameters** _thumb80Height_ Type: String **Return Value** Type: void #### setThumb80Width(thumb80Width) **Signature** ```java public void setThumb80Width(String thumb80Width) ``` **Parameters** _thumb80Width_ Type: String **Return Value** Type: void #### setThumb160(thumb160) **Signature** ```java public void setThumb160(String thumb160) ``` **Parameters** _thumb160_ Type: String **Return Value** Type: void #### setThumb160Gif(thumb160Gif) **Signature** ```java public void setThumb160Gif(String thumb160Gif) ``` **Parameters** _thumb160Gif_ Type: String **Return Value** Type: void #### setThumb160Height(thumb160Height) **Signature** ```java public void setThumb160Height(String thumb160Height) ``` **Parameters** _thumb160Height_ Type: String **Return Value** Type: void #### setThumb160Width(thumb160Width) **Signature** ```java public void setThumb160Width(String thumb160Width) ``` **Parameters** _thumb160Width_ Type: String **Return Value** Type: void #### setThumb360(thumb360) **Signature** ```java public void setThumb360(String thumb360) ``` **Parameters** _thumb360_ Type: String **Return Value** Type: void #### setThumb360Gif(thumb360Gif) **Signature** ```java public void setThumb360Gif(String thumb360Gif) ``` **Parameters** _thumb360Gif_ Type: String **Return Value** Type: void #### setThumb360Height(thumb360Height) **Signature** ```java public void setThumb360Height(String thumb360Height) ``` **Parameters** _thumb360Height_ Type: String **Return Value** Type: void #### setThumb360Width(thumb360Width) **Signature** ```java public void setThumb360Width(String thumb360Width) ``` **Parameters** _thumb360Width_ Type: String **Return Value** Type: void #### setThumb480(thumb480) **Signature** ```java public void setThumb480(String thumb480) ``` **Parameters** _thumb480_ Type: String **Return Value** Type: void #### setThumb480Gif(thumb480Gif) **Signature** ```java public void setThumb480Gif(String thumb480Gif) ``` **Parameters** _thumb480Gif_ Type: String **Return Value** Type: void #### setThumb480Height(thumb480Height) **Signature** ```java public void setThumb480Height(String thumb480Height) ``` **Parameters** _thumb480Height_ Type: String **Return Value** Type: void #### setThumb480Width(thumb480Width) **Signature** ```java public void setThumb480Width(String thumb480Width) ``` **Parameters** _thumb480Width_ Type: String **Return Value** Type: void #### setThumb720(thumb720) **Signature** ```java public void setThumb720(String thumb720) ``` **Parameters** _thumb720_ Type: String **Return Value** Type: void #### setThumb720Gif(thumb720Gif) **Signature** ```java public void setThumb720Gif(String thumb720Gif) ``` **Parameters** _thumb720Gif_ Type: String **Return Value** Type: void #### setThumb720Height(thumb720Height) **Signature** ```java public void setThumb720Height(String thumb720Height) ``` **Parameters** _thumb720Height_ Type: String **Return Value** Type: void #### setThumb720Width(thumb720Width) **Signature** ```java public void setThumb720Width(String thumb720Width) ``` **Parameters** _thumb720Width_ Type: String **Return Value** Type: void #### setThumb800(thumb800) **Signature** ```java public void setThumb800(String thumb800) ``` **Parameters** _thumb800_ Type: String **Return Value** Type: void #### setThumb800Gif(thumb800Gif) **Signature** ```java public void setThumb800Gif(String thumb800Gif) ``` **Parameters** _thumb800Gif_ Type: String **Return Value** Type: void #### setThumb800Height(thumb800Height) **Signature** ```java public void setThumb800Height(String thumb800Height) ``` **Parameters** _thumb800Height_ Type: String **Return Value** Type: void #### setThumb800Width(thumb800Width) **Signature** ```java public void setThumb800Width(String thumb800Width) ``` **Parameters** _thumb800Width_ Type: String **Return Value** Type: void #### setThumb960(thumb960) **Signature** ```java public void setThumb960(String thumb960) ``` **Parameters** _thumb960_ Type: String **Return Value** Type: void #### setThumb960Gif(thumb960Gif) **Signature** ```java public void setThumb960Gif(String thumb960Gif) ``` **Parameters** _thumb960Gif_ Type: String **Return Value** Type: void #### setThumb960Height(thumb960Height) **Signature** ```java public void setThumb960Height(String thumb960Height) ``` **Parameters** _thumb960Height_ Type: String **Return Value** Type: void #### setThumb960Width(thumb960Width) **Signature** ```java public void setThumb960Width(String thumb960Width) ``` **Parameters** _thumb960Width_ Type: String **Return Value** Type: void #### setThumb1024(thumb1024) **Signature** ```java public void setThumb1024(String thumb1024) ``` **Parameters** _thumb1024_ Type: String **Return Value** Type: void #### setThumb1024Gif(thumb1024Gif) **Signature** ```java public void setThumb1024Gif(String thumb1024Gif) ``` **Parameters** _thumb1024Gif_ Type: String **Return Value** Type: void #### setThumb1024Height(thumb1024Height) **Signature** ```java public void setThumb1024Height(String thumb1024Height) ``` **Parameters** _thumb1024Height_ Type: String **Return Value** Type: void #### setThumb1024Width(thumb1024Width) **Signature** ```java public void setThumb1024Width(String thumb1024Width) ``` **Parameters** _thumb1024Width_ Type: String **Return Value** Type: void #### setThumbPdf(thumbPdf) **Signature** ```java public void setThumbPdf(String thumbPdf) ``` **Parameters** _thumbPdf_ Type: String **Return Value** Type: void #### setThumbPdfHeight(thumbPdfHeight) **Signature** ```java public void setThumbPdfHeight(String thumbPdfHeight) ``` **Parameters** _thumbPdfHeight_ Type: String **Return Value** Type: void #### setThumbPdfWidth(thumbPdfWidth) **Signature** ```java public void setThumbPdfWidth(String thumbPdfWidth) ``` **Parameters** _thumbPdfWidth_ Type: String **Return Value** Type: void #### setThumbTiny(thumbTiny) **Signature** ```java public void setThumbTiny(String thumbTiny) ``` **Parameters** _thumbTiny_ Type: String **Return Value** Type: void #### setTimestamp(timestamp) **Signature** ```java public void setTimestamp(String timestamp) ``` **Parameters** _timestamp_ Type: String **Return Value** Type: void #### setTitle(title) **Signature** ```java public void setTitle(String title) ``` **Parameters** _title_ Type: String **Return Value** Type: void #### setTo(to) **Signature** ```java public void setTo(List to) ``` **Parameters** _to_ Type: List **Return Value** Type: void #### setTopFile(topFile) **Signature** ```java public void setTopFile(Boolean topFile) ``` **Parameters** _topFile_ Type: Boolean **Return Value** Type: void #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void #### setType(type) **Signature** ```java public void setType(String type) ``` **Parameters** _type_ Type: String **Return Value** Type: void #### setUpdated(updated) **Signature** ```java public void setUpdated(Integer updated) ``` **Parameters** _updated_ Type: Integer **Return Value** Type: void #### setUrlPrivate(urlPrivate) **Signature** ```java public void setUrlPrivate(String urlPrivate) ``` **Parameters** _urlPrivate_ Type: String **Return Value** Type: void #### setUrlPrivateDownload(urlPrivateDownload) **Signature** ```java public void setUrlPrivateDownload(Boolean urlPrivateDownload) ``` **Parameters** _urlPrivateDownload_ Type: Boolean **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void #### setUsername(username) **Signature** ```java public void setUsername(String username) ``` **Parameters** _username_ Type: String **Return Value** Type: void #### setUserTeam(userTeam) **Signature** ```java public void setUserTeam(String userTeam) ``` **Parameters** _userTeam_ Type: String **Return Value** Type: void ## MatchedItem.Address Class ### MatchedItem.Address Methods The following are methods for `MatchedItem.Address`. #### getAddress() **Signature** ```java public String getAddress() ``` **Return Value** Type: String #### getName() **Signature** ```java public String getName() ``` **Return Value** Type: String #### getOriginal() **Signature** ```java public String getOriginal() ``` **Return Value** Type: String #### setAddress(address) **Signature** ```java public void setAddress(String address) ``` **Parameters** _address_ Type: String **Return Value** Type: void #### setName(name) **Signature** ```java public void setName(String name) ``` **Parameters** _name_ Type: String **Return Value** Type: void #### setOriginal(original) **Signature** ```java public void setOriginal(String original) ``` **Parameters** _original_ Type: String **Return Value** Type: void ## MatchedItem.OtherItem Class ### MatchedItem.OtherItem Methods The following are methods for `MatchedItem.OtherItem`. #### getIid() **Signature** ```java public String getIid() ``` **Return Value** Type: String #### getPermalink() **Signature** ```java public String getPermalink() ``` **Return Value** Type: String #### getText() **Signature** ```java public String getText() ``` **Return Value** Type: String #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### getUsername() **Signature** ```java public String getUsername() ``` **Return Value** Type: String #### setIid(iid) **Signature** ```java public void setIid(String iid) ``` **Parameters** _iid_ Type: String **Return Value** Type: void #### setPermalink(permalink) **Signature** ```java public void setPermalink(String permalink) ``` **Parameters** _permalink_ Type: String **Return Value** Type: void #### setText(text) **Signature** ```java public void setText(String text) ``` **Parameters** _text_ Type: String **Return Value** Type: void #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void #### setType(type) **Signature** ```java public void setType(String type) ``` **Parameters** _type_ Type: String **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void #### setUsername(username) **Signature** ```java public void setUsername(String username) ``` **Parameters** _username_ Type: String **Return Value** Type: void ## SearchResult Class Represents search result for a query. Use `SearchResult` with [`Paging`](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_paging.md) to work with results returned from a search query. See [Slack's search.all method](https://api.slack.com/methods/search.all). ### SearchResult Methods The following are methods for `SearchResult`. #### getMatches() **Signature** ```java public List getMatches() ``` **Return Value** Type: List #### getPagination() **Signature** ```java public Slack.SearchResult.Pagination getPagination() ``` **Return Value** Type: Slack.SearchResult.Pagination #### getPaging() **Signature** ```java public Slack.Paging getPaging() ``` **Return Value** Type: [Slack.Paging](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_paging.md) #### getRefinements() **Signature** ```java public List getRefinements() ``` **Return Value** Type: List\ #### getTotal() **Signature** ```java public Integer getTotal() ``` **Return Value** Type: Integer #### setMatches(matches) **Signature** ```java public void setMatches(List matches) ``` **Parameters** _matches_ Type: List **Return Value** Type: void #### setPagination(pagination) **Signature** ```java public void setPagination(Slack.SearchResult.Pagination pagination) ``` **Parameters** _pagination_ Type: Slack.SearchResult.Pagination **Return Value** Type: void #### setPaging(paging) **Signature** ```java public void setPaging(Slack.Paging paging) ``` **Parameters** _pagination_ Type: [Slack.Paging](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_paging.md) **Return Value** Type: void #### setRefinements(refinements) **Signature** ```java public void setRefinements(List refinements) ``` **Parameters** _refinements_ Type: List\ **Return Value** Type: void #### setTotal(total) **Signature** ```java public void setTotal(Integer total) ``` **Parameters** _total_ Type: Integer **Return Value** Type: void ## SearchResult.Pagination Class ### SearchResult.Pagination Methods The following are methods for `SearchResult.Pagination`. #### getFirst() **Signature** ```java public Integer getFirst() ``` **Return Value** Type: Integer #### getLast() **Signature** ```java public Integer getLast() ``` **Return Value** Type: Integer #### getPage() **Signature** ```java public Integer getPage() ``` **Return Value** Type: Integer #### getPageCount() **Signature** ```java public Integer getPageCount() ``` **Return Value** Type: Integer #### getPerPage() **Signature** ```java public Integer getPerPage() ``` **Return Value** Type: Integer #### getTotalCount() **Signature** ```java public Integer getTotalCount() ``` **Return Value** Type: Integer #### setFirst(first) **Signature** ```java public void setFirst(Integer first) ``` **Parameters** _first_ Type: Integer **Return Value** Type: void #### setLast(last) **Signature** ```java public void setLast(Integer last) ``` **Parameters** _last_ Type: Integer **Return Value** Type: void #### setPage(page) **Signature** ```java public void setPage(Integer page) ``` **Parameters** _page_ Type: Integer **Return Value** Type: void #### setPageCount(pageCount) **Signature** ```java public void setPageCount(Integer pageCount) ``` **Parameters** _pageCount_ Type: Integer **Return Value** Type: void #### setPerPage(perPage) **Signature** ```java public void setPerPage(Integer perPage) ``` **Parameters** _perPage_ Type: Integer **Return Value** Type: void #### setTotalCount(totalCount) **Signature** ```java public void setTotalCount(Integer totalCount) ``` **Parameters** _totalCount_ Type: Integer **Return Value** Type: void ## SearchAllRequest Class Sends a request to search for messages and files matching a query. **Usage** See Slack’s [search.all method](https://api.slack.com/methods/search.all). ### SearchAllRequest Methods The following are methods for `SearchAllRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java static Slack.SearchAllRequest.Builder builder() ``` **Return Value** Type: Slack.SearchAllRequest.Builder ## SearchAllRequest.Builder Class Contains methods to build an instance of the `Slack.SearchAllRequest` class. A Builder object is obtained by invoking one of the `SearchAllRequest.builder` methods defined by the `SearchAllRequest` class. ### SearchAllRequest.Builder Methods The following are methods for `SearchAllRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of `Slack.SearchAllRequest`. **Signature** ```java Slack.SearchAllRequest build() ``` **Return Value** Type: Slack.SearchAllRequest #### count(count) Number of items to return per page. The default is 20. **Signature** ```java Slack.SearchAllRequest.Builder count(Integer count) ``` **Parameters** _count_ Type: Integer **Return Value** Type: Slack.SearchAllRequest.Builder #### highlight(highlight) Specifies whether to enable query highlight markers. **Signature** ```java Slack.SearchAllRequest.Builder highlight(Boolean highlight) ``` **Parameters** _highlight_ Type: Boolean **Return Value** Type: Slack.SearchAllRequest.Builder #### page(page) Page number of results to return. The default is 1. **Signature** ```java Slack.SearchAllRequest.Builder page(Integer page) ``` **Parameters** _page_ Type: Integer **Return Value** Type: Slack.SearchAllRequest.Builder #### query(query) Required. The search query, which can contain booleans. **Signature** ```java Slack.SearchAllRequest.Builder query(String query) ``` **Parameters** _query_ Type: String **Return Value** Type: Slack.SearchAllRequest.Builder #### sortDir(sortDir) Changes sort direction. Valid values are: `asc` (ascending), and `desc` (descending). The default is `desc`. **Signature** ```java Slack.SearchAllRequest.Builder sortDir(String sortDir) ``` **Parameters** _sortDir_ Type: String #### sortValue(sortValue) **Signature** ```java Slack.SearchAllRequest.Builder sortValue(String sortValue) ``` **Parameters** _sortType_ Type: String **Return Value** Type: Slack.SearchAllRequest.Builder #### teamId(teamId) **Signature** ```java Slack.SearchAllRequest.Builder teamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: Slack.SearchAllRequest.Builder ## SearchAllResponse Class Searches for messages and files matching a query. **Usage** See Slack’s [search.all method](https://api.slack.com/methods/search.all). ### SearchAllResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `SearchAllResponse`. #### getFiles() **Signature** ```java public Slack.SearchResult getFiles() ``` **Return Value** Type: Slack.SearchResult #### getMessages() **Signature** ```java public Slack.SearchResult getMessages() ``` **Return Value** Type: Slack.SearchResult #### getPosts() **Signature** ```java Slack.SearchAllResponse.Posts getPosts() ``` **Return Value** Type: Slack.SearchAllResponse.Posts #### getQuery() **Signature** ```java String getQuery() ``` **Return Value** Type: String #### setFiles(files) **Signature** ```java public void setFiles(Slack.SearchResult files) ``` **Parameters** _files_ Type: Slack.SearchResult **Return Value** Type: void #### setMessages(messages) **Signature** ```java public void setMessages(Slack.SearchResult messages) ``` **Parameters** _messages_ Type: Slack.SearchResult **Return Value** Type: void #### setPosts(posts) **Signature** ```java void setPosts(Slack.SearchAllResponse.Posts posts) ``` **Parameters** _posts_ Type: Slack.SearchAllResponse.Posts **Return Value** Type: void #### setQuery(query) **Signature** ```java void setQuery(String query) ``` **Parameters** _query_ Type: String **Return Value** Type: void ## SearchAllResponse.Posts Class Contains methods to build an instance of the `Slack.SearchAllResponse` class. A Posts object is obtained by invoking one of the `SearchAllRequest.Posts` methods defined by the `SearchAllRequest` class. ### SearchAllResponse.Posts Methods The following are methods for `SearchAllResponse.Posts`. #### getMatches() **Signature** ```java List getMatches() ``` **Return Value** Type: List<String> #### getTotal() **Signature** ```java Integer getTotal() ``` **Return Value** Type: Integer #### setMatches(matches) **Signature** ```java void setMatches(List matches) ``` **Parameters** _matches_ Type: List<String> **Return Value** Type: void #### setTotal(total) **Signature** ```java void setTotal(Integer total) ``` **Parameters** _total_ Type: Integer **Return Value** Type: void ## SearchFilesRequest Class Sends a request to search for files matching a query. **Usage** See Slack’s [search.files method](https://api.slack.com/methods/search.files). ### SearchFilesRequest Methods The following are methods for `SearchFilesRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java static Slack.SearchFilesRequest.Builder builder() ``` **Return Value** Type: Slack.SearchFilesRequest.Builder ## SearchFilesRequest.Builder Class Contains methods to build an instance of the `Slack.SearchFilesRequest` class. A Builder object is obtained by invoking one of the `SearchFilesRequest.builder` methods defined by the `SearchFilesRequest` class. ### SearchFilesRequest.Buider Methods The following are methods for `SearchFilesRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of `Slack.SearchFilesRequest`. **Signature** ```java Slack.SearchFilesRequest build() ``` **Return Value** Type: Slack.SearchFilesRequest #### count(count) Number of items to return per page. The default is 20. **Signature** ```java Slack.SearchFilesRequest.Builder count(Integer count) ``` **Parameters** _count_ Type: Integer **Return Value** Type: Slack.SearchFilesRequest.Builder #### highlight(highlight) Specifies whether to enable query highlight markers. **Signature** ```java Slack.SearchFilesRequest.Builder highlight(Boolean highlight) ``` **Parameters** _highlight_ Type: Boolean **Return Value** Type: Slack.SearchFilesRequest.Builder #### page(page) The page number of the results to return. The default is 1. **Signature** ```java Slack.SearchFilesRequest.Builder page(Integer page) ``` **Parameters** _page_ Type: Integer **Return Value** Type: Slack.SearchFilesRequest.Builder #### query(query) Required. The search query. **Signature** ```java Slack.SearchFilesRequest.Builder query(String query) ``` **Parameters** _query_ Type: String **Return Value** Type: Slack.SearchFilesRequest.Builder #### sortDir(sortDir) Changes sort direction. Valid values are `asc` (ascending) and `desc` (descending). The default is `desc`. **Signature** ```java Slack.SearchFilesRequest.Builder sortDir(String sortDir) ``` **Parameters** _sortDir_ Type: String **Return Value** Type: Slack.SearchFilesRequest.Builder #### sortValue(sortValue) Returns martches sorted by `score` or `timestamp`. The default is `score`. **Signature** ```java Slack.SearchFilesRequest.Builder sortValue(String sortValue) ``` **Parameters** _sortValue_ Type: String **Return Value** Type: Slack.SearchFilesRequest.Builder #### teamId(teamId) The encoded team ID to search in, which is required if org token is used. **Signature** ```java Slack.SearchFilesRequest.Builder teamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: Slack.SearchFilesRequest.Builder ## SearchFilesResponse Class Searches for files matching a query. **Usage** See Slack’s [search.files method](https://api.slack.com/methods/search.files). ### SearchFilesResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `SearchFilesResponse`. #### getFiles() **Signature** ```java public Slack.SearchResult getFiles() ``` **Return Value** Type: Slack.SearchResult #### getQuery() **Signature** ```java String getQuery() ``` **Return Value** Type: String #### setFiles(files) **Signature** ```java public void setFiles(Slack.SearchResult files) ``` **Parameters** _files_ Type: Slack.SearchResult **Return Value** Type: void #### setQuery(query) **Signature** ```java void setQuery(String query) ``` **Parameters** _query_ Type: String **Return Value** Type: void ## SearchMessagesRequest Class Sends a request to search for messages matching a query. **Usage** See Slack’s [search.messages method](https://api.slack.com/methods/search.messages). ### SearchMessagesRequest Methods The following are methods for `SearchMessagesRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java static Slack.SearchMessagesRequest.Builder builder() ``` **Return Value** Type: Slack.SearchMessagesRequest.Builder. ## SearchMessagesRequest.Builder Class Contains methods to build an instance of the `Slack.SearchMessagesRequest` class. A Builder object is obtained by invoking one of the `SearchMessagesRequest.builder` methods defined by the `SearchMessagesRequest` class. ### SearchMessagesRequest.Builder Methods The following are methods for `SearchMessagesRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of `Slack.SearchMessagesRequest`. **Signature** ```java Slack.SearchMessagesRequest build() ``` **Return Value** Type: Slack.SearchMessagesRequest #### count(count) Number of items to return per page. The default is 20. **Signature** ```java Slack.SearchMessagesRequest.Builder count(Integer count) ``` **Parameters** _count_ Type: Integer **Return Value** Type: Slack.SearchMessagesRequest.Builder #### cursor(cursor) **Signature** ```java public Slack.SearchMessagesRequest.Builder cursor(String cursor) ``` **Parameters** _cursor_ Type: String **Return Value** Type: [Slack.SearchMessagesRequest.Builder](#searchmessagesrequestbuilder-class) #### highlight(highlight) Specifies whether to enable query highlight markers. **Signature** ```java Slack.SearchMessagesRequest.Builder highlight(Boolean highlight) ``` **Parameters** _highlight_ Type: Boolean **Return Value** Type: Slack.SearchMessagesRequest.Builder #### page(page) The page number of the results to return. The default is 1. **Signature** ```java Slack.SearchMessagesRequest.Builder page(Integer page) ``` **Parameters** _page_ Type: Integer **Return Value** Type: Slack.SearchMessagesRequest.Builder #### query(query) Required. The search query. **Signature** ```java Slack.SearchMessagesRequest.Builder query(String query) ``` **Parameters** _query_ Type: String **Return Value** Type: Slack.SearchMessagesRequest.Builder #### sortDir(sortDir) Changes sort direction. Valid values are `asc` (ascending) and `desc` (descending). The default is `desc`. **Signature** ```java Slack.SearchMessagesRequest.Builder sortDir(String sortDir) ``` **Parameters** _sortDir_ Type: String **Return Value** Type: Slack.SearchMessagesRequest.Builder #### sortValue(sortValue) Returns martches sorted by `score` or `timestamp`. The default is `score`. **Signature** ```java Slack.SearchMessagesRequest.Builder sortValue(String sortValue) ``` **Parameters** _sortValue_ Type: String **Return Value** Type: Slack.SearchMessagesRequest.Builder #### teamId(teamId) The encoded team ID to search in, which is required if org token is used. **Signature** ```java Slack.SearchMessagesRequest.Builder teamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: Slack.SearchMessagesRequest.Builder ## SearchMessagesResponse Class Searches for messages matching a query. **Usage** See Slack’s [search.messages method](https://api.slack.com/methods/search.messages). ### SearchMessagesResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `SearchMessagesResponse`. #### getMessages() **Signature** ```java public Slack.SearchResult getMessages() ``` **Return Value** Type: Slack.SearchResult #### getQuery() **Signature** ```java String getQuery() ``` **Return Value** Type: String #### setMessages(messages) **Signature** ```java public void setMessages(Slack.SearchResult messages) ``` **Parameters** _messages_ Type: Slack.SearchResult **Return Value** Type: void #### setQuery(query) **Signature** ```java void setQuery(String query) ``` **Parameters** _query_ Type: String **Return Value** Type: void # Work with Shared Channel The following are Apex classes for the Slack `shared` [API methods](https://api.slack.com/methods?query=shared). ## SharedChannelInviteAcceptedEvent Class Sends a request to accept an invitation in a Slack Connect channel. ### Usage See Slack's [conversations.acceptSharedInvite](https://api.slack.com/methods/conversations.acceptSharedInvite) method. ### SharedChannelInviteAcceptedEvent Methods The following are methods for `SharedChannelInviteAcceptedEvent`. #### getAcceptingUser() **Signature** ```java public Slack.ConnectUser getAcceptingUser() ``` **Return Value** Type: Slack.ConnectUser #### getChannel() **Signature** ```java public Slack.ConnectChannel getChannel() ``` **Return Value** Type: Slack.ConnectChannel #### getEventTs() **Signature** ```java public String getEventTs() ``` **Return Value** Type: String #### getInvite() **Signature** ```java public Slack.ConnectInviteDetail getInvite() ``` **Return Value** Type: Slack.ConnectInviteDetail #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getTeamsInChannel() **Signature** ```java public List getTeamsInChannel() ``` **Return Value** Type: List #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### isApprovalRequired() **Signature** ```java public Boolean isApprovalRequired() ``` **Return Value** Type: Boolean #### setAcceptingUser(acceptingUser) **Signature** ```java public void setAcceptingUser(Slack.ConnectUser acceptingUser) ``` **Parameters** _acceptingUser_ Type: Slack.ConnectUser **Return Value** Type: void #### setApprovalRequired(approvalRequired) **Signature** ```java public void setApprovalRequired(Boolean approvalRequired) ``` **Parameters** _approvalRequired_ Type: Boolean **Return Value** Type: void #### setChannel(channel) **Signature** ```java public void setChannel(Slack.ConnectChannel channel) ``` **Parameters** _channel_ Type: Slack.ConnectChannel **Return Value** Type: void #### setEventTs(eventTs) **Signature** ```java public void setEventTs(String eventTs) ``` **Parameters** _eventTs_ Type: String **Return Value** Type: void #### setInvite(invite) **Signature** ```java public void setInvite(Slack.ConnectInviteDetail invite) ``` **Parameters** _invite_ Type: Slack.ConnectInviteDetail **Return Value** Type: void #### setTeamsInChannel(teamsInChannel) **Signature** ```java public void setTeamsInChannel(List teamsInChannel) ``` **Parameters** _teamsInChannel_ Type: List **Return Value** Type: void ## SharedChannelInviteApprovedEvent Class Approves an accepted invitation to a Slack Connect channel. ### Usage See Slack's [approveSharedInvite](https://api.slack.com/methods/conversations.approveSharedInvite) method. ### SharedChannelInviteApprovedEvent Methods These methods are for `SharedChannelInviteApprovedEvent`. #### getApprovingTeamId() **Signature** ```java public String getApprovingTeamId() ``` **Return Value** Type: String #### getApprovingUser() **Signature** ```java public Slack.ConnectUser getApprovingUser() ``` **Return Value** Type: Slack.ConnectUser #### getChannel() **Signature** ```java public Slack.ConnectChannel getChannel() ``` **Return Value** Type: Slack.ConnectChannel #### getEventTs() **Signature** ```java public String getEventTs() ``` **Return Value** Type: String #### getInvite() **Signature** ```java public Slack.ConnectInviteDetail getInvite() ``` **Return Value** Type: Slack.ConnectInviteDetail #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getTeamsInChannel() **Signature** ```java public List getTeamsInChannel() ``` **Return Value** Type: List #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### setApprovingTeamId(approvingTeamId) **Signature** ```java public void setApprovingTeamId(String approvingTeamId) ``` **Parameters** _approvingTeamId_ Type: String **Return Value** Type: void #### setApprovingUser(approvingUser) **Signature** ```java public void setApprovingUser(Slack.ConnectUser approvingUser) ``` **Parameters** _approvingUser_ Type: Slack.ConnectUser **Return Value** Type: void #### setChannel(channel) **Signature** ```java public void setChannel(Slack.ConnectChannel channel) ``` **Parameters** _channel_ Type: Slack.ConnectChannel **Return Value** Type: void #### setEventTs(eventTs) **Signature** ```java public void setEventTs(String eventTs) ``` **Parameters** _eventTs_ Type: String **Return Value** Type: void #### setInvite(invite) **Signature** ```java public void setInvite(Slack.ConnectInviteDetail invite) ``` **Parameters** _invite_ Type: Slack.ConnectInviteDetail **Return Value** Type: void #### setTeamsInChannel(teamsInChannel) **Signature** ```java public void setTeamsInChannel(List teamsInChannel) ``` **Parameters** _teamsInChannel_ Type: List **Return Value** Type: void ## SharedChannelInviteDeclinedEvent Class Sends a request to decline a Slack Connect channel invite. #### Usage See Slack’s [delineSharedInvite](https://api.slack.com/methods/conversations.declineSharedInvite) method. ### SharedChannelInviteDeclinedEvent Methods These methods are for `SharedChannelInviteDeclinedEvent`. #### getChannel() **Signature** ```java public Slack.ConnectChannel getChannel() ``` **Return Value** Type: Slack.ConnectChannel #### getDecliningTeamId() **Signature** ```java public String getDecliningTeamId() ``` **Return Value** Type: String #### getDecliningUser() **Signature** ```java public Slack.ConnectUser getDecliningUser() ``` **Return Value** Type: Slack.ConnectUser #### getEventTs() **Signature** ```java public String getEventTs() ``` **Return Value** Type: String #### getInvite() **Signature** ```java public Slack.ConnectInviteDetail getInvite() ``` **Return Value** Type: Slack.ConnectInviteDetail #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getTeamsInChannel() **Signature** ```java public List getTeamsInChannel() ``` **Return Value** Type: List #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### setChannel(channel) **Signature** ```java public void setChannel(Slack.ConnectChannel channel) ``` **Parameters** _channel_ Type: Slack.ConnectChannel **Return Value** Type: void #### setDecliningTeamId(decliningTeamId) **Signature** ```java public void setDecliningTeamId(String decliningTeamId) ``` **Parameters** _decliningTeamId_ Type: String **Return Value** Type: void #### setDecliningUser(decliningUser) **Signature** ```java public void setDecliningUser(Slack.ConnectUser decliningUser) ``` **Parameters** _decliningUser_ Type: Slack.ConnectUser **Return Value** Type: void #### setEventTs(eventTs) **Signature** ```java public void setEventTs(String eventTs) ``` **Parameters** _eventTs_ Type: String **Return Value** Type: void #### setInvite(invite) **Signature** ```java public void setInvite(Slack.ConnectInviteDetail invite) ``` **Parameters** _invite_ Type: Slack.ConnectInviteDetail **Return Value** Type: void #### setTeamsInChannel(teamsInChannel) **Signature** ```java public void setTeamsInChannel(List teamsInChannel) ``` **Parameters** _teamsInChannel_ Type: List **Return Value** Type: void ## SharedChannelInviteReceivedEvent Class ### SharedChannelInviteReceivedEvent Methods These methods are for `SharedChannelInviteReceivedEvent`. #### getChannel() **Signature** ```java public Slack.ConnectChannel getChannel() ``` **Return Value** Type: Slack.ConnectChannel #### getEventTs() **Signature** ```java public String getEventTs() ``` **Return Value** Type: String #### getInvite() **Signature** ```java public Slack.ConnectInviteDetail getInvite() ``` **Return Value** Type: Slack.ConnectInviteDetail #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String # Work with Shortcuts The following are Apex classes for working with shortcuts. ## ShortcutDispatcher Class Defines the dispatcher for the shortcut you are handling. **Usage** When a user interacts with your shortcut, your app receives an interaction payload. Your handler processes that payload and then sends a response. See [Handle Slack Actions](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/actions.md). To respond to an interaction payload, always send an acknowledgement response, follow up with a modal to confirm any action that occurs next. See [Slack API: Responding to shortcuts](https://api.slack.com/interactivity/shortcuts/using#shortcut_response). ### ShortcutDispatcher Methods `ShortcutDispatcher` has the following method. #### invoke(parameters, context) Invokes the action handler. **Signature** ```java public Slack.ActionHandler invoke( Slack.ShortcutParameters parameters, Slack.RequestContext context ); ``` **Parameters** _parameters_ Type: [Slack.ShortcutParameters](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_shortcut.md) The action parameters for the shortcut handler. The format is a `Map`. _context_ Type: [Slack.RequestContext](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_requestcontext.md) Describes the context in which a Slack action is invoked. **Return Value** Type: [Slack.ActionHandler](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_dispatchers.md) **Usage** To access the Slack context, use the `invoke()` method. This method is passed in by an instance of `RequestContext`. It exposes information about the source of the action in Slack, performs custom logic, and obtains the correct Slack client to respond to Slack based on the request. Each action type receives different information in its `RequestContext`. --- ## ShortcutParameters Class Contains information about the shortcut. ### ShortcutParameters Constructor The following are constructors for `ShortcutParameters`. #### ShortcutParameters(callbackId) Creates an instance of the `Slack.ShortcutParameters` class with the specified callback ID. **Signature** ```java public ShortcutParameters(String callbackId) ``` **Parameters** _callbackId_ Type: String The ID sent in the interaction payload. ### ShortcutParameters Methods The following are methods for `ShortcutParameters`. #### getCallbackId() **Signature** ```java public String getCallbackId() ``` **Return Value** Type: String # Work with Slash Commands The following are Apex classes for working with slash commands. ## SlashCommandDispatcher Class Defines the dispatcher for the slash command you are handling. **Usage** When a user interacts with your slash command, your app receives an interaction payload. Your handler processes that payload and then sends a response. See [Handle Slack Actions](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/actions.md). To respond to an interaction payload, always send an acknowledgement response, follow up with a modal to confirm any action that occurs next. See [Slack API: Responding to shortcuts](https://api.slack.com/interactivity/shortcuts/using#shortcut_response). For example, you can post a message that contains a view when a user enters a slash command. See [ChatPostMessageRequest](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_chat.md#chatpostmessagerequest-class) ### SlashCommandDispatcher Methods The following are methods for `SlashCommandDispatcher`. #### invoke(parameters, context) Invokes the action handler. **Signature** ```java public Slack.ActionHandler invoke( Slack.SlashCommandParameters parameters, Slack.RequestContext context ); ``` **Parameters** _parameters_ Type: Slack.SlashCommandParameters The action parameters for the shortcut handler. The format is a `Map`. _context_ Type: Slack.RequestContext Describes the context in which a Slack action is invoked. **Return Value** Type: Slack.ActionHandler **Usage** To access the Slack context, use the `invoke()` method. This method is passed in by an instance of `RequestContext`. It exposes information about the source of the action in Slack, performs custom logic, and obtains the correct Slack client to respond to Slack based on the request. Each action type receives different information in its `RequestContext`. --- ## SlashCommandParameters Class Contains information about the slash command. ### SlashCommandParameters Constructor `SlashCommandParameters` has the following constructor. #### SlashCommandParameters(command, text) Creates an instance of the `Slack.SlashCommandParameters` class with the command name and text. **Signature** ```java public SlashCommandParameters(String command, String text) ``` **Parameters** _command_ Type: String The command after the slash. _text_ Type: String The string after the command. ### SlashCommandParameters Methods `SlashCommandParameters` has the following methods. #### getCommand() Gets the command that was typed in to trigger the request. **Signature** ```java public String getCommand() ``` **Return Value** Type: String #### getText() Gets the string after the command, which can contain anything that the user types. This text provides extra context for the command. **Signature** ```java public String getText() ``` **Return Value** Type: String # Work with Stars The following are Apex classes for the Slack `stars` [API methods](https://api.slack.com/methods?filter=stars). ## StarsAddRequest Class Sends a request to save an item for later. **Usage** See Slack’s [stars.add method](https://api.slack.com/methods/stars.add). ### StarsAddRequest Methods The following are methods for `StarsAddRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java static Slack.StarsAddRequest.Builder builder() ``` **Return Value** Type: Slack.StarsAddRequest.Builder ## StarsAddRequest.Builder Class Contains methods to build an instance of the `Slack.StarsAddRequest` class. A Builder object is obtained by invoking one of the `StarsAddRequest.builder` methods defined by the `StarsAddRequest` class. ### StarsAddRequest.Builder Methods The following are methods for `StarsAddRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of `Slack.StarsAddRequest`. **Signature** ```java Slack.StarsAddRequest build() ``` **Return Value** Type: Slack.StarsAddRequest #### channel(channel) The channel to add star to, or channel where the message to add star to was posted. **Signature** ```java Slack.StarsAddRequest.Builder channel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: Slack.StarsAddRequest.Builder #### file(file) The file to add a star to. **Signature** ```java Slack.StarsAddRequest.Builder file(String file) ``` **Parameters** _file_ Type: String Type: Slack.StarsAddRequest.Builder #### fileComment(fileComment) The file comment to add a star to. **Signature** ```java Slack.StarsAddRequest.Builder fileComment(String fileComment) ``` **Parameters** _fileComment_ Type: String **Return Value** Type: Slack.StarsAddRequest.Builder #### timestamp(timestamp) Timestamp of the message to add a star to. **Signature** ```java Slack.StarsAddRequest.Builder timestamp(String timestamp) ``` **Parameters** _timestamp_ Type: String **Return Value** Type: Slack.StarsAddRequest.Builder ## StarsAddResponse Class Saves an item for later. **Usage** See Slack’s [stars.add method](https://api.slack.com/methods/stars.add). ### StarsAddResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). ## StarsListRequest Class Sends a request to list a user's saved items. ### StarsListRequest Methods The following are methods for `StarsListRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.StarsListRequest.Builder builder() ``` **Return Value** Type: Slack.StarsListRequest.Builder ## StarsListRequest.Builder Class Contains methods to build an instance of the `Slack.StarsListRequest` class. A Builder object is obtained by invoking one of the `StarsListRequest.builder` methods defined by the `StarsListRequest` class. ### StarsListRequest.Builder Methods The following are methods for `StarsListRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Builds an instance of `Slack.StarsListRequest`. **Signature** ```java public Slack.StarsListRequest build() ``` **Return Value** Type: Slack.StarsListRequest #### count(count) **Signature** ```java public Slack.StarsListRequest.Builder count(Integer count) ``` **Parameters** _count_ Type: Integer **Return Value** Type: Slack.StarsListRequest.Builder #### cursor(cursor) **Signature** ```java public Slack.StarsListRequest.Builder cursor(String cursor) ``` **Parameters** _cursor_ Type: String **Return Value** Type: [Slack.StarsListRequest.Builder](#starslistrequestbuilder-class) #### limitValue(limitValue) **Signature** ```java public Slack.StarsListRequest.Builder limitValue(Integer limitValue) ``` **Parameters** _limitValue_ Type: Integer **Return Value** Type: [Slack.StarsListRequest.Builder](#starslistrequestbuilder-class) #### page(page) **Signature** ```java public Slack.StarsListRequest.Builder page(Integer page) ``` **Parameters** _page_ Type: Integer **Return Value** Type: Slack.StarsListRequest.Builder #### teamId(teamId) **Signature** ```java public Slack.StarsListRequest.Builder teamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: [Slack.StarsListRequest.Builder](#starslistrequestbuilder-class) ## StarsListResponse Class List a user's saved items. ### StarsListResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `StarsListResponse`. #### getItems() **Signature** ```java public List getItems() ``` **Return Value** Type: List #### getPaging() **Signature** ```java public Slack.Paging getPaging() ``` **Return Value** Type: [Slack.Paging](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_paging.md) #### setItems(items) **Signature** ```java public void setItems(List items) ``` **Parameters** _items_ Type: List **Return Value** Type: void #### setPaging(paging) **Signature** ```java public void setPaging(Slack.Paging paging) ``` **Parameters** _paging_ Type: [Slack.Paging](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_paging.md) **Return Value** Type: void ## StarsListResponse.Comment Class ### StarsListResponse.Comment Methods The following are methods for `StarsListResponse.Comment`. #### getComment() **Signature** ```java public String getComment() ``` **Return Value** Type: String #### getCreated() **Signature** ```java public Integer getCreated() ``` **Return Value** Type: Integer #### getId() **Signature** ```java public String getId() ``` **Return Value** Type: String #### getNumStars() **Signature** ```java public Integer getNumStars() ``` **Return Value** Type: Integer #### getTimestamp() **Signature** ```java public Integer getTimestamp() ``` **Return Value** Type: Integer #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### isIntro() **Signature** ```java public Boolean isIntro() ``` **Return Value** Type: Boolean #### isStarred() **Signature** ```java public Boolean isStarred() ``` **Return Value** Type: Boolean #### setComment(comment) **Signature** ```java public void setComment(String comment) ``` **Parameters** _comment_ Type: String **Return Value** Type: void #### setCreated(created) **Signature** ```java public void setCreated(Integer created) ``` **Parameters** _created_ Type: Integer **Return Value** Type: void #### setId(id) **Signature** ```java public void setId(String id) ``` **Parameters** _id_ Type: String **Return Value** Type: void #### setIntro(intro) **Signature** ```java public void setIntro(Boolean intro) ``` **Parameters** _intro_ Type: Boolean **Return Value** Type: void #### setNumStars(numStars) **Signature** ```java public void setNumStars(Integer numStars) ``` **Parameters** _numStars_ Type: Integer **Return Value** Type: void #### setStarred(starred) **Signature** ```java public void setStarred(Boolean starred) ``` **Parameters** _starred_ Type: Boolean **Return Value** Type: void #### setTimestamp(timestamp) **Signature** ```java public void setTimestamp(Integer timestamp) ``` **Parameters** _timestamp_ Type: Integer **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void ## StarsListResponse.Edited Class ### StarsListResponse.Edited Methods The following are methods for `StarsListResponse.Edited`. #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void **Return Value** Type: void ## StarsListResponse.Item Class ### StarsListResponse.Item Methods The following are methods for `StarsListResponse.Item`. #### getChannel() **Signature** ```java public String getChannel() ``` **Return Value** Type: String #### getComment() **Signature** ```java public Slack.StarsListResponse.Comment getComment() ``` **Return Value** Type: Slack.StarsListResponse.Comment #### getDateCreate() **Signature** ```java public Integer getDateCreate() ``` **Return Value** Type: Integer #### getFile() **Signature** ```java public Slack.File getFile() ``` **Return Value** Type: [Slack.File](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_files.md) #### getMessage() **Signature** ```java public Slack.StarsListResponse.Message getMessage() ``` **Return Value** Type: Slack.StarsListResponse.Message #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### setChannel(channel) **Signature** ```java public void setChannel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: void #### setComment(comment) **Signature** ```java public void setComment(Slack.StarsListResponse.Comment comment) ``` **Parameters** _comment_ Type: Slack.StarsListResponse.Comment **Return Value** Type: void #### setDateCreate(dateCreate) **Signature** ```java public void setDateCreate(Integer dateCreate) ``` **Parameters** _dateCreate_ Type: Integer **Return Value** Type: void #### setFile(file) **Signature** ```java public void setFile(Slack.File file) ``` **Parameters** _file_ Type: [Slack.File](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_files.md) **Return Value** Type: void #### setMessage(message) **Signature** ```java public void setMessage(Slack.StarsListResponse.Message message) ``` **Parameters** _message_ Type: Slack.StarsListResponse.Message **Return Value** Type: void #### setType(type) **Signature** ```java public void setType(String type) ``` **Parameters** _type_ Type: String **Return Value** Type: void ## StarsListResponse.Message Class ### StarsListResponse.Message Methods #### getBotId() **Signature** ```java public String getBotId() ``` **Return Value** Type: String #### getBotProfile() **Signature** ```java public Slack.BotProfile getBotProfile() ``` **Return Value** Type: [Slack.BotProfile](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_bot.md#botprofile-class) #### getClientMsgId() **Signature** ```java public String getClientMsgId() ``` **Return Value** Type: String #### getDisplayAsBot() **Signature** ```java public Boolean getDisplayAsBot() ``` **Return Value** Type: Boolean #### getEdited() **Signature** ```java public Slack.StarsListResponse.Edited getEdited() ``` **Return Value** Type: Slack.StarsListResponse.Edited #### getInviter() **Signature** ```java public String getInviter() ``` **Return Value** Type: String #### getFiles() **Signature** ```java public List getFiles() ``` **Return Value** Type: List<[Slack.File](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_files.md)> #### getLastRead() **Signature** ```java public String getLastRead() ``` **Return Value** Type: String #### getLatestReply() **Signature** ```java public String getLatestReply() ``` **Return Value** Type: String #### getPermalink() **Signature** ```java public String getPermalink() ``` **Return Value** Type: String #### getReactions() **Signature** ```java public List getReactions() ``` **Return Value** Type: List<[Slack.Reaction](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_reactions.md)> #### getReplyCount() **Signature** ```java public Integer getReplyCount() ``` **Return Value** Type: Integer #### getReplyUsers() **Signature** ```java public List getReplyUsers() ``` **Return Value** Type: List\ #### getReplyUsersCount() **Signature** ```java public Integer getReplyUsersCount() ``` **Return Value** Type: Integer #### getSubtype() **Signature** ```java public String getSubtype() ``` **Return Value** Type: String #### getTeam() **Signature** ```java public String getTeam() ``` **Return Value** Type: String #### getText() **Signature** ```java public String getText() ``` **Return Value** Type: String #### getThreadTs() **Signature** ```java public String getThreadTs() ``` **Return Value** Type: String #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### getUpload() **Signature** ```java public Boolean getUpload() ``` **Return Value** Type: Boolean #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### getUsername() **Signature** ```java public String getUsername() ``` **Return Value** Type: String #### isLocked() **Signature** ```java public Boolean isLocked() ``` **Return Value** Type: Boolean #### isSubscribed() **Signature** ```java public Boolean isSubscribed() ``` **Return Value** Type: Boolean #### isStarred() **Signature** ```java public Boolean isStarred() ``` **Return Value** Type: Boolean #### setBotId(botId) **Signature** ```java public void setBotId(String botId) ``` **Parameters** _botId_ Type: String **Return Value** Type: void #### setBotProfile(botProfile) **Signature** ```java public void setBotProfile(Slack.BotProfile botProfile) ``` **Parameters** _botProfile_ Type: [Slack.BotProfile](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_bot.md#botprofile-class) **Return Value** Type: void #### setClientMsgId(clientMsgId) **Signature** ```java public void setClientMsgId(String clientMsgId) ``` **Parameters** _clientMsgId_ Type: String **Return Value** Type: void #### setDisplayAsBot(displayAsBot) **Signature** ```java public void setDisplayAsBot(Boolean displayAsBot) ``` **Parameters** _displayAsBot_ Type: Boolean **Return Value** Type: void #### setEdited(edited) **Signature** ```java public void setEdited(Slack.StarsListResponse.Edited edited) ``` **Parameters** _edited_ Type: Slack.StarsListResponse.Edited **Return Value** Type: void #### setFiles(files) **Signature** ```java public void setFiles(List files) ``` **Parameters** _files_ Type: List<[Slack.File](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_files.md)> **Return Value** Type: void #### setInviter(inviter) **Signature** ```java public void setInviter(String inviter) ``` **Parameters** _inviter_ Type: String **Return Value** Type: void #### setLastRead(lastRead) **Signature** ```java public void setLastRead(String lastRead) ``` **Parameters** _lastRead_ Type: String **Return Value** Type: void #### setLatestReply(latestReply) **Signature** ```java public void setLatestReply(String latestReply) ``` **Parameters** _latestReply_ Type: String **Return Value** Type: void #### setLocked(locked) **Signature** ```java public void setLocked(Boolean locked) ``` **Parameters** _locked_ Type: Boolean **Return Value** Type: void #### setPermalink(permalink) **Signature** ```java public void setPermalink(String permalink) ``` **Parameters** _permalink_ Type: String **Return Value** Type: void #### setReactions(reactions) **Signature** ```java public void setReactions(List reactions) ``` **Parameters** _reactions_ Type: List<[Slack.Reaction](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_reactions.md)> **Return Value** Type: void #### setReplyCount(replyCount) **Signature** ```java public void setReplyCount(Integer replyCount) ``` **Parameters** _replyCount_ Type: Integer **Return Value** Type: void #### setReplyUsers(replyUsers) **Signature** ```java public void setReplyUsers(List replyUsers) ``` **Parameters** _replyUsers_ Type: List\ **Return Value** Type: void #### setReplyUsersCount(replyUsersCount) **Signature** ```java public void setReplyUsersCount(Integer replyUsersCount) ``` **Parameters** _replyUsersCount_ Type: Integer **Return Value** Type: void #### setStarred(starred) **Signature** ```java public void setStarred(Boolean starred) ``` **Parameters** _starred_ Type: Boolean **Return Value** Type: void #### setSubscribed(subscribed) **Signature** ```java public void setSubscribed(Boolean subscribed) ``` **Parameters** _subscribed_ Type: Boolean **Return Value** Type: void #### setSubtype(subtype) **Signature** ```java public void setSubtype(String subtype) ``` **Parameters** _subtype_ Type: String **Return Value** Type: void #### setTeam(team) **Signature** ```java public void setTeam(String team) ``` **Parameters** _team_ Type: String **Return Value** Type: void #### setText(text) **Signature** ```java public void setText(String text) ``` **Parameters** _text_ Type: String **Return Value** Type: void #### setThreadTs(threadTs) **Signature** ```java public void setThreadTs(String threadTs) ``` **Parameters** _threadTs_ Type: String **Return Value** Type: void #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void #### setType(type) **Signature** ```java public void setType(String type) ``` **Parameters** _type_ Type: String **Return Value** Type: void #### setUpload(upload) **Signature** ```java public void setUpload(Boolean upload) ``` **Parameters** _upload_ Type: Boolean **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void #### setUsername(username) **Signature** ```java public void setUsername(String username) ``` **Parameters** _username_ Type: String **Return Value** Type: void ## StarsListResponse.MessageRootReply Class ### StarsListResponse.MessageRootReply Methods The following are methods for `StarsListResponse.MessageRootReply`. #### getTs() **Signature** ```java public String getTs() ``` **Return Value** Type: String #### getUser() **Signature** ```java public String getUser() ``` **Return Value** Type: String #### setTs(ts) **Signature** ```java public void setTs(String ts) ``` **Parameters** _ts_ Type: String **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: void ## StarsRemoveRequest Class Sends a request to remove a saved item (star) from an item. **Usage** See Slack’s [stars.remove method](https://api.slack.com/methods/stars.remove). ### StarsRemoveRequest Methods The following are methods for `StarsRemoveRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java static Slack.StarsRemoveRequest.Builder builder() ``` **Return Value** Type: Slack.StarsRemoveRequest.Builder ## StarsRemoveRequest.Builder Class Contains methods to build an instance of the `Slack.StarsRemoveRequest` class. A Builder object is obtained by invoking one of the `StarsRemoveRequest.builder` methods defined by the `StarsRemoveRequest` class. ### StarsRemoveRequest.Builder Methods The following are methods for `StarsRemoveRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of the `Slack.StarsRemoveRequest` object. **Signature** ```java Slack.StarsRemoveRequest build() ``` **Return Value** Type: Slack.StarsRemoveRequest #### channel(channel) The channel to remove the star from, or channel where the message to remove the star from was posted. **Signature** ```java Slack.StarsRemoveRequest.Builder channel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: Slack.StarsRemoveRequest.Builder #### file(file) The file comment to remove the star from. **Signature** ```java Slack.StarsRemoveRequest.Builder file(String file) ``` **Parameters** _file_ Type: String **Return Value** Type: Slack.StarsRemoveRequest.Builder #### fileComment(fileComment) **Signature** ```java Slack.StarsRemoveRequest.Builder fileComment(String fileComment) ``` **Parameters** _fileComment_ Type: String **Return Value** Type: Slack.StarsRemoveRequest.Builder #### timestamp(timestamp) The timestamp of the message to remove the star from. **Signature** ```java Slack.StarsRemoveRequest.Builder timestamp(String timestamp) ``` **Parameters** _timestamp_ Type: String **Return Value** Type: Slack.StarsRemoveRequest.Builder ## StarsRemoveResponse Class Removes a saved item (star) from an item. **Usage** See Slack’s [stars.remove method](https://api.slack.com/methods/stars.remove). ### StarsRemoveResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). # Work with Teams The following are Apex classes for the Slack `team` [API methods](https://api.slack.com/methods?filter=team). ## Team Class Represents a team. ### Team Methods The following are methods for `Team`. #### getDefaultChannels() **Signature** ```java public List getDefaultChannels() ``` **Return Value** Type: List\ #### getDiscoverable() **Signature** ```java public String getDiscoverable() ``` **Return Value** Type: String #### getDomain() **Signature** ```java public String getDomain() ``` **Return Value** Type: String #### getEmailDomain() **Signature** ```java public String getEmailDomain() ``` **Return Value** Type: String #### getEnterpriseDomain() **Signature** ```java public String getEnterpriseDomain() ``` **Return Value** Type: String #### getEnterpriseId() **Signature** ```java public String getEnterpriseId() ``` **Return Value** Type: String #### getEnterpriseName() **Signature** ```java public String getEnterpriseName() ``` **Return Value** Type: String #### getIcon() **Signature** ```java public Slack.TeamIcon getIcon() ``` **Return Value** Type: Slack.TeamIcon #### getId() **Signature** ```java public String getId() ``` **Return Value** Type: String #### getIsVerified() **Signature** ```java public Boolean getIsVerified() ``` **Return Value** Type: Boolean #### getName() **Signature** ```java public String getName() ``` **Return Value** Type: String #### getUrl() **Signature** ```java public String getUrl() ``` **Return Value** Type: String #### setDefaultChannels(defaultChannels) **Signature** ```java public void setDefaultChannels(List defaultChannels) ``` **Parameters** _defaultChannels_ Type: List\ **Return Value** Type: void #### setDiscoverable(discoverable) **Signature** ```java public void setDiscoverable(String discoverable) ``` **Parameters** _discoverable_ Type: String **Return Value** Type: void #### setDomain(domain) **Signature** ```java public void setDomain(String domain) ``` **Parameters** _domain_ Type: String **Return Value** Type: void #### setEmailDomain(emailDomain) **Signature** ```java public void setEmailDomain(String emailDomain) ``` **Parameters** _emailDomain_ Type: String **Return Value** Type: void #### setEnterpriseId(enterpriseId) **Signature** ```java public void setEnterpriseId(String enterpriseId) ``` **Parameters** _enterpriseId_ Type: String **Return Value** Type: void #### setEnterpriseDomain(enterpriseDomain) **Signature** ```java public void setEnterpriseDomain(String enterpriseDomain) ``` **Parameters** _enterpriseDomain_ Type: String **Return Value** Type: void #### setEnterpriseName(enterpriseName) **Signature** ```java public void setEnterpriseName(String enterpriseName) ``` **Parameters** _enterpriseName_ Type: String **Return Value** Type: void #### setIcon(icon) **Signature** ```java public void setIcon(Slack.TeamIcon icon) ``` **Parameters** _icon_ Type: Slack.TeamIcon **Return Value** Type: void #### setId(id) **Signature** ```java public void setId(String id) ``` **Parameters** _id_ Type: String **Return Value** Type: void #### setIsVerified(isVerified) **Signature** ```java public void setIsVerified(Boolean isVerified) ``` **Parameters** _isVerified_ Type: Boolean **Return Value** Type: void #### setName(name) **Signature** ```java public void setName(String name) ``` **Parameters** _name_ Type: String **Return Value** Type: void #### setUrl(url) **Signature** ```java public void setUrl(String url) ``` **Parameters** _url_ Type: String **Return Value** Type: void ## Team.Profile Class ### Team.Profile Methods The following are methods for `Team.Profile`. #### getFieldName() **Signature** ```java public String getFieldName() ``` **Return Value** Type: String #### getHint() **Signature** ```java public String getHint() ``` **Return Value** Type: String #### getId() **Signature** ```java public String getId() ``` **Return Value** Type: String #### getLabel() **Signature** ```java public String getLabel() ``` **Return Value** Type: String #### getOptions() **Signature** ```java public Slack.Team.ProfileOptions getOptions() ``` **Return Value** Type: Slack.Team.ProfileOptions #### getOrdering() **Signature** ```java public Integer getOrdering() ``` **Return Value** Type: Integer #### getPossibleValues() **Signature** ```java public List getPossibleValues() ``` **Return Value** Type: List\ #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### isHidden() **Signature** ```java public Boolean isHidden() ``` **Return Value** Type: String #### setFieldName(fieldName) **Signature** ```java public void setFieldName(String fieldName) ``` **Parameters** _fieldName_ Type: String **Return Value** Type: void #### setHidden(hidden) **Signature** ```java public void setHidden(Boolean hidden) ``` **Parameters** _hidden_ Type: Boolean **Return Value** Type: void #### setHint(hintValue) **Signature** ```java public void setHint(String hintValue) ``` **Parameters** _hintValue_ Type: String **Return Value** Type: void #### setId(id) **Signature** ```java public void setId(String id) ``` **Parameters** _id_ Type: String **Return Value** Type: void #### setLabel(label) **Signature** ```java public void setLabel(String label) ``` **Parameters** _label_ Type: String **Return Value** Type: void #### setOptions(options) **Signature** ```java public void setOptions(Slack.Team.ProfileOptions options) ``` **Parameters** _options_ Type: Slack.Team.ProfileOptions **Return Value** Type: void #### setOrdering(ordering) **Signature** ```java public void setOrdering(Integer ordering) ``` **Parameters** _ordering_ Type: Integer **Return Value** Type: void #### setPossibleValues(possibleValues) **Signature** ```java public void setPossibleValues(List possibleValues) ``` **Parameters** _possibleValues_ Type: List\ **Return Value** Type: void #### setType(type) **Signature** ```java public void setType(String type) ``` **Parameters** _type_ Type: String **Return Value** Type: void ## Team.ProfileOptions Class ### Team.ProfileOptions Methods The following are methods for `Team.ProfileOptions`. #### isprotected() **Signature** ```java public Boolean isprotected() ``` **Return Value** Type: Boolean #### setprotected(\_protected) **Signature** ```java public void setprotected(Boolean _protected) ``` **Parameters** _\_protected_ Type: Boolean **Return Value** Type: void ## TeamIcon Class Represents the team's icon. ### TeamIcon Methods The following are methods for `TeamIcon`. #### getImage34() **Signature** ```java public String getImage34() ``` **Return Value** Type: String #### getImage44() **Signature** ```java public String getImage44() ``` **Return Value** Type: String #### getImage68() **Signature** ```java public String getImage68() ``` **Return Value** Type: String #### getImage88() **Signature** ```java public String getImage88() ``` **Return Value** Type: String #### getImage102() **Signature** ```java public String getImage102() ``` **Return Value** Type: String #### getImage132() **Signature** ```java public String getImage132() ``` **Return Value** Type: String #### getImage230() **Signature** ```java public String getImage230() ``` **Return Value** Type: String #### getImageOriginal() **Signature** ```java public String getImageOriginal() ``` **Return Value** Type: String #### isImageDefault() Returns true if a team has not yet set a custom icon. **Signature** ```java public Boolean isImageDefault() ``` **Return Value** Type: Boolean #### setImage34(image34) **Signature** ```java public void setImage34(String image34) ``` **Parameters** _image34_ Type: String **Return Value** Type: void #### setImage44(image44) **Signature** ```java public void setImage44(String image44) ``` **Parameters** _image44_ Type: String **Return Value** Type: void #### setImage68(image68) **Signature** ```java public void setImage68(String image68) ``` **Parameters** _image68_ Type: String **Return Value** Type: void #### setImage88(image88) **Signature** ```java public void setImage88(String image88) ``` **Parameters** _image88_ Type: String **Return Value** Type: void #### setImage102(image102) **Signature** ```java public void setImage102(String image102) ``` **Parameters** _image102_ Type: String **Return Value** Type: void #### setImage132(image132) **Signature** ```java public void setImage132(String image132) ``` **Parameters** _image132_ Type: String **Return Value** Type: void #### setImage230(image230) **Signature** ```java public void setImage230(String image230) ``` **Parameters** _image230_ Type: String **Return Value** Type: void #### setImageDefault(imageDefault) **Signature** ```java public void setImageDefault(Boolean imageDefault) ``` **Parameters** _imageDefault_ Type: Boolean **Return Value** Type: void #### setImageOriginal(imageOriginal) **Signature** ```java public void setImageOriginal(String imageOriginal) ``` **Parameters** _imageOriginal_ Type: String **Return Value** Type: void ## BillableInfo Class Represents billable users information. ### BillableInfo Methods The following are methods for `BillableInfo`. #### isBillingActive() **Signature** ```java public Boolean isBillingActive() ``` **Return Value** Type: Boolean #### setBillingActive(billingActive) **Signature** ```java public void setBillingActive(Boolean billingActive) ``` **Parameters** _billingActive_ Type: Boolean ## IntegrationLogs Class Represents the integration activity logs for a team. **Usage** See Slack's [team.integrationLogs method](https://api.slack.com/methods/team.integrationLogs). ### IntegrationLogs Methods The following are methods for `IntegrationLogs`. #### getAppId() **Signature** ```java public String getAppId() ``` **Return Value** Type: String #### getAppType() **Signature** ```java public String getAppType() ``` **Return Value** Type: String #### getChangeType() **Signature** ```java public String getChangeType() ``` **Return Value** Type: String #### getChannel() **Signature** ```java public String getChannel() ``` **Return Value** Type: String #### getDate() **Signature** ```java public Integer getDate() ``` **Return Value** Type: Integer #### getReason() **Signature** ```java public String getReason() ``` **Return Value** Type: String #### getResolution() **Signature** ```java public String getResolution() ``` **Return Value** Type: String #### getRssFeedChangeType() **Signature** ```java public String getRssFeedChangeType() ``` **Return Value** Type: String #### getRssFeedTitle() **Signature** ```java public String getRssFeedTitle() ``` **Return Value** Type: String #### getRssFeedUrl() **Signature** ```java public String getRssFeedUrl() ``` **Return Value** Type: String #### getScope() **Signature** ```java public String getScope() ``` **Return Value** Type: String #### getServiceId() **Signature** ```java public String getServiceId() ``` **Return Value** Type: String #### getServiceType() **Signature** ```java public String getServiceType() ``` **Return Value** Type: String #### getUserId() **Signature** ```java public String getUserId() ``` **Return Value** Type: String #### getUserName() **Signature** ```java public String getUserName() ``` **Return Value** Type: String #### isRssFeed() **Signature** ```java public Boolean isRssFeed() ``` **Return Value** Type: Boolean #### setAppId(appId) **Signature** ```java public void setAppId(String appId) ``` **Parameters** _appId_ Type: String **Return Value** Type: void #### setAppType(appType) **Signature** ```java public void setAppType(String appType) ``` **Parameters** _appType_ Type: String **Return Value** Type: void #### setChangeType(changeType) **Signature** ```java public void setChangeType(String changeType) ``` **Parameters** _changeType_ Type: String **Return Value** Type: void #### setChannel(channel) **Signature** ```java public void setChannel(String channel) ``` **Parameters** _channel_ Type: String **Return Value** Type: void #### setDate(dateValue) **Signature** ```java public void setDate(Integer dateValue) ``` **Parameters** _dateValue_ Type: Integer **Return Value** Type: void #### setReason(reason) **Signature** ```java public void setReason(String reason) ``` **Parameters** _reason_ Type: String **Return Value** Type: void #### setResolution(resolution) **Signature** ```java public void setResolution(String resolution) ``` **Parameters** _resolution_ Type: String **Return Value** Type: void #### setRssFeed(rssFeed) **Signature** ```java public void setRssFeed(Boolean rssFeed) ``` **Parameters** _rssFeed_ Type: Boolean **Return Value** Type: void #### setRssFeedChangeType(rssFeedChangeType) **Signature** ```java public void setRssFeedChangeType(String rssFeedChangeType) ``` **Parameters** _rssFeedChangeType_ Type: String **Return Value** Type: void #### setRssFeedTitle(rssFeedTitle) **Signature** ```java public void setRssFeedTitle(String rssFeedTitle) ``` **Parameters** _rssFeedTitle_ Type: String **Return Value** Type: void #### setRssFeedUrl(rssFeedUrl) **Signature** ```java public void setRssFeedUrl(String rssFeedUrl) ``` **Parameters** _rssFeedUrl_ Type: String **Return Value** Type: void #### setScope(scope) **Signature** ```java public void setScope(String scope) ``` **Parameters** _scope_ Type: String **Return Value** Type: void #### setServiceId(serviceId) **Signature** ```java public void setServiceId(String serviceId) ``` **Parameters** _serviceId_ Type: String **Return Value** Type: void #### setServiceType(serviceType) **Signature** ```java public void setServiceType(String serviceType) ``` **Parameters** _serviceType_ Type: String **Return Value** Type: void #### setUserId(userId) **Signature** ```java public void setUserId(String userId) ``` **Parameters** _userId_ Type: String **Return Value** Type: void #### setUserName(userName) **Signature** ```java public void setUserName(String userName) ``` **Parameters** _userName_ Type: String **Return Value** Type: void ## Login Class Represents an access log entry that contains information about a user accessing Slack, IP address, and user agent combination. **Usage** See Slack's [team.accessLogs method](https://api.slack.com/methods/team.accessLogs). ### Login Methods The following are methods for `Login`. #### getCount() **Signature** ```java public Integer getCount() ``` **Return Value** Type: Integer #### getCountry() Gets the best guess on the country where the access originated, based on the IP address. **Signature** ```java public String getCountry() ``` **Return Value** Type: String #### getDateFirst() Gets the unix timestamp of the first access log entry for the user, IP address, and user agent combination. **Signature** ```java public Integer getDateFirst() ``` **Return Value** Type: Integer #### getDateLast() Get the most recent unix timestamp for the access log entry. **Signature** ```java public Integer getDateLast() ``` **Return Value** Type: Integer #### getIp() Gets the IP address of the device that's used for the user access. **Signature** ```java public String getIp() ``` **Return Value** Type: String #### getIsp() Gets Slack's best guess at the internet service provider owning the IP address. **Signature** ```java public String getIsp() ``` **Return Value** Type: String #### getRegion() Gets the best guess on the region where the access originated, based on the IP address. **Signature** ```java public String getRegion() ``` **Return Value** Type: String #### getUserAgent() **Signature** ```java public String getUserAgent() ``` **Return Value** Type: String #### getUserId() **Signature** ```java public String getUserId() ``` **Return Value** Type: String #### getUsername() **Signature** ```java public String getUsername() ``` **Return Value** Type: String #### setCount(count) **Signature** ```java public void setCount(Integer count) ``` **Parameters** _count_ Type: Integer **Return Value** Type: void #### setCountry(country) **Signature** ```java public void setCountry(String country) ``` **Parameters** _country_ Type: String **Return Value** Type: void #### setDateFirst(dateFirst) **Signature** ```java public void setDateFirst(Integer dateFirst) ``` **Parameters** _dateFirst_ Type: Integer **Return Value** Type: void #### setDateLast(dateLast) **Signature** ```java public void setDateLast(Integer dateLast) ``` **Parameters** _dateLast_ Type: Integer **Return Value** Type: void #### setIp(ip) **Signature** ```java public void setIp(String ip) ``` **Parameters** _ip_ Type: String **Return Value** Type: void #### setIsp(isp) **Signature** ```java public void setIsp(String isp) ``` **Parameters** _isp_ Type: String **Return Value** Type: void #### setRegion(region) **Signature** ```java public void setRegion(String region) ``` **Parameters** _region_ Type: String **Return Value** Type: void #### setUserAgent(userAgent) **Signature** ```java public void setUserAgent(String userAgent) ``` **Parameters** _userAgent_ Type: String **Return Value** Type: void #### setUserId(userId) **Signature** ```java public void setUserId(String userId) ``` **Parameters** _userId_ Type: String **Return Value** Type: void #### setUsername(username) **Signature** ```java public void setUsername(String username) ``` **Parameters** _username_ Type: String **Return Value** Type: void ## TeamAccessLogsRequest Class Sends a request to get the access logs for the current team. **Usage** See Slack’s [team.accessLogs method](https://api.slack.com/methods/team.accessLogs). ### TeamAccessLogsRequest Methods The following are methods for `TeamAccessLogsRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.TeamAccessLogsRequest.Builder builder() ``` **Return Value** Type: Slack.TeamAccessLogsRequest.Builder ## TeamAccessLogsRequest.Builder Class Contains methods to build an instance of the `Slack.TeamAccessLogsRequest` class. A Builder object is obtained by invoking one of the `TeamAccessLogsRequest.builder` methods defined by the `TeamAccessLogsRequest` class. ### TeamAccessLogsRequest.Builder Methods The following are methods for `TeamAccessLogsRequest.Builder`. These methods are optional unless specified otherwise. #### before(before) End of time range of logs to include in results (inclusive). The default is `now`. **Signature** ```java public Slack.TeamAccessLogsRequest.Builder before(Integer before) ``` **Parameters** _before_ Type: Integer **Return Value** Type: Slack.TeamAccessLogsRequest.Builder #### build() Required. Returns an instance of `Slack.TeamAccessLogsRequest`. **Signature** ```java public Slack.TeamAccessLogsRequest build() ``` **Return Value** Type: Slack.TeamAccessLogsRequest #### count(count) Number of items to return per page. The default is 100. **Signature** ```java public Slack.TeamAccessLogsRequest.Builder count(Integer count) ``` **Parameters** _count_ Type: Integer **Return Value** Type: Slack.TeamAccessLogsRequest.Builder #### page(page) Page number of results to return. The default is 1. **Signature** ```java public Slack.TeamAccessLogsRequest.Builder page(Integer page) ``` **Parameters** _page_ Type: Integer **Return Value** Type: Slack.TeamAccessLogsRequest.Builder #### teamId(teamId) The encoded team ID to get logs from, which is required if an org token is used. **Signature** ```java public Slack.TeamAccessLogsRequest.Builder teamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: Slack.TeamAccessLogsRequest.Builder ## TeamAccessLogsResponse Class Gets the access logs for the current team. **Usage** See Slack’s [team.accessLogs method](https://api.slack.com/methods/team.accessLogs). ### TeamAccessLogsResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `TeamAccessLogsResponse`. #### getLogins() **Signature** ```java public List getLogins() ``` **Return Value** Type: List<[Slack.Login](#login-class)> #### getPaging() **Signature** ```java public Slack.Paging getPaging() ``` **Return Value** Type: [Slack.Paging](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_paging.md) #### setLogins(logins) **Signature** ```java public void setLogins(List logins) ``` **Parameters** _logins_ Type: List<[Slack.Login](#login-class)> **Return Value** Type: void #### setPaging(paging) **Signature** ```java public void setPaging(Slack.Paging paging) ``` **Parameters** _paging_ Type: [Slack.Paging](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_paging.md) **Return Value** Type: void ## TeamBillableInfoRequest Class Sends a request to get billable users information for the current team. **Usage** See Slack's [team.billableInfo method](https://api.slack.com/methods/team.billableInfo). ### TeamBillableInfoRequest Methods The following are methods for `TeamBillableInfoRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.TeamBillableInfoRequest.Builder builder() ``` **Return Value** Type: Slack.TeamBillableInfoRequest.Builder ## TeamBillableInfoRequest.Builder Class Contains methods to build an instance of the `Slack.TeamBillableInfoRequest` class. A Builder object is obtained by invoking one of the `TeamBillableInfoRequest.builder` methods defined by the `TeamBillableInfoRequest` class. ### TeamBillableInfoRequestBuilder Methods The following are methods for `TeamBillableInfoRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of `Slack.TeamBillableInfoRequest`. **Signature** ```java public Slack.TeamBillableInfoRequest build() ``` **Return Value** Type: Slack.TeamBillableInfoRequest #### teamId(teamId) The encoded team ID to get billable information from, which is required if an org token is used. **Signature** ```java public Slack.TeamBillableInfoRequest.Builder teamId(String teamId) ``` **Parameters** _teamId_ Type: String #### user(user) A user to retrieve the billable information for. The default is to return all users. **Signature** ```java public Slack.TeamBillableInfoRequest.Builder user(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: Slack.TeamBillableInfoRequest.Builder ## TeamBillableInfoResponse Class Gets billable users information for the current team. **Usage** See Slack's [team.billableInfo method](https://api.slack.com/methods/team.billableInfo). ### TeamBillableInfoResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `TeamBillableInfoResponse`. #### getBillableInfo() **Signature** ```java public Map getBillableInfo() ``` **Return Value** Type: Map #### setBillableInfo(billableInfo) **Signature** ```java public void setBillableInfo(Map billableInfo) ``` **Parameters** _billableInfo_ Type: Map **Return Value** Type: void ## TeamInfoRequest Class Sends a request to get information about the current team. **Usage** See Slack’s [team.info method](https://api.slack.com/methods/team.info). ### TeamInfoRequest Methods The following are methods for `TeamInfoRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.TeamInfoRequest.Builder builder() ``` **Return Value** Type: Slack.TeamInfoRequest.Builder ## TeamInfoRequest.Builder Class Contains methods to build an instance of the `Slack.TeamInfoRequest` class. A Builder object is obtained by invoking one of the `TeamInfoRequest.builder` methods defined by the `TeamInfoRequest` class. ### TeamInfoRequest.Builder Methods The following are methods for `TeamInfoRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of the `Slack.TeamInfoRequest` object. **Signature** ```java public Slack.TeamInfoRequest build() ``` **Return Value** Type: Slack.TeamInfoRequest #### team(team) **Signature** ```java public Slack.TeamInfoRequest.Builder team(String team) ``` **Parameters** team Type: String **Return Value** Type: [Slack.TeamInfoRequest.Builder](#teaminforequestbuilder-class) ## TeamInfoResponse Class Gets information about the current team. **Usage** See Slack’s [team.info method](https://api.slack.com/methods/team.info). ### TeamInfoResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `TeamInfoResponse`. #### getTeam() **Signature** ```java public Slack.Team getTeam() ``` **Return Value** Type: Slack.Team #### setTeam(team) **Signature** ```java public void setTeam(Slack.Team team) ``` **Parameters** _team_ Type: Slack.Team **Return Value** Type: void ## TeamIntegrationLogsRequest Class Sends a request to get the integration logs for the current team. **Usage** See Slack’s [team.integrationLogs method](https://api.slack.com/methods/team.integrationLogs). ### TeamIntegrationLogsRequest Methods The following are methods for `TeamIntegrationLogsRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.TeamIntegrationLogsRequest.Builder builder() ``` **Return Value** Type: Slack.TeamIntegrationLogsRequest.Builder ## TeamIntegrationLogsRequest.Builder Class Contains methods to build an instance of the `Slack.TeamIntegrationLogsRequest` class. A Builder object is obtained by invoking one of the `TeamIntegrationLogsRequest.builder` methods defined by the `TeamIntegrationLogsRequest` class. ### TeamIntegrationLogsRequest.Builder Methods The following are methods for `TeamIntegrationLogsRequest.Builder`. These methods are optional unless specified otherwise. #### appId(appId) Filters logs using the ID of this Slack app. The default is to return all logs. **Signature** ```java public Slack.TeamIntegrationLogsRequest.Builder appId(String appId) ``` **Parameters** _appId_ Type: String **Return Value** Type: Slack.TeamIntegrationLogsRequest.Builder #### build() Required. Returns an instance of the `Slack.TeamIntegrationLogsRequest` object. **Signature** ```java public Slack.TeamIntegrationLogsRequest build() ``` **Return Value** Type: Slack.TeamIntegrationLogsRequest #### changeType(changeType) Filters logs using this change type. Valid values are `added`, `removed`, `enabled`, `disabled`, and `updated`. The default is to return all logs. **Signature** ```java public Slack.TeamIntegrationLogsRequest.Builder changeType(String changeType) ``` **Parameters** _changeType_ Type: String **Return Value** Type: Slack.TeamIntegrationLogsRequest.Builder #### count(count) The number of items to return per page. The default is 100. **Signature** ```java public Slack.TeamIntegrationLogsRequest.Builder count(Integer count) ``` **Parameters** _count_ Type: Integer **Return Value** Type: Slack.TeamIntegrationLogsRequest.Builder #### page(page) The page number of results to return. The default is 1. **Signature** ```java public Slack.TeamIntegrationLogsRequest.Builder page(Integer page) ``` **Parameters** _page_ Type: Integer **Return Value** Type: Slack.TeamIntegrationLogsRequest.Builder #### serviceId(serviceId) Filters logs using this service. The default is to return all logs. **Signature** ```java public Slack.TeamIntegrationLogsRequest.Builder serviceId(String serviceId) ``` **Parameters** _serviceId_ Type: String **Return Value** Type: Slack.TeamIntegrationLogsRequest.Builder #### teamId(teamId) The encoded team ID to get logs from, which is required if an org token is used. **Signature** ```java public Slack.TeamIntegrationLogsRequest.Builder teamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: Slack.TeamIntegrationLogsRequest.Builder #### user(user) Filters logs generated by this user’s actions. The default is to return all logs. **Signature** ```java public Slack.TeamIntegrationLogsRequest.Builder user(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: Slack.TeamIntegrationLogsRequest.Builder ## TeamIntegrationLogsResponse Class Gets the integration logs for the current team. **Usage** See Slack’s [team.integrationLogs method](https://api.slack.com/methods/team.integrationLogs). ### TeamIntegrationLogsResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `TeamIntegrationLogsResponse`. #### getLogs() **Signature** ```java public List getLogs() ``` **Return Value** Type: List #### getPaging() **Signature** ```java public Slack.Paging getPaging() ``` **Return Value** Type: [Slack.Paging](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_paging.md) #### setLogs(logs) **Signature** ```java public void setLogs(List logs) ``` **Parameters** _logs_ Type: List **Return Value** Type: void #### setPaging(paging) **Signature** ```java public void setPaging(Slack.Paging paging) ``` **Parameters** _paging_ Type: [Slack.Paging](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_paging.md) **Return Value** Type: void ## TeamProfileGetRequest Class Sends a request to retrieve a team's profile. **Usage** See Slack’s [team.profile.get method](https://api.slack.com/methods/team.profile.get). ### TeamProfileGetRequest Methods The following are methods for `TeamProfileGetRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.TeamProfileGetRequest.Builder builder() ``` **Return Value** Type: Slack.TeamProfileGetRequest.Builder ## TeamProfileGetRequestBuilder.Builder Class Contains methods to build an instance of the `Slack.TeamProfileGetRequest` class. A Builder object is obtained by invoking one of the `TeamProfileGetRequest.builder` methods defined by the `TeamProfileGetRequest` class. ### TeamProfileGetRequest.Builder Methods The following are methods for `TeamProfileGetRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of `Slack.TeamProfileGetRequest`. **Signature** ```java public Slack.TeamProfileGetRequest build() ``` **Return Value** Type: Slack.TeamProfileGetRequest #### teamId(teamId) **Signature** ```java public Slack.TeamProfileGetRequest.Builder teamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: Slack.TeamProfileGetRequest.Builder #### visibility(visibility) Filters by visibility. Valid values are `all`, `visible`, or `hidden`. The default is `all`. **Signature** ```java public Slack.TeamProfileGetRequest.Builder visibility(String visibility) ``` **Parameters** _visibility_ Type: String **Return Value** Type: Slack.TeamProfileGetRequest.Builder ## TeamProfileGetResponse Class Retrieve a team's profile. **Usage** See Slack’s [team.profile.get method](https://api.slack.com/methods/team.profile.get). ### TeamProfileGetResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `TeamProfileGetResponse`. #### getProfile() Gets the team’s profile. **Signature** ```java public Slack.TeamProfileGetResponse.Profiles getProfile() ``` **Return Value** Type: Slack.TeamProfileGetResponse.Profiles #### setProfile(profile) **Signature** ```java public void setProfile(Slack.TeamProfileGetResponse.Profiles profile) ``` **Parameters** _profile_ Type: Slack.TeamProfileGetResponse.Profiles **Return Value** Type: void # Work with the Test Harness Use the `TestHarness` class to test your Apex SDK for Slack apps. ## TestHarness Class Represents a test with a Slack state and user session. **Usage** The `TestHarness` class enables you to mock the Apex SDK for Slack elements for running in a test environment, allowing the creation of a Slack state and user session as needed. See [Test Slack Apps](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/test/test.md). ### TestHarness Methods The following are methods for `TestHarness`. #### getNewSlackState() **Signature** ```java public Slack.TestHarness.State getNewSlackState() ``` **Return Value** Type: [Slack.TestHarness.State](#testharnessstate-class) ## TestHarness.Actions Class Represents an [actions layout component](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/layout.md#actions) in a view for the test harness. **Usage** Use `TestHarness.Actions` to work with actions, such as testing a button or querying an external select component. ```java Slack.TestHarness.Actions actions = (Slack.TestHarness.Actions)modal.getComponentByName('my_action_name', Slack.TestHarness.Actions.class); Slack.TestHarness.ExternalSelect externalSelect = (Slack.TestHarness.ExternalSelect)actions.getComponentByName('my_component_name', Slack.TestHarness.ExternalSelect.class); externalSelect.query('Lookup'); ``` The `Slack.TestHarness.Actions` object is returned as a window object, which is then cast back into a `Slack.TestHarness.Actions` object. Get the component by name by casting it back to a `Slack.TestHarness.Actions` object. See [Classes and Casting](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_casting.htm). ### TestHarness.Actions Methods The following are methods for `TestHarness.Actions`. #### getComponent(idx, clazz) Gets a child component in the given index on the actions layout component. **Signature** ```java public Object getComponent(Integer idx, System.Type clazz) ``` **Parameters** _idx_ Type: Integer The index of the component _clazz_ Type: [System.Type](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_type.htm) The Apex type of the component **Return Value** Type: Object #### getComponentByName(name, clazz) Gets a child component on the actions layout component by name. **Signature** ```java public Object getComponentByName(String name, System.Type clazz) ``` **Parameters** _name_ Type: String The name of the actions component _clazz_ Type: [System.Type](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_type.htm) The Apex type of the component #### getComponentCount() Gets the number of child components for the actions component. **Signature** ```java public Integer getComponentCount() ``` **Return Value** Type: Integer #### getName() **Signature** ```java public String getName() ``` **Return Value** Type: String ## TestHarness.Button Class Represents a [button component](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/elements.md#button) in a view for the test harness. ### TestHarness.Button Methods The following are methods for `TestHarness.Button`. #### click() Simulates clicking a button. **Signature** ```java public void click() ``` **Return Value** Type: void #### getConfirm() Gets the [confirm composition object](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/composition.md#confirm) for the button. **Signature** ```java public Slack.TestHarness.Confirm getConfirm() ``` **Return Value** Type: [Slack.TestHarness.Confirm](#testharnessconfirm-class) #### getLabel() Gets the label for the button. **Signature** ```java public String getLabel() ``` **Return Value** Type: String #### getName() Gets the name for the button. **Signature** ```java public String getName() ``` **Return Value** Type: String #### getStyle() Gets the style for the button. **Signature** ```java public String getStyle() ``` **Return Value** Type: String #### getUrl() Gets the URL for the button. **Signature** ```java public String getUrl() ``` **Return Value** Type: String #### getValue() Gets the value for the button. **Signature** ```java public String getValue() ``` **Return Value** Type: String ## TestHarness.Channel Class Represents a channel for the test harness. ### TestHarness.Channel Methods The following are methods for `TestHarness.Channel`. #### addUser(user) Adds a user to the channel. **Signature** ```java public void addUser(Slack.TestHarness.User user) ``` **Parameters** _user_ Type: Slack.TestHarness.User Adds the specified user to the channel. Returns an exception if the user doesn't belong to the channel. **Return Value** Type: void #### canBeOpenedByUser(user) Gets if the specified user is able to open the channel. **Signature** ```java public Boolean canBeOpenedByUser(Slack.TestHarness.User user) ``` **Parameters** _user_ Type: Slack.TestHarness.User #### getId() Gets the channel ID. **Signature** ```java public String getId() ``` **Return Value** Type: String #### getLocale() **Signature** ```java public String getLocale() ``` **Return Value** Type: String #### getMessageCount(user) Gets the message count on the channel for the specified user. **Signature** ```java public Integer getMessageCount(Slack.TestHarness.User user) ``` **Parameters** _user_ Type: Slack.TestHarness.User **Return Value** Type: Integer #### getMessages(user) Gets the list of messages for the channel for the specified user. **Signature** ```java public List getMessages(Slack.TestHarness.User user) ``` **Parameters** _user_ Type: Slack.TestHarness.User **Return Value** Type: List #### getName() Gets the name for the channel. **Signature** ```java public String getName() ``` **Return Value** Type: String #### getTeam() Gets the team for the channel. **Signature** ```java public Slack.TestHarness.Team getTeam() ``` **Return Value** Type: Slack.TestHarness.Team #### isPrivate() Returns true if the channel is private, or false otherwise. **Signature** ```java public Boolean isPrivate() ``` **Return Value** Type: Boolean #### removeUser(user) Removes the specified user from the channel. **Signature** ```java public void removeUser(Slack.TestHarness.User user) ``` **Parameters** _user_ Type: Slack.TestHarness.User **Return Value** Type: void #### sendMessage(userSession, text) Simulates sending a message to the channel from the user's session. **Signature** ```java public Slack.TestHarness.Message sendMessage(Slack.TestHarness.UserSession userSession, String text) ``` **Parameters** _userSession_ Type: Slack.TestHarness.UserSession _text_ Type: String ## TestHarness.Checkbox Class Represents a [checkbox component](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/elements.md#checkbox) in a view for the test harness. ### TestHarness.Checkbox Methods The following are methods for `TestHarness.Checkbox`. #### getConfirm() Gets the [confirm composition object](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/composition.md#confirm) for the checkbox. **Signature** ```java public Slack.TestHarness.Confirm getConfirm() ``` **Return Value** Type: [Slack.TestHarness.Confirm](#testharnessconfirm-class) #### getDescription() Gets the description for the checkbox. **Signature** ```java public String getDescription() ``` **Return Value** Type: String #### getInitialValue() Gets the initial value for the checkbox. **Signature** ```java public Boolean getInitialValue() ``` **Return Value** Type: Boolean #### getLabel() Gets the label for the checkbox. **Signature** ```java public String getLabel() ``` #### getName() Gets the name of the checkbox. **Signature** ```java public String getName() ``` **Return Value** Type: String #### getValue() Gets the value of the checkbox. **Signature** ```java public Boolean getValue() ``` **Return Value** Type: Boolean #### setValue(value) Sets the value of the checkbox. If the checkbox contains an `onchange` event, an action is fired. **Signature** ```java public void setValue(Boolean value) ``` **Parameters** _value_ Type: Boolean **Return Value** Type: void #### toggleValue() Toggles the value of the checkbox. If the checkbox contains an `onchange` event, an action is fired. **Signature** ```java public void toggleValue() ``` **Return Value** Type: void ## TestHarness.CheckboxGroup Class Represents a [checkbox group component](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/elements.md#checkbox-group) in a view for the test harness. ### TestHarness.CheckboxGroup Methods The following are methods for `TestHarness.CheckboxGroup`. #### getConfirm() Gets the [confirm composition object](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/composition.md#confirm) for the checkbox group. **Signature** ```java public Slack.TestHarness.Confirm getConfirm() ``` **Return Value** Type: [Slack.TestHarness.Confirm](#testharnessconfirm-class) #### getDescription() **Signature** ```java public String getDescription() ``` **Return Value** Type: String #### getInitialValue() Gets the initial value for the checkbox group. **Signature** ```java public List getInitialValue() ``` **Return Value** Type: List\ #### getLabel() **Signature** ```java public String getLabel() ``` **Return Value** Type: String #### getName() Gets the name of the checkbox group. **Signature** ```java public String getName() ``` **Return Value** Type: String #### getValue() Gets the value of the checkbox group. **Signature** ```java public List getValue() ``` **Return Value** Type: List\ #### setValue(listOfIdentifiers) Sets the value of the checkbox group. If the checkbox group contains an `onchange` event, an action is fired. **Signature** ```java public void setValue(List listOfIdentifiers) ``` **Parameters** _listOfIdentifiers_ Type: List\ **Return Value** Type: void #### toggleValue(option) **Signature** ```java public void toggleValue(Slack.TestHarness.Option option) ``` **Parameters** _option_ Type: Slack.TestHarness.Option **Return Value** Type: void #### toggleValue(identifier) Toggles the value of an individual option for the checkbox group. If the checkbox group contains an `onchange` event, an action is fired. **Signature** ```java public void toggleValue(String identifier) ``` **Parameters** _identifier_ Type: String **Return Value** Type: void ## TestHarness.Confirm Class Represents a [confirm composition object](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/composition.md#confirm) in a view for the test harness. ### TestHarness.Confirm Methods The following are methods for `TestHarness.Confirm`. #### getConfirm() Gets the confirm button text. **Signature** ```java public String getConfirm() ``` **Return Value** Type: String #### getDeny() Gets the deny button text. **Signature** ```java public String getDeny() ``` **Return Value** Type: String #### getStyle() Gets the confirmation style. **Signature** ```java public String getStyle() ``` **Return Value** Type: String #### getText() Gets the confirmation dialog text. **Signature** ```java public String getText() ``` **Return Value** Type: String #### getTitle() Gets the confirmation dialog title. **Signature** ```java public String getTitle() ``` **Return Value** Type: String ## TestHarness.Context Class Represents the [context layout component](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/layout.md#context) in a view for the test harness. ### TestHarness.Context Methods The following are methods for `TestHarness.Context`. #### getComponent(idx, clazz) Gets a child component in a given index on the context component. **Signature** ```java public Object getComponent(Integer idx, System.Type clazz) ``` **Parameters** _idx_ Type: Integer The index of the component _clazz_ Type: [System.Type](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_type.htm) The Apex type of the component **Return Value** Type: Object #### getComponentCount() Gets the number of child components on the context component. **Signature** ```java public Integer getComponentCount() ``` **Return Value** Type: Integer #### getName() Gets the name of the context component. **Signature** ```java public String getName() ``` **Return Value** Type: String ## TestHarness.ConversationsSelect Class Represents a [conversations select component](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/elements.md#conversations-select) in a view for the test harness. ### TestHarness.ConversationsSelect Methods The following are methods for `TestHarness.ConversationsSelect`. #### getConfirm() Gets the [confirm composition object](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/composition.md#confirm) for the component. **Signature** ```java public Slack.TestHarness.Confirm getConfirm() ``` **Return Value** Type: [Slack.TestHarness.Confirm](#testharnessconfirm-class) #### getFilter() Gets the [filter composition object](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/composition.md#filter) for the conversations select. **Signature** ```java public Slack.TestHarness.Filter getFilter() ``` **Return Value** Type: Slack.TestHarness.Filter #### getInitialMultiselectValue() Gets the initial value for the conversations select. If the component isn’t a multi-select, an exception is thrown. **Signature** ```java public List getInitialMultiselectValue() ``` **Return Value** Type: List\ #### getInitialValue() Gets the initial value for the conversations select. If the component is a multi-select, an exception is thrown. **Signature** ```java public String getInitialValue() ``` **Return Value** Type: String #### getMaxSelection() Gets the max selection for the conversations select. Returns 1 if the component isn’t a multi-select. **Signature** ```java public Integer getMaxSelection() ``` **Return Value** Type: Integer #### getMultiselectValue() Gets the value for the conversations select. If the component isn’t a multi-select, an exception is thrown. **Signature** ```java public List getMultiselectValue() ``` **Return Value** Type: List\ #### getName() Gets the name for the conversations select. **Signature** ```java public String getName() ``` **Return Value** Type: String #### getOptions() Gets the list of options for the conversations select. **Signature** ```java public List getOptions() ``` **Return Value** Type: List #### getPlaceholder() Gets the placeholder for the conversations select. **Signature** ```java public String getPlaceholder() ``` **Return Value** Type: String #### getValue() Gets the value for the component. If the component is a multi-select, an exception is thrown. **Signature** ```java public String getValue() ``` **Return Value** Type: String #### isMultiselect() Returns true if the conversations select is a multi-select. **Signature** ```java public Boolean isMultiselect() ``` **Return Value** Type: Boolean #### setMultiselectValue(listOfIdentifiers) Sets the value of the conversations select. If the conversations select contains an `onchange` event, an action is fired. If the component isn’t a multi-select, an exception is thrown. **Signature** ```java public void setMultiselectValue(List listOfIdentifiers) ``` **Parameters** _listOfIdentifiers_ Type: List\ **Return Value** Type: void #### setValue(identifier) Sets the value of the conversations select. If the conversations select contains an `onchange` event, an action is fired. If the conversations select is a multi-select, an exception is thrown. **Signature** ```java public void setValue(String identifier) ``` **Parameters** _identifier_ Type: String ## TestHarness.Datasource Class Represents a [datasource composition object](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/composition.md#datasource) for the test harness. ### TestHarness.Datasource Methods The following are methods for `TestHarness.Datasource`. #### getDefinition() **Signature** ```java public String getDefinition() ``` **Return Value** Type: String #### getProperties() **Signature** ```java public Map getProperties() ``` **Return Value** Type: Map ## TestHarness.DatePicker Class Represents a [date picker component](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/elements.md#date-picker) in a view for the test harness. ### TestHarness.DatePicker Methods The following are methods for `TestHarness.DatePicker`. #### getConfirm() Gets the [confirm composition object](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/composition.md#confirm) for the date picker. **Signature** ```java public Slack.TestHarness.Confirm getConfirm() ``` **Return Value** Type: Slack.TestHarness.Confirm #### getInitialValue() Gets the initial value for the date picker. **Signature** ```java public String getInitialValue() ``` **Return Value** Type: String #### getName() Gets the name for the date picker. **Signature** ```java public String getName() ``` **Return Value** Type: String #### getPlaceholder() Gets the placeholder for the date picker. ```java public String getPlaceholder() ``` **Return Value** Type: String #### getValue() Gets the value for the date picker. **Signature** ```java public String getValue() ``` **Return Value** Type: String #### setValue(value) Sets the value for the date picker. **Signature** ```java public void setValue(String value) ``` **Parameters** _value_ Type: String ## TestHarness.DateTimePicker Class Represents a [date time picker component](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/uisf.md#date-time-picker) in a view for the test harness. ### TestHarness.DateTimePicker Methods The following are methods for `TestHarness.DateTimePicker`. #### getConfirm() Gets the [confirm composition object](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/composition.md#confirm) for the date time picker. **Signature** ```java public Slack.TestHarness.Confirm getConfirm() ``` **Return Value** Type: [Slack.TestHarness.Confirm](#testharnessconfirm-class) #### getDateLabel() Gets the label for the date input. **Signature** ```java public String getDateLabel() ``` **Return Value** Type: String #### getInitialValue() Gets the initial value for the date time picker. **Signature** ```java public String getInitialValue() ``` **Return Value** Type: String #### getName() Gets the name for the date time picker. **Signature** ```java public String getName() ``` **Return Value** Type: String #### getPlaceholder() Gets the placeholder for the date time picker. **Signature** ```java public String getPlaceholder() ``` **Return Value** Type: String #### getRequired() Gets the `required` value for the date time picker. **Signature** ```java public Boolean getRequired() ``` **Return Value** Type: Boolean #### getSubmissionName() Gets the submission name for the date time picker. **Signature** ```java public String getSubmissionName() ``` **Return Value** Type: String #### getTimeLabel() Gets the label for the time input. **Signature** ```java public String getTimeLabel() ``` **Return Value** Type: String #### getValue() Gets the value for the date time picker. **Signature** ```java public String getValue() ``` **Return Value** Type: String #### setDateValue(value) Sets the date value on the component. **Signature** ```java public void setDateValue(String value) ``` **Parameters** _value_ Type: String **Return Value** Type: void #### setTimeValue(value) Sets the time value on the component. **Signature** ```java public void setTimeValue(String value) ``` **Parameters** _value_ Type: String **Return Value** Type: void #### setValue(value) Sets the value for the date time picker. **Signature** ```java public void setValue(String value) ``` **Parameters** _value_ Type: String **Return Value** Type: void ## TestHarness.Divider Class Represents a [divider component](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/layout.md#divider) in a view for the test harness. ### TestHarness.Divider Methods The following are methods for `TestHarness.Divider`. #### getName() Gets the name for the divider. **Signature** ```java public String getName() ``` **Return Value** Type: String ## TestHarness.Enterprise Class Represents a Slack Enterprise for the test harness. ### TestHarness.Enterprise Methods The following are methods for `TestHarness.Enterprise`. #### getId() Gets the ID for the enterprise **Signature** ```java public String getId() ``` **Return Value** Type: String #### getName() Gets the name for the enterprise. **Signature** ```java public String getName() ``` **Return Value** Type: String ## TestHarness.ExternalSelect Class Represents an [external select component](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/elements.md#external-select) in a view for the test harness. ### TestHarness.ExternalSelect Methods The following are methods for `TestHarness.ExternalSelect`. #### getConfirm() Gets the [confirm composition object](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/composition.md#confirm) for the external select. **Signature** ```java public Slack.TestHarness.Confirm getConfirm() ``` **Return Value** Type: Slack.TestHarness.Confirm #### getDatasource() Gets the [datasource composition object](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/composition.md#datasource) for the external select. **Signature** ```java public Slack.TestHarness.Datasource getDatasource() ``` **Return Value** Type: Slack.TestHarness.Datasource #### getInitialMultiselectValue() Gets the initial value for the external select. If the component isn’t a multi-select, an exception is thrown. **Signature** ```java public List getInitialMultiselectValue() ``` **Return Value** #### getInitialOptions() Gets the initial list of resolved options for the component. **Signature** ```java public List getInitialOptions() ``` **Return Value** Type: List #### getInitialValue() Gets the initial value for the external select. If the component is a multi-select, an exception is thrown. **Signature** ```java public String getInitialValue() ``` **Return Value** Type: String #### getMaxSelection() Gets the max selection for the external select. Returns 1 if the component isn’t a multi-select. **Signature** ```java public Integer getMaxSelection() ``` **Return Value** Type: Integer #### getMinQueryLength() Gets the min query length for the external select. **Signature** ```java public Integer getMinQueryLength() ``` **Return Value** Type: Integer #### getMultiselectValue() Gets the value for the external select. If the component isn’t a multi-select, an exception is thrown. **Signature** ```java public List getMultiselectValue() ``` **Return Value** Type: List\ #### getName() Gets the name for the external select. **Signature** ```java public String getName() ``` **Return Value** Type: String #### getOptionGroups() **Signature** ```java public List getOptionGroups() ``` **Return Value** Type: List #### getOptions() Gets the list of options for the external select. **Signature** ```java public List getOptions() ``` **Return Value** Type: List #### getPlaceholder() Gets the placeholder for the external select. **Signature** ```java public String getPlaceholder() ``` **Return Value** Type: String #### getValue() Gets the value for the external select. If the component is a multi-select, an exception is thrown. **Signature** ```java public String getValue() ``` **Return Value** Type: String #### isMultiselect() Returns true if the external select is a multi-select. **Signature** ```java public Boolean isMultiselect() ``` **Return Value** Type: Boolean #### query(query) Simulates a query on the external select. If the min query length isn’t met, an exception is thrown. **Signature** ```java public void query(String query) ``` **Parameters** _query_ Type: String **Return Value** Type: void #### setMultiselectValue(listOfIdentifiers) Sets the value of the external select. If the external select contains an `onchange` event, an action is fired. If the component isn’t a multi-select, an exception is thrown. **Signature** ```java public void setMultiselectValue(List listOfIdentifiers) ``` **Parameters** _listOfIdentifiers_ Type: List\ **Return Value** Type: void #### setValue(identifier) Sets the value of the external select. If the external select contains an `onchange` event, an action is fired. If the component is a multi-select, an exception is thrown. **Signature** ```java public void setValue(String identifier) ``` **Parameters** _identifier_ Type: String **Return Value** Type: void ## TestHarness.File Class ### TestHarness.File Methods The following are methods for `TestHarness.File '. #### clone() **Signature** ```java public Object clone() ``` **Return Value** Type: Object #### getExternalId() **Signature** ```java public String getExternalId() ``` **Return Value** Type: String #### getName() **Signature** ```java public String getName() ``` **Return Value** Type: String #### getSource() **Signature** ```java public String getSource() ``` **Return Value** Type: String #### toString() **Signature** ```java public String toString() ``` **Return Value** Type: String ## TestHarness.Filter Class Represents a [filter composition object](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/composition.md#filter) in a view for the test harness. ### TestHarness.Filter Methods The following are methods for `TestHarness.Filter`. #### getExcludeBotUsers() Gets the `excludeBotUsers` value for the filter object. **Signature** ```java public Boolean getExcludeBotUsers() ``` **Return Value** Type: Boolean #### getExcludeExternalShared() Gets the resolved exclude external shared value for the filter object. **Signature** ```java public Boolean getExcludeExternalShared() ``` **Return Value** Type: Boolean #### getInclude() Gets the `include` list for the filter object. **Signature** ```java public List getInclude() ``` **Return Value** Type: List\ ## TestHarness.Header Class Represents a [header component](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/layout.md#header) in a view for the test harness. ### TestHarness.Header Methods The following are methods for `TestHarness.Header`. #### getName() Gets the name for the header. **Signature** ```java public String getName() ``` **Return Value** Type: String #### getText() Gets the text for the header. **Signature** ```java public String getText() ``` **Return Value** Type: String ## TestHarness.Home Class Represents a [home surface component](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/surface.md#home) in a view for the test harness. ### TestHarness.Home Methods The following are methods for `TestHarness.Home`. #### getButtonByLabel(label) Gets a button component by its label value. **Signature** ```java public Slack.TestHarness.Button getButtonByLabel(String label) ``` **Return Value** Type: Slack.TestHarness.Button #### getComponent(idx, clazz) Gets a child component on the home component. **Signature** ```java public Object getComponent(Integer idx, System.Type clazz) ``` **Parameters** _idx_ Type: Integer _clazz_ Type: [System.Type](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_type.htm) **Return Value** Type: Object #### getComponentByName(name, clazz) **Signature** ```java public Object getComponentByName(String name, System.Type clazz) ``` **Return Value** _name_ Type: String _clazz_ Type: System.Type **Return Value** Type: Object #### getComponentCount() Gets the number of child components on the home component. **Signature** ```java public Integer getComponentCount() ``` **Return Value** Type: Integer #### getInputByLabel(label) **Signature** ```java public Slack.TestHarness.Input getInputByLabel(String label) ``` **Parameters** _label_ Type: String **Return Value** Type: [Slack.TestHarness.Input](#testharnessinput-class) ## TestHarness.Image Class Represents an [image component](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/layout.md#image) in a view for the test harness. ### TestHarness.Image Methods The following are methods for `TestHarness.Image`. #### getAltText() Gets the alternative text for the image. **Signature** ```java public String getAltText() ``` **Return Value** Type: String #### getImageUrl() Gets the URL for the image. **Signature** ```java public String getImageUrl() ``` **Return Value** Type: String #### getName() Gets the name for the image. **Signature** ```java public String getName() ``` **Return Value** Type: String #### getTitle() Gets the title for the image. **Signature** ```java public String getTitle() ``` **Return Value** Type: String ## TestHarness.InlineImage Class Represents an [inline image component](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/elements.md#inline-image) in a view for the test harness. ### TestHarness.InlineImage Methods The following are methods for `TestHarness.InlineImage`. #### getAltText() Gets the alternative text for the inline image. **Signature** ```java public String getAltText() ``` **Return Value** Type: String #### getImageUrl() Gets the URL for the inline image. **Signature** ```java public String getImageUrl() ``` **Return Value** Type: String #### getName() Gets the name for the inline image. **Signature** ```java public String getName() ``` **Return Value** Type: String ## TestHarness.Input Class Represents an [input layout component](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/layout.md#input) in a view for a test harness. ### TestHarness.Input Methods The following are methods for `TestHarness.Input`. #### getComponent(clazz) Gets a child component on the input component. **Signature** ```java public Object getComponent(System.Type clazz) ``` **Parameters** _clazz_ Type: [System.Type](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_type.htm) **Return Value** Type: Object #### getComponentByName(name, clazz) Gets a child component on the input component by name. **Signature** ```java public Object getComponentByName(String name, System.Type clazz) ``` **Parameters** _name_ Type: String _clazz_ Type: [System.Type](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_type.htm) **Return Value** Type: Object #### getHint() Gets the hint for the input component. **Signature** ```java public String getHint() ``` **Return Value** Type: String #### getLabel() Gets the label for the input component. **Signature** ```java public String getLabel() ``` **Return Value** Type: String #### getName() Gets the name for the input component. **Signature** ```java public String getName() ``` **Return Value** Type: String #### isRequired() Returns true if the input component is required. **Signature** ```java public Boolean isRequired() ``` **Return Value** Type: Boolean ## TestHarness.Message Class Represents a [message surface component](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/surface.md#message) in a view for the test harness. ### TestHarness.Message Methods The following are methods for `TestHarness.Message`. #### canBySeenByUser(user) Returns true if the message can be seen by the specified user. **Signature** ```java public Boolean canBySeenByUser(Slack.TestHarness.User user) ``` **Parameters** _user_ Type: Slack.TestHarness.User **Return Value** Type: Boolean #### getButtonByLabel(label) Gets a button component by its label value. **Signature** ```java public Slack.TestHarness.Button getButtonByLabel(String label) ``` **Parameters** _label_ Type: String **Return Value** Type: [Slack.TestHarness.Button](#testharnessbutton-class) #### getChannel() Gets the channel value for the message. **Signature** ```java public Slack.TestHarness.Channel getChannel() ``` **Return Value** Type: [Slack.TestHarness.Channel](#testharnesschannel-class) #### getComponent(idx, clazz) Gets a child component in a given index on the message component. **Signature** ```java public Object getComponent(Integer idx, System.Type clazz) ``` **Parameters** _idx_ Type: Integer _clazz_ Type: [System.Type](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_type.htm) **Return Value** Type: Object #### getComponentByName(name, clazz) Gets a child component on the message component by name. **Signature** ```java public Object getComponentByName(String name, System.Type clazz) ``` **Return Value** Type: String #### getComponentCount() Gets the number of child components for the message component. **Signature** ```java public Integer getComponentCount() ``` **Return Value** Type: Integer #### getInputByLabel(label) Gets the input component by label for the message component. **Signature** ```java public Slack.TestHarness.Input getInputByLabel(String label) ``` **Parameters** _label_ Type: String **Return Value** Type: [Slack.TestHarness.Input](#testharnessinput-class) #### getMessageTs() Gets the timestamp for the message. **Signature** ```java public String getMessageTs() ``` **Return Value** Type: String #### getText() Gets the text for the message. **Signature** ```java public String getText() ``` **Return Value** Type: String #### isEphemeralMessage() Returns true if the message is ephemeral. **Signature** ```java public Boolean isEphemeralMessage() ``` **Return Value** Type: Boolean ## TestHarness.Modal Class Represents a [modal surface component](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/surface.md#modal) in a view for the test harness. ### TestHarness.Modal Methods The following are methods for `TestHarness.Modal`. #### close() Simulates closing a modal, which returns the `view_closed` payload. **Signature** ```java public void close() ``` **Return Value** Type: void #### getButtonByLabel(label) Gets a button component by its label value. **Signature** ```java public Slack.TestHarness.Button getButtonByLabel(String label) ``` **Parameters** _label_ Type: String **Return Value** Type: [Slack.TestHarness.Button](#testharnessbutton-class) #### getCloseLabel() Gets the close label for the modal. **Signature** ```java public String getCloseLabel() ``` **Return Value** Type: String #### getComponent(idx, clazz) Gets a child component in the given index on the modal component. **Signature** ```java public Object getComponent(Integer idx, System.Type clazz) ``` **Parameters** _idx_ Type: Integer _clazz_ Type: [System.Type](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_type.htm) **Return Value** Type: Object #### getComponentByName(name, clazz) Gets a child component on the modal component by name. **Signature** ```java public Object getComponentByName(String name, System.Type clazz) ``` **Parameters** _name_ Type: String _clazz_ Type: [System.Type](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_type.htm) **Return Value** Type: Object #### getComponentCount() Gets the number of child components for the modal component. **Signature** ```java public Integer getComponentCount() ``` **Return Value** Type: Integer #### getInputByLabel(label) Gets an input block component by its label value. **Signature** ```java public Slack.TestHarness.Input getInputByLabel(String label) ``` **Parameters** _label_ Type: String **Return Value** Type: [Slack.TestHarness.Input](#testharnessinput-class) #### getInputError(inputBlockName) Gets any input error for a given input block by name. **Signature** ```java public String getInputError(String inputBlockName) ``` **Parameters** _inputBlockName_ Type: String **Return Value** Type: String #### getInputErrorBlocks() **Signature** ```java public List getInputErrorBlocks() ``` **Return Value** Type: List #### getSubmitLabel() **Signature** ```java public String getSubmitLabel() ``` **Return Value** Type: String #### getTitle() **Signature** ```java public String getTitle() ``` **Return Value** Type: String #### hasInputErrors() **Signature** ```java public Boolean hasInputErrors() ``` **Return Value** Type: Boolean #### submit() **Signature** ```java public void submit() ``` **Return Value** Type: void ## TestHarness.Option Class Represents an [option component](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/composition.md#options) in a view for a test harness. ### TestHarness.Option Methods The following are methods for `TestHarness.Option`. #### getDescription() Gets the description for the option. **Signature** ```java public String getDescription() ``` **Return Value** Type: String #### getIdentifier() Gets the identifier for the option. **Signature** ```java public String getIdentifier() ``` **Return Value** Type: String #### getLabel() Gets the label for the option. **Signature** ```java public String getLabel() ``` **Return Value** Type: String #### getUrl() Gets the url for the option. **Signature** ```java public String getUrl() ``` **Return Value** Type: String #### getValue() Gets the value for the option. **Signature** ```java public Boolean getValue() ``` **Return Value** Type: Boolean ## TestHarness.OptionGroup Class Represents an [option group component](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/composition.md#option-grouos) in a view for the test harness. ### TestHarness.OptionGroup Methods The following are methods for `TestHarness.OptionGroup`. #### getLabel() Gets the label for the option group. **Signature** ```java public String getLabel() ``` **Return Value** Type: String #### getOptions() Gets the list of options for the option group. **Signature** ```java public List getOptions() ``` **Return Value** Type: List<[Slack.TestHarness.Option](#testharnessoption-class)> ## TestHarness.Overflow Class Represents an [overflow menu](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/elements.md#overflow) within a section or an actions component in a view for the test harness. ### TestHarness.Overflow Methods The following are methods for `TestHarness.Overflow`. #### clickOption(idx) Simulates clicking the component with the specified option index. If the component contains an `onclick` event, an action is fired. **Signature** ```java public void clickOption(Integer idx) ``` **Parameters** _idx_ Type: Integer **Return Value** Type: void #### clickOption(option) Simulates clicking the component with the specified option. If the component contains an `onclick` event, an action is fired. **Signature** ```java public void clickOption(Slack.TestHarness.Option option) ``` **Parameters** _option_ Type: [Slack.TestHarness.Option](#testharnessoption-class) **Return Value** Type: void #### clickOption(identifier) Simulates clicking the component with the specified option identifier. If the component contains an `onclick` event, an action is fired. **Signature** ```java public void clickOption(String identifier) ``` **Parameters** _identifier_ Type: String **Return Value** Type: void #### getConfirm() Gets the [confirm composition object](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/composition.md#confirm) for the overflow menu. **Signature** ```java public Slack.TestHarness.Confirm getConfirm() ``` **Return Value** Type: [Slack.TestHarness.Confirm](#testharnessconfirm-class) #### getName() Gets the name for the overflow menu. **Signature** ```java public String getName() ``` **Return Value** Type: String #### getOptions() Gets the list of options for the overflow menu. **Signature** ```java public List getOptions() ``` **Return Value** Type: List<[Slack.TestHarness.Option](#testharnessoption-class)> ## TestHarness.RadioGroup Class Represents a [radio group component](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/elements.md#radio-group) ### TestHarness.RadioGroup Methods The following are methods for `TestHarness.RadioGroup`. #### getConfirm() Gets the [confirm composition object](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/composition.md#confirm) for the radio group. **Signature** ```java public Slack.TestHarness.Confirm getConfirm() ``` **Return Value** Type: [Slack.TestHarness.Confirm](#testharnessconfirm-class) #### getInitialValue() Gets the initial value for the radio group. **Signature** ```java public String getInitialValue() ``` **Return Value** Type: String #### getName() Gets the name for the radio group. **Signature** ```java public String getName() ``` **Return Value** Type: String #### getOptions() Gets the list of options for the radio group. **Signature** ```java public List getOptions() ``` **Return Value** Type: List #### getValue() Gets the value for the radio group. **Signature** ```java public String getValue() ``` **Return Value** Type: String #### setValue(identifier) Sets the value for the radio group. If the radio group contains an `onchange` event, an action is fired. **Signature** ```java public void setValue(String identifier) ``` **Return Value** Type: void ## TestHarness.Section Class Represents a [section component](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/layout.md#section) in a view for the test harness. ### TestHarness.Section Methods The following are methods for `TestHarness.Section`. #### getComponent(idx, clazz) Gets a child component in the given index on the section component. **Signature** ```java public Object getComponent(Integer idx, System.Type clazz) ``` **Parameters** _idx_ Type: Integer _clazz_ Type: [System.Type](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_type.htm) #### getComponent(clazz) Gets a child component on the section component. **Signature** ```java public Object getComponent(System.Type clazz) ``` **Parameters** _clazz_ Type: [System.Type](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_type.htm) **Return Value** Type: Object #### getComponentByName(name, clazz) Gets a child component on the section component by name. **Signature** ```java public Object getComponentByName(String name, System.Type clazz) ``` **Parameters** _name_ Type: String _clazz_ Type: [System.Type](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_type.htm) **Return Value** Type: Object #### getFieldCount() Gets the field count for the section component. **Signature** ```java public Integer getFieldCount() ``` **Return Value** Type: Integer #### getFieldText(idx) Gets the field text for the section component at the specified index. **Signature** ```java public String getFieldText(Integer idx) ``` **Parameters** _idx_ Type: Integer **Return Value** Type: String #### getName() Gets the name for the section component. **Signature** ```java public String getName() ``` **Return Value** Type: String #### getText() Gets the text for the component. **Signature** ```java public String getText() ``` **Return Value** Type: String ## TestHarness.SelectInput Class Represents a [select component](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/elements.md#select) in a view for the test harness. ### TestHarness.SelectInput Methods The following are methods for `TestHarness.SelectInput`. #### getConfirm() Gets the [confirm composition object](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/composition.md#confirm) for the component. **Signature** ```java public Slack.TestHarness.Confirm getConfirm() ``` **Return Value** Type: Slack.TestHarness.Confirm #### getInitialMultiselectValue() Gets the initial value for the select component. If the component isn’t a multi-select, an exception is thrown. **Signature** ```java public List getInitialMultiselectValue() ``` **Return Value** Type: List\ #### getInitialValue() Gets the initial value for the select component. If the component is a multi-select, an exception is thrown. **Signature** ```java public String getInitialValue() ``` **Return Value** Type: String #### getMaxSelection() Gets the `maxSelection` value, which shows the maximum number of options that can be selected. Returns 1 if the component isn’t a multi-select. **Signature** ```java public Integer getMaxSelection() ``` **Return Value** Type: Integer #### getMultiselectValue() Gets the value for the select component. If the component isn’t a multi-select, an exception is thrown. **Signature** ```java public List getMultiselectValue() ``` **Return Value** Type: List\ #### getName() Gets the name of the select component. **Signature** ```java public String getName() ``` **Return Value** Type: String #### getOptions() Gets the list of options for the select component. **Signature** ```java public List getOptions() ``` **Return Value** Type: List #### getOptionsGroups() Gets the list of option groups for the select component. **Signature** ```java public List getOptionsGroups() ``` **Return Value** Type: List #### getPlaceholder() Gets the placeholder for the select component. **Signature** ```java public String getPlaceholder() ``` **Return Value** Type: String #### getValue() Gets the value for the select component. **Signature** ```java public String getValue() ``` **Return Value** Type: String #### isMultiselect() Returns true if the select component is a multi-select. **Signature** ```java public Boolean isMultiselect() ``` **Return Value** Type: Boolean #### setMultiselectValue(listOfIdentifiers) Sets the value of the select component. If the component contains an `onchange` event, an action is fired. If the component isn’t a multi-select, an exception is thrown. **Signature** ```java public void setMultiselectValue(List listOfIdentifiers) ``` **Parameters** _listOfIdentifiers_ Type: List\ **Return Value** Type: void #### setValue(identifier) Sets the value of the select component. If the component contains an `onchange` event, an action is fired. If the component is a multi-select, an exception is thrown. **Signature** ```java public void setValue(String identifier) ``` Parameters _identifier_ Type: String **Return Value** Type: void ## TestHarness.State Class Represents a Slack State that sets up your test harness. ### TestHarness.State Methods The following are methods for `TestHarness.State`. #### clearAllClientMocks() **Signature** ```java public void clearAllClientMocks() ``` **Return Value** Type: void #### clearAppClientMock() **Signature** ```java public void clearAppClientMock() ``` **Return Value** Type: void #### clearBotClientMock() **Signature** ```java public void clearBotClientMock() ``` **Return Value** Type: void #### clearUserClientMock() **Signature** ```java public void clearUserClientMock() ``` **Return Value** Type: void #### createDirectChannel(user) Creates a direct channel for the given user. **Signature** ```java public Slack.TestHarness.Channel createDirectChannel(Slack.TestHarness.User user) ``` **Parameters** _user_ Type: [Slack.TestHarness.User](#testharnessuser-class) **Return Value** Type: [Slack.TestHarness.Channel](#testharnesschannel-class) #### createEnterprise(enterpriseId, enterpriseName) Creates an enterprise for the test harness. **Signature** ```java public Slack.TestHarness.Enterprise createEnterprise(String enterpriseId, String enterpriseName) ``` **Parameters** _enterpriseId_ Type: String _enterpriseName_ Type: String **Return Value** Type: [Slack.TestHarness.Enterprise](#testharnessenterprise-class) #### createEnterprise(enterpriseName) **Signature** ```java public Slack.TestHarness.Enterprise createEnterprise(String enterpriseName) ``` **Return Value** Type: Slack.TestHarness.Enterprise #### createPrivateChannel(team, channelName, locale) **Signature** ```java public Slack.TestHarness.Channel createPrivateChannel(Slack.TestHarness.Team team, String channelName, String locale) ``` **Parameters** _team_ Type: Slack.TestHarness.Team _channelName_ Type: String _locale_ Type: String **Return Value** Type: [Slack.TestHarness.Channel](#testharnesschannel-class) #### createPrivateChannel(channelName) Creates a private channel with the specified name. **Signature** ```java public Slack.TestHarness.Channel createPrivateChannel(String channelName) ``` **Parameters** _channelName_ Type: String **Return Value** Type: [Slack.TestHarness.Channel](#testharnesschannel-class) #### createPrivateChannel(team, channelName) Creates a private channel for the default team. **Signature** ```java public Slack.TestHarness.Channel createPrivateChannel(Slack.TestHarness.Team team, String channelName) ``` **Parameters** _team_ Type: [Slack.TestHarness.Team](#testharnessteam-class) _channelName_ Type: String **Return Value** Type: [Slack.TestHarness.Channel](#testharnesschannel-class) #### createPublicChannel(channelName) Creates a public channel with the specified name. **Signature** ```java public Slack.TestHarness.Channel createPublicChannel(String channelName) ``` **Parameters** _channelName_ Type: String **Return Value** Type: [Slack.TestHarness.Channel](#testharnesschannel-class) #### createPublicChannel(team, channelName) Creates a public channel for the specified team. **Signature** ```java public Slack.TestHarness.Channel createPublicChannel(Slack.TestHarness.Team team, String channelName) ``` **Parameters** _team_ Type: [Slack.TestHarness.Team](#testharnessteam-class) _channelName_ Type: String **Return Value** Type: [Slack.TestHarness.Channel](#testharnesschannel-class) #### createTeam(teamDomain) Creates a team for the default enterprise. **Signature** ```java public Slack.TestHarness.Team createTeam(String teamDomain) ``` **Parameters** _teamDomain_ Type: String **Return Value** Type: [Slack.TestHarness.Team](#testharnessteam-class) #### createTeam(teamDomain, enterprise) Creates a team using the specified enterprise name. **Signature** ```java public Slack.TestHarness.Team createTeam(String teamDomain, Slack.TestHarness.Enterprise enterprise) ``` **Parameters** _teamDomain_ Type: String _enterprise_ Type: [Slack.TestHarness.Enterprise](#testharnessenterprise-class) **Return Value** Type: [Slack.TestHarness.Team](#testharnessteam-class) #### createUser(username, name) Creates a user on the default team. **Signature** ```java public Slack.TestHarness.User createUser(String username, String name) ``` **Parameters** _username_ Type: String _name_ Type: String **Return Value** Type: [Slack.TestHarness.User](#testharnessuser-class) #### createUser(username, name, team) Creates a user on the specified team. **Signature** ```java public Slack.TestHarness.User createUser(String username, String name, Slack.TestHarness.Team team) ``` **Parameters** _username_ Type: String _name_ Type: String _team_ Type: [Slack.TestHarness.Team](#testharnessteam-class) **Return Value** Type: #### createUserSession() Creates a user session using the default user and default channel. **Signature** ```java public Slack.TestHarness.UserSession createUserSession() ``` **Return Value** Type: [Slack.TestHarness.UserSession](#testharnessusersession-class) #### createUserSession(user, defaultChannel) **Signature** ```java public Slack.TestHarness.UserSession createUserSession(Slack.TestHarness.User user, Slack.TestHarness.Channel defaultChannel) ``` **Parameters** _user_ Type: [Slack.TestHarness.User](#testharnessuser-class) _defaultChannel_ Type: [Slack.TestHarness.Channel](#testharnesschannel-class) **Return Value** Type: [Slack.TestHarness.UserSession](#testharnessusersession-class) #### getChannel(team, channelId) Gets a channel based on its ID for the specified team. **Signature** ```java public Slack.TestHarness.Channel getChannel(Slack.TestHarness.Team team, String channelId) ``` **Parameters** _team_ Type: [Slack.TestHarness.Team](#testharnessteam-class) **Return Value** Type: [Slack.TestHarness.Channel](#testharnesschannel-class) #### getChannels(team) Gets the list of channels for the specified team. **Signature** ```java public List getChannels(Slack.TestHarness.Team team) ``` **Parameters** _team_ Type: [Slack.TestHarness.Team](#testharnessteam-class) **Return Value** Type: List<[Slack.TestHarness.Channel](#testharnesschannel-class)> #### getDefaultChannel() Gets the default channel for the test harness. **Signature** ```java public Slack.TestHarness.Channel getDefaultChannel() ``` **Return Value** Type: [Slack.TestHarness.Channel](#testharnesschannel-class) #### getDefaultEnterprise() Gets the default enterprise for the test harness. **Signature** ```java public Slack.TestHarness.Enterprise getDefaultEnterprise() ``` **Return Value** Type: [Slack.TestHarness.Enterprise](#testharnessenterprise-class) #### getDefaultTeam() Gets the default team for the test harness. **Signature** ```java public Slack.TestHarness.Team getDefaultTeam() ``` **Return Value** Type: [Slack.TestHarness.Team](#testharnessteam-class) #### getDefaultUser() Gets the default user for the test harness. **Signature** ```java public Slack.TestHarness.User getDefaultUser() ``` **Return Value** Type: [Slack.TestHarness.User](#testharnessuser-class) #### getLocale() **Signature** ```java public String getLocale() ``` **Return Value** Type: String #### getUser(team, username) Gets a user for the test harness. **Signature** ```java public Slack.TestHarness.User getUser(Slack.TestHarness.Team team, String username) ``` **Parameters** _team_ Type: [Slack.TestHarness.Team](#testharnessteam-class) _username_ Type: String **Return Value** Type: [Slack.TestHarness.User](#testharnessuser-class) #### getUserByUsername(team, username) **Signature** ```java public Slack.TestHarness.User getUserByUsername(Slack.TestHarness.Team team, String username) ``` **Parameters** _team_ Type: Slack.TestHarness.Team _username_ Type: String **Return Value** Type: [Slack.TestHarness.User](#testharnessuser-class) #### getUsers(team) **Signature** ```java public List getUsers(Slack.TestHarness.Team team) ``` **Parameters** _team_ Type: [Slack.TestHarness.Team](#testharnessteam-class) **Return Value** Type: List<[Slack.TestHarness.User](#testharnessuser-class)> #### setAppClientMock(appClientMock) **Signature** ```java public void setAppClientMock(Slack.AppClientMock appClientMock) ``` **Parameters** _appClientMock_ Type: Slack.AppClientMock **Return Value** Type: void #### setBotClientMock(botClientMock) **Signature** ```java public void setBotClientMock(Slack.BotClientMock botClientMock) ``` **Parameters** _botClientMock_ Type: Slack.BotClientMock **Return Value** Type: void #### setLocale(locale) **Signature** ```java public void setLocale(String locale) ``` **Parameters** _locale_ Type: String **Return Value** Type: void #### setUserClientMock(userClientMock) **Signature** ```java public void setUserClientMock(Slack.UserClientMock userClientMock) ``` **Parameters** _userClientMock_ Type: Slack.UserClientMock **Return Value** Type: void ## TestHarness.Team Class Represents a team or workspace for the test harness. ### TestHarness.Team Methods The following are methods for `TestHarness.Team`. #### getChannels() Gets the list of channels for the team. **Signature** ```java public List getChannels() ``` Type: List<[Slack.TestHarness.Channel](#testharnesschannel-class)> #### getEnterprise() Gets the enterprise for the team. **Signature** ```java public Slack.TestHarness.Enterprise getEnterprise() ``` **Return Value** Type: [Slack.TestHarness.Enterprise](#testharnessenterprise-class) #### getId() Gets the ID for the team. **Signature** ```java public String getId() ``` **Return Value** Type: String #### getTeamDomain() Gets the domain for the team. **Signature** ```java public String getTeamDomain() ``` **Return Value** Type: String ## TestHarness.Text Class Represents a [text component](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/elements.md#text) in a view for a test harness. ### TestHarness.Text Methods The following are methods for `TestHarness.Text`. #### getText() Gets the text for the component. **Signature** ```java public String getText() ``` **Return Value** Type: String ## TestHarness.TextInput Class Represents the [text input component](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/elements.md#text-input) in a view for the test harness. ### TestHarness.TextInput Methods The following are methods for `TestHarness.TextInput`. #### getInitialValue() Gets the initial value for the text input component. **Signature** ```java public String getInitialValue() ``` **Return Value** Type: String #### getMaxLength() Gets the maximum length for the text input component. **Signature** ```java public Integer getMaxLength() ``` **Return Value** Type: Integer #### getMinLength() Gets the minimum length for the text input component. **Signature** ```java public Integer getMinLength() ``` **Return Value** Type: Integer #### getName() Gets the name for the text input component. **Signature** ```java public String getName() ``` **Return Value** Type: String #### getPlaceholder() Gets the placeholder for the text input component. **Signature** ```java public String getPlaceholder() ``` **Return Value** Type: String #### getValue() Gets the value for the text input component. **Signature** ```java public String getValue() ``` **Return Value** Type: String #### isMultiline() Gets the `multiline` value for the text input component. **Signature** ```java public Boolean isMultiline() ``` **Return Value** Type: Boolean #### setValue(value) Sets the value for the text input component. **Signature** ```java public void setValue(String value) ``` **Return Value** Type: String ## TestHarness.TimePicker Class Represents the [time picker component](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/elements.md#time-picker) in a view for the test harness. ### TestHarness.TimePicker Methods The following are methods for `TestHarness.TimePicker`. #### getConfirm() Gets the [confirm composition object](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/composition.md#confirm) for the time picker component. **Signature** ```java public Slack.TestHarness.Confirm getConfirm() ``` **Return Value** Type: [Slack.TestHarness.Confirm](#testharnessconfirm-class) #### getInitialValue() Gets the initial value for the time picker component. **Signature** ```java public String getInitialValue() ``` **Return Value** Type: String #### getName() Gets the name for the time picker component. **Signature** ```java public String getName() ``` **Return Value** Type: String #### getPlaceholder() Gets the placeholder for the time picker component. **Signature** ```java public String getPlaceholder() ``` **Return Value** Type: String #### getValue() Gets the value for the time picker component. **Signature** ```java public String getValue() ``` **Return Value** Type: String #### setValue(value) Sets the value for the time picker component. **Signature** ```java public void setValue(String value) ``` **Return Value** Type: void ## TestHarness.User Class Represents a Slack user for the test harness. ### TestHarness.User Methods The following are methods for `TestHarness.User`. #### getId() Gets the ID for the user. **Signature** ```java public String getId() ``` **Return Value** Type: String #### getLocale() **Signature** ```java public String getLocale() ``` **Return Value** Type: String #### getName() Gets the name for the user. **Signature** ```java public String getName() ``` **Return Value** Type: String #### getTeam() Gets the team for the user. **Signature** ```java public Slack.TestHarness.Team getTeam() ``` **Return Value** Type: [Slack.TestHarness.Team](#testharnessteam-class) #### getUsername() Gets the username for the user. **Signature** ```java public String getUsername() ``` **Return Value** Type: String ## TestHarness.UserSession Class Represents a user session that denotes a user interacting with Slack using a client, maintaining session-specific state such as an open channel or modal. ### TestHarness.UserSession Methods The following are methods for `TestHarness.UserSession`. #### closeAllModals() Simulates closing all modals in the modal stack for the user session. **Signature** ```java public void closeAllModals() ``` **Return Value** Type: void #### closeModal() Simulates closing the currently visible modal on top of the modal stack for the user session. **Signature** ```java public void closeModal() ``` **Return Value** Type: void #### executeEvent(event, slackApp) Executes an event in the context of an existing user session. The session is used to retrieve the user, team, and enterprise to set on the request. The session is also used for any relevant input or output context for the specific event. **Signature** ```java public void executeEvent(Slack.Event event, Slack.App slackApp) ``` **Parameters** _event_ Type: Slack.Event _slackApp_ Type: [Slack.App](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_client_access.md#app-class) **Return Value** Type: void #### executeGlobalShortcut(globalShortcut, slackApp) Simulates executing a global shortcut for the user session. **Signature** ```java public void executeGlobalShortcut(String globalShortcut, Slack.App slackApp) ``` **Parameters** _globalShortcut_ Type: String _slackApp_ Type: [Slack.App](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_client_access.md#app-class) **Return Value** Type: void #### executeMessageShortcut(messageShortcut, message, slackApp) Simulates executing a message shortcut for a given message for the user session. **Signature** ```java public void executeMessageShortcut(String messageShortcut, Slack.TestHarness.Message message, Slack.App slackApp) ``` **Parameters** _messageShortcut_ Type: String _message_ Type: [Slack.TestHarness.Message](#testharnessmessage-class) _slackApp_ Type: [Slack.App](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_client_access.md#app-class) **Return Value** Type: void #### executeSlashCommand(command, slackApp) Simulates executing a slash command on the given Slack app ID for the user session. **Signature** ```java public void executeSlashCommand(String command, Slack.App slackApp) ``` **Parameters** _command_ Type: String _slackApp_ Type: [Slack.App](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_client_access.md#app-class) **Return Value** Type: void #### executeSlashCommand(command, text, slackApp) Simulates executing a slash command with a text payload for the user session. **Signature** ```java public void executeSlashCommand(String command, String text, Slack.App slackApp) ``` **Parameters** _command_ Type: String _text_ Type: String _slackApp_ Type: [Slack.App](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_client_access.md#app-class) **Return Value** Type: void #### getAppHome() Gets the open app home for the user session. **Signature** ```java public Slack.TestHarness.Home getAppHome() ``` **Return Value** Type: [Slack.TestHarness.Home](#testharnesshome-class) #### getMessageCount() Gets the message count for the user session. **Signature** ```java public Integer getMessageCount() ``` **Return Value** Type: Integer #### getMessages() Gets the list of messages for the user session. **Signature** ```java public List getMessages() ``` **Return Value** Type: List<[Slack.TestHarness.Message](#testharnessmessage-class)> #### getModalStack() Gets the list of modals in stack order for the user session. **Signature** ```java public List getModalStack() ``` **Return Value** Type: List<[Slack.TestHarness.Modal](#testharnessmodal-class)> #### getOpenChannel() Gets the open channel for the user session. **Signature** ```java public Slack.TestHarness.Channel getOpenChannel() ``` **Return Value** Type: [Slack.TestHarness.Channel](#testharnesschannel-class) #### getState() Gets the Slack state. **Signature** ```java public Slack.TestHarness.State getState() ``` **Return Value** Type: [Slack.TestHarness.State](#testharnessstate-class) #### getTopModal() Gets the open modal on top of the modal stack for the user session. **Signature** ```java public Slack.TestHarness.Modal getTopModal() ``` **Return Value** Type: Slack.TestHarness.Modal #### getUser() Gets the user for the user session. **Signature** ```java public Slack.TestHarness.User getUser() ``` **Return Value** Type: [Slack.TestHarness.User](#testharnessuser-class) #### openAppHome(slackApp) Simulates opening the app home for a given app ID for the user session. **Signature** ```java public Slack.TestHarness.Home openAppHome(Slack.App slackApp) ``` **Parameters** _slackApp_ Type: [Slack.App](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_client_access.md#app-class) **Return Value** Type: Slack.TestHarness.Home #### openChannel(channelId) Simulates opening a channel for the given channel ID for the user session. **Signature** ```java public Slack.TestHarness.Channel openChannel(String channelId) ``` **Parameters** _channelId_ Type: String **Return Value** Type: Slack.TestHarness.Channel #### postMessage(message) Simulates posting a message to the open channel for the user session. **Signature** ```java public Slack.TestHarness.Message postMessage(String message) ``` **Parameters** _message_ Type: String **Return Value** Type: [Slack.TestHarness.Message](#testharnessmessage-class) ## TestHarness.UsersSelect Class Represents a [users select component](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/elements.md#users-select) in a view for the test harness. ### TestHarness.UsersSelect Methods The following are methods for `TestHarness.UsersSelect`. #### getConfirm() Gets the [confirm composition object](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/components/composition.md#confirm) for the users select component. **Signature** ```java public Slack.TestHarness.Confirm getConfirm() ``` **Return Value** Type: [Slack.TestHarness.Confirm](#testharnessconfirm-class) #### getInitialMultiselectValue() Gets the initial value for the users select component. If the component isn’t a multi-select, an exception is thrown. **Signature** ```java public List getInitialMultiselectValue() ``` **Return Value** Type: List\ #### getInitialValue() Gets the initial value for the users select component. If the component is a multi-select, an exception is thrown. **Signature** ```java public void getInitialValue() ``` **Return Value** Type: void #### getMaxSelection() Gets the resolved max selection for the users select component. Returns 1 if the component isn’t a multi-select. **Signature** ```java public Integer getMaxSelection() ``` **Return Value** Type: Integer #### getMultiselectValue() Gets the value for the users select component. If the component isn’t a multi-select, an exception is thrown. **Signature** ```java public List getMultiselectValue() ``` **Return Value** Type: List\ #### getName() Gets the name for the users select component. **Signature** ```java public String getName() ``` **Return Value** Type: String #### getOptions() Gets the list of options for the users select component. **Signature** ```java public List getOptions() ``` **Return Value** Type: List<[Slack.TestHarness.Option](#testharnessoption-class)> #### getPlaceholder() Gets the placeholder for the users select component. **Signature** ```java public String getPlaceholder() ``` **Return Value** Type: String #### getValue() Gets the value for the users select component. **Signature** ```java public String getValue() ``` **Return Value** Type: String #### isMultiselect() Gets the value for the users select component. If the component isn’t a multi-select, an exception is thrown. **Signature** ```java public Boolean isMultiselect() ``` **Return Value** Type: Boolean #### setMultiselectValue(listOfIdentifiers) Sets the value of the users select component. If the component contains an `onchange` event, an action is fired. If the component isn’t a multi-select, an exception is thrown. **Signature** ```java public void setMultiselectValue(List listOfIdentifiers) ``` **Parameters** _listOfIdentifiers_ Type: List\ **Return Value** Type: void #### setValue(identifier) Sets the value of the users select component. If the component contains an `onchange` event, an action is fired. If the component is a multi-select, an exception is thrown. **Signature** ```java public void setValue(String identifier) ``` **Parameters** _identifier_ Type: String **Return Value** Type: void # Work with Topics Use the `Topic` class to work with topics for a channel or conversation. ## Topic Class Represents a topic. ### Topic Methods The following are methods for `Topic`. #### getCreator() **Signature** ```java public String getCreator() ``` **Return Value** Type: String #### getLastSet() **Signature** ```java public Integer getLastSet() ``` **Return Value** Type: Integer #### getValue() **Signature** ```java public String getValue() ``` **Return Value** Type: String #### setCreator(creator) **Signature** ```java public void setCreator(String creator) ``` **Parameters** _creator_ Type: String **Return Value** Type: void #### setLastSet(lastSet) **Signature** ```java public void setLastSet(Integer lastSet) ``` **Parameters** _lastSet_ Type: Integer **Return Value** Type: void #### setValue(value) **Signature** ```java public void setValue(String value) ``` **Parameters** _value_ Type: String **Return Value** Type: void # Work with User Groups The following are Apex classes for the Slack `usergroups` [API methods](https://api.slack.com/methods?filter=usergroups). ## Usergroup Class Represents a group of users. **Usage** See [Slack's usergroup object type](https://api.slack.com/types/usergroup). ### Usergroup Methods The following are methods for `Usergroup`. #### getAutoType() **Signature** ```java public String getAutoType() ``` **Return Value** Type: String #### getChannelCount() **Signature** ```java public Integer getChannelCount() ``` **Return Value** Type: Integer #### getCreatedBy() **Signature** ```java public String getCreatedBy() ``` **Return Value** Type: String #### getDateCreate() **Signature** ```java public Integer getDateCreate() ``` **Return Value** Type: Integer #### getDateDelete() **Signature** ```java public Integer getDateDelete() ``` **Return Value** Type: Integer #### getDateUpdate() **Signature** ```java public Integer getDateUpdate() ``` **Return Value** Type: Integer #### getDeletedBy() **Signature** ```java public String getDeletedBy() ``` **Return Value** Type: String #### getDescription() **Signature** ```java public String getDescription() ``` **Return Value** Type: String #### getEnterpriseSubteamId() **Signature** ```java public String getEnterpriseSubteamId() ``` **Return Value** Type: String #### getHandle() **Signature** ```java public String getHandle() ``` **Return Value** Type: String #### getId() **Signature** ```java public String getId() ``` **Return Value** Type: String #### getName() **Signature** ```java public String getName() ``` **Return Value** Type: String #### getPrefs() **Signature** ```java public Slack.Usergroup.Prefs getPrefs() ``` **Return Value** Type: Slack.Usergroup.Prefs #### getTeamId() **Signature** ```java public String getTeamId() ``` **Return Value** Type: String #### getUpdatedBy() **Signature** ```java public String getUpdatedBy() ``` **Return Value** Type: String #### getUserCount() **Signature** ```java public Integer getUserCount() ``` **Return Value** Type: Integer #### getUsers() **Signature** ```java public List getUsers() ``` **Return Value** Type: List\ #### isAutoProvision() **Signature** ```java public Boolean isAutoProvision() ``` **Return Value** Type: Boolean #### isExternal() **Signature** ```java public Boolean isExternal() ``` **Return Value** Type: Boolean #### isSubteam() **Signature** ```java public Boolean isSubteam() ``` **Return Value** Type: Boolean #### isUsergroup() **Signature** ```java public Boolean isUsergroup() ``` **Return Value** Type: Boolean #### setAutoProvision(autoProvision) **Signature** ```java public void setAutoProvision(Boolean autoProvision) ``` **Parameters** _autoProvision_ Type: Boolean **Return Value** Type: void #### setAutoType(autoType) **Signature** ```java public void setAutoType(String autoType) ``` **Parameters** _autoType_ Type: String **Return Value** Type: void #### setChannelCount(channelCount) **Signature** ```java public void setChannelCount(Integer channelCount) ``` **Parameters** _channelCount_ Type: Integer **Return Value** Type: void #### setCreatedBy(createdBy) **Signature** ```java public void setCreatedBy(String createdBy) ``` **Parameters** _createdBy_ Type: String **Return Value** Type: void #### setDateCreate(dateCreate) **Signature** ```java public void setDateCreate(Integer dateCreate) ``` **Parameters** _dateCreate_ Type: Integer **Return Value** Type: void #### setDateDelete(dateDelete) **Signature** ```java public void setDateDelete(Integer dateDelete) ``` **Parameters** _dateDelete_ Type: Integer **Return Value** Type: void #### setDateUpdate(dateUpdate) **Signature** ```java public void setDateUpdate(Integer dateUpdate) ``` **Parameters** _dateUpdate_ Type: Integer **Return Value** Type: void #### setDeletedBy(deletedBy) **Signature** ```java public void setDeletedBy(String deletedBy) ``` **Parameters** _deletedBy_ Type: String **Return Value** Type: void #### setDescription(description) **Signature** ```java public void setDescription(String description) ``` **Parameters** _description_ Type: String **Return Value** Type: void #### setEnterpriseSubteamId(enterpriseSubteamId) **Signature** ```java public void setEnterpriseSubteamId(String enterpriseSubteamId) ``` **Parameters** _enterpriseSubteamId_ Type: String **Return Value** Type: void #### setExternal(external) **Signature** ```java public void setExternal(Boolean external) ``` **Parameters** _external_ Type: Boolean **Return Value** Type: void #### setHandle(handle) **Signature** ```java public void setHandle(String handle) ``` **Parameters** _handle_ Type: String **Return Value** Type: void #### setId(id) **Signature** ```java public void setId(String id) ``` **Parameters** _id_ Type: String **Return Value** Type: void #### setName(name) **Signature** ```java public void setName(String name) ``` **Parameters** _name_ Type: String **Return Value** Type: void #### setPrefs(prefs) **Signature** ```java public void setPrefs(Slack.Usergroup.Prefs prefs) ``` **Parameters** _prefs_ Type: Slack.Usergroup.Prefs **Return Value** Type: void #### setSubteam(subteam) **Signature** ```java public void setSubteam(Boolean subteam) ``` **Parameters** _subteam_ Type: Boolean **Return Value** Type: void #### setTeamId(teamId) **Signature** ```java public void setTeamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: void #### setUpdatedBy(updatedBy) **Signature** ```java public void setUpdatedBy(String updatedBy) ``` **Parameters** _updatedBy_ Type: String **Return Value** Type: void #### setUserCount(userCount) **Signature** ```java public void setUserCount(Integer userCount) ``` **Parameters** _userCount_ Type: Integer **Return Value** Type: void #### setUsergroup(usergroup) **Signature** ```java public void setUsergroup(Boolean usergroup) ``` **Parameters** _usergroup_ Type: Boolean **Return Value** Type: void #### setUsers(users) **Signature** ```java public void setUsers(List users) ``` **Parameters** _users_ Type: List\ **Return Value** Type: void ## Usergroup.Prefs Class Represent the default channels and groups (private channels) that members are invited to when they join. **Usage** See [Slack's usergroup object type](https://api.slack.com/types/usergroup). ### Usergroup.Prefs Methods The following are methods for `Usergroup.Prefs`. #### getChannels() **Signature** ```java public List getChannels() ``` **Return Value** Type: List\ #### getGroups() **Signature** ```java public List getGroups() ``` **Return Value** Type: List\ #### setChannels(channels) **Signature** ```java public void setChannels(List channels) ``` **Parameters** _channels_ Type: List\ **Return Value** Type: void #### setGroups(groups) **Signature** ```java public void setGroups(List groups) ``` **Parameters** _groups_ Type: List\ **Return Value** Type: void ## UsergroupsCreateRequest Class Sends a request to create a user group. ### UsergroupsCreateRequest Methods The following are methods for `UsergroupsCreateRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.UsergroupsCreateRequest.Builder builder() ``` **Return Value** Type: Slack.UsergroupsCreateRequest.Builder. ## UsergroupsCreateRequest.Builder Class Sends a request to create a user group. ### UsergroupsCreateRequest.Builder Methods The following are methods for `UsergroupsCreateRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Builds an instance of `Slack.UsergroupsCreateRequest`. **Signature** ```java public Slack.UsergroupsCreateRequest build() ``` **Return Value** Type: Slack.UsergroupsCreateRequest #### channels(channels) **Signature** ```java public Slack.UsergroupsCreateRequest.Builder channels(List channels) ``` **Parameters** _channels_ Type: List<String> **Return Value** Type: Slack.UsergroupsCreateRequest.Builder #### description(description) **Signature** ```java public Slack.UsergroupsCreateRequest.Builder description(String description) ``` **Parameters** _description_ Type: String **Return Value** Type: Slack.UsergroupsCreateRequest.Builder #### handle(handle) **Signature** ```java public Slack.UsergroupsCreateRequest.Builder handle(String handle) ``` **Parameters** _handle_ Type: String **Return Value** Type: Slack.UsergroupsCreateRequest.Builder #### includeCount(includeCount) **Signature** ```java public Slack.UsergroupsCreateRequest.Builder includeCount(Boolean includeCount) ``` **Parameters** _includeCount_ Type: Boolean **Return Value** Type: Slack.UsergroupsCreateRequest.Builder #### name(name) Required. A name for the User Group. Must be unique among User Groups. **Signature** ```java public Slack.UsergroupsCreateRequest.Builder name(String name) ``` **Parameters** _name_ Type: String **Return Value** Type: Slack.UsergroupsCreateRequest.Builder #### teamId(teamId) **Signature** ```java public Slack.UsergroupsCreateRequest.Builder teamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: Slack.UsergroupsCreateRequest.Builder ## UsergroupsCreateResponse Class Creates a user group. ### UsergroupsCreateResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `UsergroupsCreateResponse`. #### getUsergroup() **Signature** ```java public Slack.Usergroup getUsergroup() ``` **Return Value** Type: Slack.Usergroup #### setUsergroup(usergroup) **Signature** ```java public void setUsergroup(Slack.Usergroup usergroup) ``` **Parameters** _usergroup_ Type: Slack.Usergroup ## UsergroupsDisableRequest.Builder Class Sends a request to disable an existing user group. ### UsergroupsDisableRequest.Builder Methods The following are methods for `UsergroupsDisableRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Builds an instance of `Slack.UsergroupsDisableRequest`. **Signature** ```java public Slack.UsergroupsDisableRequest build() ``` **Return Value** Type: Slack.UsergroupsDisableRequest #### includeCount(includeCount) **Signature** ```java public Slack.UsergroupsDisableRequest.Builder includeCount(Boolean includeCount) ``` **Parameters** _includeCount_ Type: Boolean **Return Value** Type: Slack.UsergroupsDisableRequest.Builder #### usergroup(usergroup) Required. The ID of the user group to disable. **Signature** ```java public Slack.UsergroupsDisableRequest.Builder usergroup(String usergroup) ``` **Parameters** _usergroup_ Type: String **Return Value** Type: Slack.UsergroupsDisableRequest.Builder #### teamId(teamId) **Signature** ```java public Slack.UsergroupsDisableRequest.Builder teamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: [Slack.UsergroupsDisableRequest.Builder](#usergroupsdisablerequestbuilder-class) ## UsergroupsDisableRequest Class Sends a request to disable an existing user group. ### UsergroupsDisableRequest Methods The following are methods for `UsergroupsDisableRequest`. #### builder() **Signature** ```java public static Slack.UsergroupsDisableRequest.Builder builder() ``` **Return Value** Type: Slack.UsergroupsDisableRequest.Builder ## UsergroupsDisableResponse Class Disables an existing user group. ### UsergroupsDisableResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `UsergroupsDisableResponse`. #### getUsergroup() **Signature** ```java public Slack.Usergroup getUsergroup() ``` **Return Value** Type: Slack.Usergroup #### setUsergroup(usergroup) **Signature** ```java public void setUsergroup(Slack.Usergroup usergroup) ``` **Parameters** _usergroup_ Type: Slack.Usergroup **Return Value** Type: void ## UsergroupsEnableRequest.Builder Class Sends a request to enable a user group. ### UsergroupsEnableRequest.Builder Methods The following are methods for `UsergroupsEnableRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Builds an instance of `Slack.UsergroupsEnableRequest`. **Signature** ```java public Slack.UsergroupsEnableRequest build() ``` **Return Value** Type: Slack.UsergroupsEnableRequest #### includeCount(includeCount) **Signature** ```java public Slack.UsergroupsEnableRequest.Builder usergroup(String usergroup) ``` **Parameters** _includeCount_ Type: Boolean **Return Value** Type: Slack.UsergroupsEnableRequest.Builder #### usergroup(usergroup) Required. The ID of the user group to enable. **Signature** ```java public Slack.UsergroupsEnableRequest.Builder usergroup(String usergroup) ``` **Parameters** _usergroup_ Type: String **Return Value** Type: Slack.UsergroupsEnableRequest.Builder ## UsergroupsEnableRequest Class Sends a request to enable a user group. ### UsergroupsEnableRequest Methods The following are methods for `UsergroupsEnableRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.UsergroupsEnableRequest.Builder builder() ``` **Return Value** Type: Slack.UsergroupsEnableRequest.Builder #### teamId(teamId) **Signature** ```java public Slack.UsergroupsEnableRequest.Builder teamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: [Slack.UsergroupsEnableRequest.Builder](#usergroupsenablerequestbuilder-class) ## UsergroupsEnableResponse Class Enables a user group. ### UsergroupsEnableResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `UsergroupsEnableResponse`. #### getUsergroup() **Signature** ```java public Slack.Usergroup getUsergroup() ``` **Return Value** Type: Slack.Usergroup #### setUsergroup(usergroup) **Signature** ```java public void setUsergroup(Slack.Usergroup usergroup) ``` **Parameters** _usergroup_ Type: Slack.Usergroup **Return Value** Type: void ## UsergroupsListRequest.Builder Class Sends a request to list all user groups for a team. ### UsergroupsListRequest.Builder Methods The following are methods for `UsergroupsListRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Builds an instance of `Slack.UsergroupsListRequest`. **Signature** ```java public Slack.UsergroupsListRequest build() ``` **Return Value** Type: Slack.UsergroupsListRequest #### includeCount(includeCount) **Signature** ```java public Slack.UsergroupsListRequest.Builder includeCount(Boolean includeCount) ``` **Parameters** _includeCount_ Type: Boolean **Return Value** Type: Slack.UsergroupsListRequest.Builder #### includeDisabled(includeDisabled) **Signature** ```java public Slack.UsergroupsListRequest.Builder includeDisabled(Boolean includeDisabled) ``` **Parameters** _includeDisabled_ Type: Boolean **Return Value** Type: Slack.UsergroupsListRequest.Builder #### includeUsers(includeUsers) **Signature** ```java public Slack.UsergroupsListRequest.Builder includeUsers(Boolean includeUsers) ``` **Parameters** _includeUsers_ Type: Boolean **Return Value** Type: Slack.UsergroupsListRequest.Builder #### teamId(teamId) **Signature** ```java public Slack.UsergroupsListRequest.Builder teamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: Slack.UsergroupsListRequest.Builder ## UsergroupsListRequest Class Sends a request to list all user groups for a team. ### UsergroupsListRequest Methods The following are methods for `UsergroupsListRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.UsergroupsListRequest.Builder builder() ``` **Return Value** Type: Slack.UsergroupsListRequest.Builder ## UsergroupsListResponse Class Lists all user groups for a team. ### UsergroupsListResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `UsergroupsListResponse`. #### getUsergroups() **Signature** ```java public List getUsergroups() ``` **Return Value** Type: List #### setUsergroups(usergroups) **Signature** ```java public void setUsergroups(List usergroups) ``` **Parameters** _usergroups_ Type: List **Return Value** Type: void ## UsergroupsUpdateRequest.Builder Class Sends a request to update the list of users for a user group. ### UsergroupsUpdateRequest.Builder Methods The following are methods for `UsergroupsUpdateRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Builds an instance of `Slack.UsergroupsUpdateRequest`. **Signature** ```java public Slack.UsergroupsUpdateRequest build() ``` **Return Value** Type: Slack.UsergroupsUpdateRequest #### channnels() **Signature** ```java public Slack.UsergroupsUpdateRequest.Builder channels(List channels) ``` **Parameters** _channels_ Type: List\ **Return Value** Type: Slack.UsergroupsUpdateRequest.Builder #### description(description) **Signature** ```java public Slack.UsergroupsUpdateRequest.Builder description(String description) ``` **Parameters** _description_ Type: String **Return Value** Type: Slack.UsergroupsUpdateRequest.Builder #### handle(handle) **Signature** ```java public Slack.UsergroupsUpdateRequest.Builder handle(String handle) ``` **Parameters** _handle_ Type: String **Return Value** Type: Slack.UsergroupsUpdateRequest.Builder #### includeCount(includeCount) **Signature** ```java public Slack.UsergroupsUpdateRequest.Builder includeCount(Boolean includeCount) ``` **Parameters** _includeCount_ Type: Boolean **Return Value** Type: Slack.UsergroupsUpdateRequest.Builder #### name(name) **Parameters** _name_ Type: String **Signature** ```java public Slack.UsergroupsUpdateRequest.Builder name(String name) ``` **Return Value** Type: Slack.UsergroupsUpdateRequest.Builder #### teamId(teamId) **Signature** ```java public Slack.UsergroupsUpdateRequest.Builder teamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: Slack.UsergroupsUpdateRequest.Builder #### usergroup(usergroup) Required. The ID of the user group to update. **Signature** ```java public Slack.UsergroupsUpdateRequest.Builder usergroup(String usergroup) ``` **Parameters** _usergroup_ Type: String **Return Value** Type: Slack.UsergroupsUpdateRequest.Builder ## UsergroupsUpdateRequest Class Sends a request to update the list of users for a user group. ### UsergroupsUpdateRequest Methods #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.UsergroupsUpdateRequest.Builder builder() ``` **Return Value** Type: Slack.UsergroupsUpdateRequest.Builder ## UsergroupsUpdateResponse Class Updates the list of users for a user group. ### UsergroupsUpdateResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `UsergroupsUpdateResponse`. #### getUsergroup() **Signature** ```java public Slack.Usergroup getUsergroup() ``` **Return Value** Type: Slack.Usergroup #### setUsergroup(usergroup) **Signature** ```java public void setUsergroup(Slack.Usergroup usergroup) ``` **Parameters** _usergroup_ Type: Slack.Usergroup ## UsergroupsUsersListRequest.Builder Class Sends a request to list all users in a user group. ### UsergroupsUsersListRequest.Builder Methods The following are methods for `UsergroupsUsersListRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Builds an instance of `Slack.UsergroupsUsersListRequest`. **Signature** ```java public Slack.UsergroupsUsersListRequest build() ``` **Return Value** Type: Slack.UsergroupsUsersListRequest #### includeDisabled(includeDisabled) **Signature** ```java public Slack.UsergroupsUsersListRequest.Builder includeDisabled(Boolean includeDisabled) ``` **Parameters** _includeDisabled_ Type: Boolean **Return Value** Type: Slack.UsergroupsUsersListRequest.Builder ### teamId(teamId) **Signature** ```java public Slack.UsergroupsUsersListRequest.Builder teamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: Slack.UsergroupsUsersListRequest.Builder #### usergroup(usergroup) Required. The ID of the user group to list. **Signature** ```java public Slack.UsergroupsUsersListRequest.Builder usergroup(String usergroup) ``` **Parameters** _usergroup_ Type: String **Return Value** Type: Slack.UsergroupsUsersListRequest.Builder ## UsergroupsUsersListRequest Class Sends a request to list all users in a user group. ### UsergroupsUsersListRequest Methods #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.UsergroupsUsersListRequest.Builder builder() ``` **Return Value** Type: Slack.UsergroupsUsersListRequest.Builder ## UsergroupsUsersListResponse Class Lists all users in a user group. ### UsergroupsUsersListResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `UsergroupsUsersListResponse`. #### getUsers() **Signature** ```java public List getUsers() ``` **Return Value** Type: List\ #### setUsers(users) **Signature** ```java public void setUsers(List users) ``` **Parameters** _users_ Type: String **Return Value** Type: void ## UsergroupsUsersUpdateRequest.Builder Class Sends a request to update the list of users for a user group. ### UsergroupsUsersUpdateRequest.Builder Methods The following are methods for `UsergroupsUsersUpdateRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Builds an instance of `Slack.UsergroupsUsersUpdateRequest`. **Signature** ```java public Slack.UsergroupsUsersUpdateRequest build() ``` **Return Value** Type: Slack.UsergroupsUsersUpdateRequest #### includeCount(includeCount) **Signature** ```java public Slack.UsergroupsUsersUpdateRequest.Builder includeCount(Boolean includeCount) ``` **Parameters** _includeCount_ Type: Boolean **Return Value** Type: Slack.UsergroupsUsersUpdateRequest.Builder ### teamId(teamId) **Signature** ```java public Slack.UsergroupsUsersUpdateRequest.Builder teamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: [Slack.UsergroupsUsersUpdateRequest.Builder](#usergroupsusersupdaterequestbuilder-class) #### usergroup(usergroup) Required. The ID of the user group to update. **Signature** ```java public Slack.UsergroupsUsersUpdateRequest.Builder usergroup(String usergroup) ``` **Parameters** _usergroup_ Type: String **Return Value** Type: Slack.UsergroupsUsersUpdateRequest.Builder #### users(users) Required. A comma-separated string of encoded user IDs that represent the entire list of users for the user group. **Signature** ```java public Slack.UsergroupsUsersUpdateRequest.Builder users(List users) ``` **Parameters** _users_ Type: List\ **Return Value** Type: Slack.UsergroupsUsersUpdateRequest.Builder ## UsergroupsUsersUpdateRequest Class Sends a request to update the list of users for a user group. ### UsergroupsUsersUpdateRequest Methods #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.UsergroupsUsersUpdateRequest.Builder builder() ``` **Return Value** Type: Slack.UsergroupsUsersUpdateRequest.Builder ## UsergroupsUsersUpdateResponse Class Updates the list of users for a user group. ### UsergroupsUsersUpdateResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `UsergroupsUsersUpdateResponse`. #### getUsergroup() **Signature** ```java public Slack.Usergroup getUsergroup() ``` **Return Value** Type: Slack.Usergroup #### setUsergroup(usergroup) **Signature** ```java public void setUsergroup(Slack.Usergroup usergroup) ``` **Parameters** _usergroup_ Type: Slack.Usergroup # Work with UserMappingService Use the `UserMappingService` class to query for existing [user mappings](https://help.salesforce.com/s/articleView?id=slack.slack_apps_digital_hq_shared_mapping.htm&type=5) stored in Salesforce. A Slack user mapping is created when a user links their Salesforce and Slack accounts in these ways. - A [Salesforce connection](https://slack.com/help/articles/30754346665747-Connect-Salesforce-and-Slack#connect-slack-to-salesforce) is established in Slack and a user’s accounts are mapped, either automatically or manually. - A Slack user authenticates a [Salesforce app](https://help.salesforce.com/s/articleView?id=slack.slack_apps_options.htm&type=5) by using their Salesforce account. - An admin uses the [Mass User Provisioning API](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/orgs-mass-user.md) to link Salesforce and Slack accounts. A user may have more than one mapping if they connect several Slack accounts to a Salesforce account. ## UserMappingService Class **Usage** ```java // UserMappingService.getSalesforceUserId String salesforceUserId = Slack.UserMappingService.getSalesforceUserId('U000000001'); System.assertEquals('005xx000001X7yjAAC', salesforceUserId); // UserMappingService.getSalesforceUserIdMap List slackIds = new List {'U000000001', 'U000100002', 'U000100003'}; Map resultMap = Slack.UserMappingService.getSalesforceUserIdMap(slackIds); System.assertEquals(3, resultMap.size()); System.assertEquals('005xx000001X7yjAAC', resultMap.get('U000000001')); System.assertEquals('005xx000001X7ykAAC', resultMap.get('U000100002')); // UserMappingService.getSlackUserId String teamId = 'T020L1EJEG3'; String slackId = Slack.UserMappingService.getSlackUserId('005xx000001X7yjAAC', teamId); System.assertEquals('U000000001', slackId); // UserMappingService.getSlackUserIdMap String teamId = 'T020L1EJEG3'; List salesforceIds = new List {'005xx000001X7yjAAC', '005xx000001X7ykAAC', '005xx000001X7ylAAC'}; Map resultMap = Slack.UserMappingService.getSlackUserIdMap(salesforceIds, teamId); System.assertEquals(3, resultMap.size()); System.assertEquals('U000000001', resultMap.get('005xx000001X7yjAAC')); System.assertEquals('U000100002', resultMap.get('005xx000001X7ykAAC')); ``` ### UserMappingService Methods The following are methods for `UserMappingService`. #### getSalesforceUserId() For a given Slack user ID, get the associated Salesforce user ID. **Signature** ```java public String getSalesforceUserId(String slackUserId) ``` **Parameters** _slackUserId_ Type: String **Return Value** Type: String #### getSalesforceUserIdMap() Given a list of Slack user IDs, get the associated Salesforce user IDs. If at least one successful mapping is possible, then the returned map contains an entry for each supplied Slack user ID. **Signature** ```java public Map getSalesforceUserIdMap(List slackUserIds) ``` **Parameters** _slackUserIds_ Type: List\ **Return Value** Type: Map #### getSlackUserId() Gets the Slack user ID for a given Salesforce ID within a Slack workspace. If you’re calling from an Enterprise organization, make sure that you pass your Slack Enterprise ID for the `teamId` parameter. See [Slack’s `team.info` method](https://docs.slack.dev/reference/methods/team.info/). **Signature** ```java public String getSlackUserId(String salesforceUserId, String teamId) ``` **Parameters** _salesforceUserId_ Type: String _teamId_ Type: String **Return Value** Type: String #### getSlackUserIdMap() Given a list of Salesforce user IDs in a Slack workspace for a specific Slack App, get the associated Slack user mappings. If at least one successful mapping is possible, then the returned map contains an entry for each supplied Salesforce user ID. If you’re calling from an Enterprise organization, make sure that you pass your Slack Enterprise ID for the `teamId` parameter. See [Slack’s `team.info` method](https://docs.slack.dev/reference/methods/team.info/). **Signature** ```java public Map getSlackUserIdMap(List salesforceUserIds, String teamId) ``` **Parameters** _salesforceUserIds_ Type: List\ _teamId_ Type: String **Return Value** Type: Map # Work with Users The following are Apex classes for the Slack `users` [API methods](https://api.slack.com/methods?filter=users). ## User Class Represents information about a Slack workspace user. **Usage** See [Slack's user object type](https://api.slack.com/types/user). ### User Methods The following are methods for `User`. #### getColor() **Signature** ```java public String getColor() ``` **Return Value** Type: String #### getEnterpriseUser() **Signature** ```java public Slack.User.EnterpriseUser getEnterpriseUser() ``` **Return Value** Type: Slack.User.EnterpriseUser #### getId() **Signature** ```java public String getId() ``` **Return Value** Type: String #### getLocale() **Signature** ```java public String getLocale() ``` **Return Value** Type: String #### getName() **Signature** ```java public String getName() ``` **Return Value** Type: String #### getPresence() **Signature** ```java public String getPresence() ``` **Return Value** Type: String #### getProfile() **Signature** ```java public Slack.User.Profile getProfile() ``` **Return Value** Type: Slack.User.Profile #### getRealName() **Signature** ```java public String getRealName() ``` **Return Value** Type: String #### getTeamId() **Signature** ```java public String getTeamId() ``` **Return Value** Type: String #### getTwoFactorType() **Signature** ```java public String getTwoFactorType() ``` **Return Value** Type: String #### getTz() **Signature** ```java public String getTz() ``` **Return Value** Type: String #### getTzLabel() **Signature** ```java public String getTzLabel() ``` **Return Value** Type: String #### getTzOffset() **Signature** ```java public Integer getTzOffset() ``` **Return Value** Type: Integer #### getUpdated() **Signature** ```java public Long getUpdated() ``` **Return Value** Type: Long #### isAdmin() **Signature** ```java public Boolean isAdmin() ``` **Return Value** Type: Boolean #### isAppUser() **Signature** ```java public Boolean isAppUser() ``` **Return Value** Type: Boolean #### isBot() **Signature** ```java public Boolean isBot() ``` **Return Value** Type: Boolean #### isDeleted() **Signature** ```java public Boolean isDeleted() ``` **Return Value** Type: Boolean #### isEmailConfirmed() **Signature** ```java public Boolean isEmailConfirmed() ``` **Return Value** Type: Boolean #### isHas2fa() **Signature** ```java public Boolean isHas2fa() ``` **Return Value** Type: Boolean #### isHasFiles() **Signature** ```java public Boolean isHasFiles() ``` **Return Value** Type: Boolean #### isInvitedUser() **Signature** ```java public Boolean isInvitedUser() ``` **Return Value** Type: Boolean #### isOwner() **Signature** ```java public Boolean isOwner() ``` **Return Value** Type: Boolean #### isPrimaryOwner() **Signature** ```java public Boolean isPrimaryOwner() ``` **Return Value** Type: Boolean #### isRestricted() **Signature** ```java public Boolean isRestricted() ``` **Return Value** Type: Boolean #### isStranger() **Signature** ```java public Boolean isStranger() ``` **Return Value** Type: Boolean #### isUltraRestricted() **Signature** ```java public Boolean isUltraRestricted() ``` **Return Value** Type: Boolean #### isWorkflowBot() **Signature** ```java public Boolean isWorkflowBot() ``` **Return Value** Type: Boolean #### isWhoCanShareContactCard() **Signature** ```java public Boolean isWhoCanShareContactCard() ``` **Return Value** Type: Boolean #### setAdmin(admin) **Signature** ```java public void setAdmin(Boolean admin) ``` **Parameters** _admin_ Type: Boolean **Return Value** Type: void #### setAppUser(appUser) **Signature** ```java public void setAppUser(Boolean appUser) ``` **Parameters** _appUser_ Type: Boolean **Return Value** Type: void #### setBot(bot) **Signature** ```java public void setBot(Boolean bot) ``` **Parameters** _bot_ Type: Boolean **Return Value** Type: void #### setColor(color) **Signature** ```java public void setColor(String color) ``` **Parameters** _color_ Type: String **Return Value** Type: void #### setDeleted(deleted) **Signature** ```java public void setDeleted(Boolean deleted) ``` **Parameters** _deleted_ Type: Boolean **Return Value** Type: void #### setEmailConfirmed(emailConfirmed) **Signature** ```java public void setEmailConfirmed(Boolean emailConfirmed) ``` **Parameters** _emailConfirmed_ Type: Boolean **Return Value** Type: void #### setEnterpriseUser(enterpriseUser) **Signature** ```java public void setEnterpriseUser(Slack.User.EnterpriseUser enterpriseUser) ``` **Parameters** _enterpriseUser_ Type: Slack.User.EnterpriseUser **Return Value** Type: void #### setHas2fa(has2fa) **Signature** ```java public void setHas2fa(Boolean has2fa) ``` **Parameters** _has2fa_ Type: Boolean **Return Value** Type: void #### setHasFiles(hasFiles) **Signature** ```java public void setHasFiles(Boolean hasFiles) ``` **Parameters** _hasFiles_ Type: Boolean **Return Value** Type: void #### setId(id) **Signature** ```java public void setId(String id) ``` **Parameters** _id_ Type: String **Return Value** Type: void #### setInvitedUser(invitedUser) **Signature** ```java public void setInvitedUser(Boolean invitedUser) ``` **Parameters** _invitedUser_ Type: Boolean **Return Value** Type: void #### setLocale(locale) **Signature** ```java public void setLocale(String locale) ``` **Parameters** _locale_ Type: String **Return Value** Type: void #### setName(name) **Signature** ```java public void setName(String name) ``` **Parameters** _name_ Type: String **Return Value** Type: void #### setOwner(owner) **Signature** ```java public void setOwner(Boolean owner) ``` **Parameters** _owner_ Type: **Return Value** Type: void #### setPresence(presence) **Signature** ```java public void setPresence(String presence) ``` **Parameters** _presence_ Type: String **Return Value** Type: void #### setPrimaryOwner(primaryOwner) **Signature** ```java public void setPrimaryOwner(Boolean primaryOwner) ``` **Parameters** _primaryOwner_ Type: Boolean **Return Value** Type: void #### setProfile(profile) **Signature** ```java public void setProfile(Slack.User.Profile profile) ``` **Parameters** _profile_ Type: Slack.User.Profile **Return Value** Type: void #### setRealName(realName) **Signature** ```java public void setRealName(String realName) ``` **Parameters** _realName_ Type: String **Return Value** Type: void #### setRestricted(restricted) **Signature** ```java public void setRestricted(Boolean restricted) ``` **Parameters** _restricted_ Type: Boolean **Return Value** Type: void #### setStranger(stranger) **Signature** ```java public void setStranger(Boolean stranger) ``` **Parameters** _stranger_ Type: Boolean **Return Value** Type: void #### setTeamId(teamId) **Signature** ```java public void setTeamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: void #### setTwoFactorType(twoFactorType) **Signature** ```java public void setTwoFactorType(String twoFactorType) ``` **Parameters** _twoFactorType_ Type: String **Return Value** Type: void #### setTz(tz) **Signature** ```java public void setTz(String tz) ``` **Parameters** _tz_ Type: String **Return Value** Type: void #### setTzLabel(tzLabel) **Signature** ```java public void setTzLabel(String tzLabel) ``` **Parameters** _tzLabel_ Type: String **Return Value** Type: void #### setTzOffset(tzOffset) **Signature** ```java public void setTzOffset(Integer tzOffset) ``` **Parameters** _tzOffset_ Type: Integer **Return Value** Type: void #### setUltraRestricted(ultraRestricted) **Signature** ```java public void setUltraRestricted(Boolean ultraRestricted) ``` **Parameters** _ultraRestricted_ Type: Boolean **Return Value** Type: void #### setUpdated(updated) **Signature** ```java public void setUpdated(Long updated) ``` **Parameters** _updated_ Type: Long **Return Value** Type: void #### setWhoCanShareContactCard(whoCanShareContactCard) **Signature** ```java public void setWhoCanShareContactCard(Boolean whoCanShareContactCard) ``` **Parameters** _whoCanShareContactCard_ Type: Boolean **Return Value** Type: void #### setWorkflowBot(workflowBot) **Signature** ```java public void setWorkflowBot(Boolean workflowBot) ``` **Parameters** _workflowBot_ Type: Boolean **Return Value** Type: void ## User.EnterpriseUser Class Represents an enterprise grid user. **Usage** See [Slack's user object type](https://api.slack.com/types/user). ### User.EnterpriseUser Methods The following are methods for `User.EnterpriseUser`. #### getEnterpriseId() **Signature** ```java public String getEnterpriseId() ``` **Return Value** Type: String #### getEnterpriseName() **Signature** ```java public String getEnterpriseName() ``` **Return Value** Type: String #### getId() **Signature** ```java public String getId() ``` **Return Value** Type: String #### getTeams() **Signature** ```java public List getTeams() ``` **Return Value** Type: List\ #### isAdmin() **Signature** ```java public Boolean isAdmin() ``` **Return Value** Type: Boolean #### isOwner() **Signature** ```java public Boolean isOwner() ``` **Return Value** Type: Boolean #### setAdmin(isAdmine) **Signature** ```java public void setAdmin(Boolean isAdmin) ``` **Parameters** _isAdmin_ Type: Boolean **Return Value** Type: void #### setEnterpriseId(enterpriseId) **Signature** ```java public void setEnterpriseId(String enterpriseId) ``` **Parameters** _enterpriseId_ Type: String **Return Value** Type: void #### setEnterpriseName(enterpriseName) **Signature** ```java public void setEnterpriseName(String enterpriseName) ``` **Parameters** _enterpriseName_ Type: String **Return Value** Type: void #### setId(id) **Signature** ```java public void setId(String id) ``` **Parameters** _id_ Type: String **Return Value** Type: void #### setOwner(isOwner) **Signature** ```java public void setOwner(Boolean isOwner) ``` **Parameters** _isOwner_ Type: Boolean **Return Value** Type: void #### setTeams(teams) **Signature** ```java public void setTeams(List teams) ``` **Parameters** _teams_ Type: List\ **Return Value** Type: void ## User.Field Class ### User.Field Methods The following are methods for `User.Field`. #### getAlt() **Signature** ```java public String getAlt() ``` **Return Value** Type: String #### getLabel() **Signature** ```java public String getLabel() ``` **Return Value** Type: String #### getValue() **Signature** ```java public String getValue() ``` **Return Value** Type: String #### setAlt(alt) **Signature** ```java public void setAlt(String alt) ``` **Parameters** _alt_ Type: String **Return Value** Type: void #### setLabel(label) **Signature** ```java public void setLabel(String label) ``` **Parameters** _label_ Type: String **Return Value** Type: void #### setValue(value) **Signature** ```java public void setValue(String value) ``` **Parameters** _value_ Type: String **Return Value** Type: void ## User.Profile Class Represents the user's profile, including the user's title, real and display names, email, and avatar images. **Usage** See [Slack's user object type](https://api.slack.com/types/user). ### User.Profile Methods The following are methods for `User.Profile`. #### getApiAppId() **Signature** ```java public String getApiAppId() ``` **Return Value** Type: String #### getAvatarHash() **Signature** ```java public String getAvatarHash() ``` **Return Value** Type: String #### getBotId() **Signature** ```java public String getBotId() ``` **Return Value** Type: String #### getDisplayName() **Signature** ```java public String getDisplayName() ``` **Return Value** Type: String #### getDisplayNameNormalized() **Signature** ```java public String getDisplayNameNormalized() ``` **Return Value** Type: String #### getEmail() **Signature** ```java public String getEmail() ``` **Return Value** Type: String #### getFields() **Signature** ```java public Map getFields() ``` **Return Value** Type: Map #### getGuestChannels() **Signature** ```java public String getGuestChannels() ``` **Return Value** Type: String #### getGuestExpirationTs() **Signature** ```java public Long getGuestExpirationTs() ``` **Return Value** Type: Long #### getGuestInvitedBy() **Signature** ```java public String getGuestInvitedBy() ``` **Return Value** Type: String #### getImage24() **Signature** ```java public String getImage24() ``` **Return Value** Type: String #### getImage32() **Signature** ```java public String getImage32() ``` **Return Value** Type: String #### getImage48() **Signature** ```java public String getImage48() ``` **Return Value** Type: String #### getImage72() **Signature** ```java public String getImage72() ``` **Return Value** Type: String #### getImage192() **Signature** ```java public String getImage192() ``` **Return Value** Type: String #### getImage512() **Signature** ```java public String getImage512() ``` **Return Value** Type: String #### getImage1024() **Signature** ```java public String getImage1024() ``` **Return Value** Type: String #### getImageOriginal() **Signature** ```java public String getImageOriginal() ``` **Return Value** Type: String #### getPhone() **Signature** ```java public String getPhone() ``` **Return Value** Type: String #### getPronouns() **Signature** ```java public String getPronouns() ``` **Return Value** Type: String #### getRealName() **Signature** ```java public String getRealName() ``` **Return Value** Type: String #### getRealNameNormalized() **Signature** ```java public String getRealNameNormalized() ``` **Return Value** Type: String #### getSkype() **Signature** ```java public String getSkype() ``` **Return Value** Type: String #### getStatusEmoji() **Signature** ```java public String getStatusEmoji() ``` **Return Value** Type: String #### getStatusEmojiDisplayInfo() **Signature** ```java public List getStatusEmojiDisplayInfo() ``` **Return Value** Type: String #### getStatusEmojiUrl() **Signature** ```java public String getStatusEmojiUrl() ``` **Return Value** Type: String #### getStatusExpiration() **Signature** ```java public Long getStatusExpiration() ``` **Return Value** Type: Long #### getStatusText() **Signature** ```java public String getStatusText() ``` **Return Value** Type: String #### getStatusTextCanonical() **Signature** ```java public String getStatusTextCanonical() ``` **Return Value** Type: String #### getTeam() **Signature** ```java public String getTeam() ``` **Return Value** Type: String #### getTitle() **Signature** ```java public String getTitle() ``` **Return Value** Type: String #### isAlwaysActive() **Signature** ```java public Boolean isAlwaysActive() ``` **Return Value** Type: Boolean #### isCustomImage() **Signature** ```java public Boolean isCustomImage() ``` **Return Value** Type: Boolean #### setAlwaysActive(alwaysActive) **Signature** ```java public void setAlwaysActive(Boolean alwaysActive) ``` **Parameters** _alwaysActive_ Type: Boolean **Return Value** Type: void #### setApiAppId(apiAppId) **Signature** ```java public void setApiAppId(String apiAppId) ``` **Parameters** _apiAppId_ Type: String **Return Value** Type: void #### setAvatarHash(avatarHash) **Signature** ```java public void setAvatarHash(String avatarHash) ``` **Parameters** _avatarHash_ Type: String **Return Value** Type: void #### setBotId(botId) **Signature** ```java public void setBotId(String botId) ``` **Parameters** _botId_ Type: String **Return Value** Type: void #### setCustomImage(customImage) **Signature** ```java public void setCustomImage(Boolean customImage) ``` **Parameters** _customImage_ Type: Boolean **Return Value** Type: void #### setDisplayName(displayName) **Signature** ```java public void setDisplayName(String displayName) ``` **Parameters** _displayName_ Type: String **Return Value** Type: void #### setDisplayNameNormalized(displayNameNormalized) **Signature** ```java public void setDisplayNameNormalized(String displayNameNormalized) ``` **Parameters** _displayNameNormalized_ Type: String **Return Value** Type: void #### setEmail(email) **Signature** ```java public void setEmail(String email) ``` **Parameters** _email_ Type: String **Return Value** Type: void #### setFields(fields) **Signature** ```java public void setFields(Map fields) ``` **Parameters** _fields_ Type: Map **Return Value** Type: void #### setGuestChannels(guestChannels) **Signature** ```java public void setGuestChannels(String guestChannels) ``` **Parameters** _guestChannels_ Type: String **Return Value** Type: void #### setGuestExpirationTs(guestExpirationTs) **Signature** ```java public void setGuestExpirationTs(Long guestExpirationTs) ``` **Parameters** _guestExpirationTs_ Type: Long **Return Value** Type: void #### setGuestInvitedBy(guestInvitedBy) **Signature** ```java public void setGuestInvitedBy(String guestInvitedBy) ``` **Parameters** _guestInvitedBy_ Type: String **Return Value** Type: void #### setImage24(image24) **Signature** ```java public void setImage24(String image24) ``` **Parameters** _image24_ Type: String **Return Value** Type: void #### setImage32(image32) **Signature** ```java public void setImage32(String image32) ``` **Parameters** _image32_ Type: String **Return Value** Type: void #### setImage48(image48) **Signature** ```java public void setImage48(String image48) ``` **Parameters** _image48_ Type: String **Return Value** Type: void #### setImage72(image72) **Signature** ```java public void setImage72(String image72) ``` **Parameters** _image72_ Type: **Return Value** Type: void #### setImage192(image192) **Signature** ```java public void setImage192(String image192) ``` **Parameters** _image192_ Type: String **Return Value** Type: void #### setImage512(image512) **Signature** ```java public void setImage512(String image512) ``` **Parameters** _image512_ Type: String **Return Value** Type: void #### setImage1024(image1024) **Signature** ```java public void setImage1024(String image1024) ``` **Parameters** _image1024_ Type: String **Return Value** Type: void #### setImageOriginal(imageOriginal) **Signature** ```java public void setImageOriginal(String imageOriginal) ``` **Parameters** _imageOriginal_ Type: String **Return Value** Type: void #### setPhone(phone) **Signature** ```java public void setPhone(String phone) ``` **Parameters** _phone_ Type: String **Return Value** Type: void #### setPronouns(pronouns) **Signature** ```java public void setPronouns(String pronouns) ``` **Parameters** _pronouns_ Type: String **Return Value** Type: void #### setRealName(realName) **Signature** ```java public void setRealName(String realName) ``` **Parameters** _realName_ Type: String **Return Value** Type: void #### setRealNameNormalized(realNameNormalized) **Signature** ```java public void setRealNameNormalized(String realNameNormalized) ``` **Parameters** _realNameNormalized_ Type: String **Return Value** Type: void #### setSkype(skype) **Signature** ```java public void setSkype(String skype) ``` **Parameters** _skype_ Type: String **Return Value** Type: void #### setStatusEmoji(statusEmoji) **Signature** ```java public void setStatusEmoji(String statusEmoji) ``` **Parameters** _statusEmoji_ Type: String **Return Value** Type: void #### setStatusEmojiDisplayInfo(statusEmojiDisplayInfo) **Signature** ```java setStatusEmojiDisplayInfo(statusEmojiDisplayInfo) ``` **Parameters** _statusEmojiDisplayInfo_ Type: List **Return Value** Type: void #### setStatusEmojiUrl(statusEmojiUrl) **Signature** ```java public void setStatusEmojiUrl(String statusEmojiUrl) ``` **Parameters** _statusEmojiUrl_ Type: String **Return Value** Type: void #### setStatusExpiration(statusExpiration) **Signature** ```java public void setStatusExpiration(Long statusExpiration) ``` **Parameters** _statusExpiration_ Type: Long **Return Value** Type: void #### setStatusText(statusText) **Signature** ```java public void setStatusText(String statusText) ``` **Parameters** _statusText_ Type: String **Return Value** Type: void #### setStatusTextCanonical(statusTextCanonical) **Signature** ```java public void setStatusTextCanonical(String statusTextCanonical) ``` **Parameters** _statusTextCanonical_ Type: String **Return Value** Type: void #### setTeam(team) **Signature** ```java public void setTeam(String team) ``` **Parameters** _team_ Type: String **Return Value** Type: void #### setTitle(title) **Signature** ```java public void setTitle(String title) ``` **Parameters** _title_ Type: String **Return Value** Type: void ## User.StatusEmojiDisplayInfo Class Represents an enterprise grid user. ### User.StatusEmojiDisplayInfo Methods The following are methods for `User.StatusEmojiDisplayInfo`. #### getEmojiName() **Signature** ```java public String getEmojiName() ``` **Return Value** Type: String #### getDisplayAlias() **Signature** ```java public String getDisplayAlias() ``` **Return Value** Type: String #### getDisplayUrl() **Signature** ```java public String getDisplayUrl() ``` **Return Value** Type: String #### setEmojiName(emojiName) **Signature** ```java public void setEmojiName(String emojiName) ``` **Parameters** _emojiName_ Type: String **Return Value** Type: void #### setDisplayAlias(displayAlias) **Signature** ```java public void setDisplayAlias(String displayAlias) ``` **Parameters** _displayAlias_ Type: String **Return Value** Type: void #### setDisplayUrl() **Signature** ```java public void setDisplayUrl(String displayUrl) ``` **Parameters** _displayUrl_ Type: String **Return Value** Type: void ## UsersConversationsRequest Class Sends a request to list conversations the calling user may access. **Usage** See Slack's [users.conversations method](https://api.slack.com/methods/users.conversations). ### UsersConversationsRequest Methods The following are methods for UsersConversationsRequest. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.UsersConversationsRequest.Builder builder() ``` **Return Value** Type: Slack.UsersConversationsRequest.Builder ## UsersConversationsRequest.Builder Class Sends a request to list conversations the calling user may access. ### UsersConversationsRequest.Builder Methods The following are methods for `UsersConversationsRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of `Slack.UsersConversationsRequest`. **Signature** ```java public Slack.UsersConversationsRequest build() ``` **Return Value** Type: Slack.UsersConversationsRequest #### cursor(cursor) **Signature** ```java public Slack.UsersConversationsRequest.Builder cursor(String cursor) ``` **Parameters** _cursor_ Type: String **Return Value** Type: Slack.UsersConversationsRequest.Builder #### excludeArchived(excludeArchived) **Signature** ```java public Slack.UsersConversationsRequest.Builder excludeArchived(Boolean excludeArchived) ``` **Parameters** _excludeArchived_ Type: Boolean **Return Value** Type: Slack.UsersConversationsRequest.Builder #### limitValue(limitValue) **Signature** ```java public Slack.UsersConversationsRequest.Builder limitValue(Integer limitValue) ``` **Parameters** _limitValue_ Type: Integer **Return Value** Type: Slack.UsersConversationsRequest.Builder #### teamId(teamId) **Signature** ```java public Slack.UsersConversationsRequest.Builder teamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: Slack.UsersConversationsRequest.Builder #### types(types) **Signature** ```java public Slack.UsersConversationsRequest.Builder types(List types) ``` **Parameters** _types_ Type: List **Return Value** Type: Slack.UsersConversationsRequest.Builder #### user(user) **Signature** ```java public Slack.UsersConversationsRequest.Builder user(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: Slack.UsersConversationsRequest.Builder ## UsersConversationsResponse Class List conversations the calling user may access. **Usage** See Slack's [users.conversations method](https://api.slack.com/methods/users.conversations). ### UsersConversationsResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `UsersConversationsResponse`. #### getChannels() **Signature** ```java public List getChannels() ``` **Return Value** Type: List #### getResponseMetadata() **Signature** ```java public Slack.ResponseMetadata getResponseMetadata() ``` **Return Value** Type: [Slack.ResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#responsemetadata-class) #### setChannels(channels) **Signature** ```java public void setChannels(List channels) ``` **Parameters** _channels_ Type: List **Return Value** Type: void #### setResponseMetadata(responseMetadata) **Signature** ```java public void setResponseMetadata(Slack.ResponseMetadata responseMetadata) ``` **Parameters** _responseMetadata_ Type: [Slack.ResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#responsemetadata-class) **Return Value** Type: void ## UsersDeletePhotoRequest.Builder Class Builds a request to delete the user profile photo. ### UsersDeletePhotoRequest Methods The following are methods for `UsersDeletePhotoRequest.Builder`. #### build() Required. Returns an instance of `Slack.UsersDeletePhotoRequest`. **Signature** ```java public Slack.UsersDeletePhotoRequest build() ``` **Return Value** Type: Slack.UsersDeletePhotoRequest ## UsersDeletePhotoRequest Class Sends a request to delete the user profile photo. **Usage** See Slack's [users.deletePhoto](https://api.slack.com/methods/users.deletePhoto). ### UsersDeletePhotoRequest Methods The following are methods for `UsersDeletePhotoRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.UsersDeletePhotoRequest.Builder builder() ``` **Return Value** Type: Slack.UsersDeletePhotoRequest.Builder ## UsersDeletePhotoResponse Class Delete the user profile photo. **Usage** See Slack's [users.deletePhoto](https://api.slack.com/methods/users.deletePhoto). ### UsersDeletePhotoResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). ## UsersGetPresenceRequest.Builder Class Builds a request to get user presence information. ### UsersGetPresenceRequest.Builder Methods The following are methods for `UsersGetPresenceRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of `Slack.UsersGetPresenceRequest`. **Signature** ```java public Slack.UsersGetPresenceRequest build() ``` **Return Value** Type: Slack.UsersGetPresenceRequest #### user(user) **Signature** ```java public Slack.UsersGetPresenceRequest.Builder user(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: Slack.UsersGetPresenceRequest.Builder ## UsersGetPresenceRequest Class Sends a request to get user presence information. **Usage** See Slack's [users.getPresence method](https://api.slack.com/methods/users.getPresence). ### UsersGetPresenceRequest Methods The following are methods for `UsersGetPresenceRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.UsersGetPresenceRequest.Builder builder() ``` **Return Value** Type: Slack.UsersGetPresenceRequest.Builder ## UsersGetPresenceResponse Class Gets user presence information. **Usage** See Slack's [users.getPresence method](https://api.slack.com/methods/users.getPresence). ### UsersGetPresenceResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `UsersGetPresenceResponse`. #### getConnectionCount() **Signature** ```java public Integer getConnectionCount() ``` **Return Value** Type: Integer #### getLastActivity() **Signature** ```java public Integer getLastActivity() ``` **Return Value** Type: Integer #### getPresence() **Signature** ```java public String getPresence() ``` **Return Value** Type: String #### isAutoAway() **Signature** ```java public Boolean isAutoAway() ``` **Return Value** Type: Boolean #### isManualAway() **Signature** ```java public Boolean isManualAway() ``` **Return Value** Type: Boolean #### isOnline() **Signature** ```java public Boolean isOnline() ``` **Return Value** Type: Boolean #### setAutoAway(autoAway) **Signature** ```java public void setAutoAway(Boolean autoAway) ``` **Parameters** _autoAway_ Type: Boolean **Return Value** Type: void #### setConnectionCount(connectionCount) **Signature** ```java public void setConnectionCount(Integer connectionCount) ``` **Parameters** _connectionCount_ Type: Integer **Return Value** Type: void #### setLastActivity(lastActivity) **Signature** ```java public void setLastActivity(Integer lastActivity) ``` **Parameters** _lastActivity_ Type: Integer **Return Value** Type: void #### setManualAway(manualAway) **Signature** ```java public void setManualAway(Boolean manualAway) ``` **Parameters** _manualAway_ Type: Boolean **Return Value** Type: void #### setOnline(online) **Signature** ```java public void setOnline(Boolean online) ``` **Parameters** _online_ Type: Boolean **Return Value** Type: void #### setPresence(presence) **Signature** ```java public void setPresence(String presence) ``` **Parameters** _presence_ Type: String **Return Value** Type: void ## UsersIdentityRequest.Builder Class Builds a request to get a user's identity. ### UsersIdentityRequest.Builder Methods The following are methods for `UsersIdentityRequest.Builder`. #### build() Required. Returns an instance of the `Slack.UsersIdentityRequest` object. **Signature** ```java public Slack.UsersIdentityRequest build() ``` **Return Value** Type: Slack.UsersIdentityRequest ## UsersIdentityRequest Class Sends a request to get a user's identity. **Usage** See Slack's [users.identity method](https://api.slack.com/methods/users.identity). ### UsersIdentityRequest Methods The following are methods for `UsersIdentityRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.UsersIdentityRequest.Builder builder() ``` **Return Value** Type: Slack.UsersIdentityRequest.Builder ## UsersIdentityResponse.Team Class Get a user's identity. ### UsersIdentityResponse.Team Methods The following are methods for `UsersIdentityResponse.Team`. #### getId() **Signature** ```java public String getId() ``` **Return Value** Type: String #### getName() **Signature** ```java public String getName() ``` **Return Value** Type: String #### setId(id) **Signature** ```java public void setId(String id) ``` **Parameters** _id_ Type: String **Return Value** Type: void #### setName(name) **Signature** ```java public void setName(String name) ``` **Parameters** _name_ Type: String **Return Value** Type: void ## UsersIdentityResponse.User Class Get a user's identity. ### UsersIdentityResponse.User Methods The following are methods for `UsersIdentityResponse.User`. #### getEmail() **Signature** ```java public String getEmail() ``` **Return Value** Type: String #### getId() **Signature** ```java public String getId() ``` **Return Value** Type: String #### getImage24() **Signature** ```java public String getImage24() ``` **Return Value** Type: String #### getImage32() **Signature** ```java public String getImage32() ``` **Return Value** Type: String #### getImage48() **Signature** ```java public String getImage48() ``` **Return Value** Type: String #### getImage72() **Signature** ```java public String getImage72() ``` **Return Value** Type: String #### getImage192() **Signature** ```java public String getImage192() ``` **Return Value** Type: String #### getImage512() **Signature** ```java public String getImage512() ``` **Return Value** Type: String #### getName() **Signature** ```java public String getName() ``` **Return Value** Type: String #### setEmail() **Signature** ```java public void setEmail(String email) ``` **Parameters** _email_ Type: String **Return Value** Type: void #### setId(id) **Signature** ```java public void setId(String id) ``` **Parameters** _id_ Type: String **Return Value** Type: void #### setImage24(image24) **Signature** ```java public void setImage24(String image24) ``` **Parameters** _image24_ Type: String **Return Value** Type: void #### setImage32(image32) **Signature** ```java public void setImage32(String image32) ``` **Parameters** _image32_ Type: String **Return Value** Type: void #### setImage48(image48) **Signature** ```java public void setImage48(String image48) ``` **Parameters** _image48_ Type: String **Return Value** Type: void #### setImage72(image72) **Signature** ```java public void setImage72(String image72) ``` **Parameters** _image72_ Type: String **Return Value** Type: void #### setImage192(image192) **Signature** ```java public void setImage192(String image192) ``` **Parameters** _image192_ Type: String **Return Value** Type: void #### setImage192(image512) **Signature** ```java public void setImage512(String image512) ``` **Parameters** _image512_ Type: String **Return Value** Type: void #### setName(name) **Signature** ```java public void setName(String name) ``` **Parameters** _name_ Type: String **Return Value** Type: void ## UsersIdentityResponse Class Gets a user's identity. **Usage** See Slack's [users.identity method](https://api.slack.com/methods/users.identity). ### UsersIdentityResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `UsersIdentityResponse`. #### getTeam() **Signature** ```java public Slack.UsersIdentityResponse.Team getTeam() ``` **Return Value** Type: Slack.UsersIdentityResponse.Team #### getUser() **Signature** ```java public Slack.UsersIdentityResponse.User getUser() ``` **Return Value** Type: Slack.UsersIdentityResponse.User #### setTeam(team) **Signature** ```java public void setTeam(Slack.UsersIdentityResponse.Team team) ``` **Parameters** _team_ Type: Slack.UsersIdentityResponse.Team **Return Value** Type: void #### setUser(user) **Signature** ```java public void setUser(Slack.UsersIdentityResponse.User user) ``` **Parameters** _user_ Type: Slack.UsersIdentityResponse.User **Return Value** Type: void ## UsersInfoRequest Class Sends a request to get information about a user. **Usage** See Slack's [users.info method](https://api.slack.com/methods/users.info). ### UsersInfoRequest Methods The following are methods for `UsersInfoRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.UsersInfoRequest.Builder builder() ``` **Return Value** Type: Slack.UsersInfoRequest.Builder ## UsersInfoRequest.Builder Class Contains methods to build an instance of the `Slack.UsersInfoRequest` class. A Builder object is obtained by invoking one of the `UsersInfoRequest.Builder` methods defined by the `UsersInfoRequest` class. ### UsersInfoRequest.Builder Methods The following are methods for `UsersInfoRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of `Slack.UsersInfoRequest`. **Signature** ```java public Slack.UsersInfoRequest build() ``` **Return Value** Type: Slack.UsersInfoRequest #### includeLocale(includeLocale) **Signature** ```java public Slack.UsersInfoRequest.Builder includeLocale(Boolean includeLocale) ``` **Parameters** _includeLocale_ Type: Boolean **Return Value** Type:Slack.UsersInfoRequest.Builder #### user(user) Required. The user to get info on. **Signature** ```java public Slack.UsersInfoRequest.Builder user(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: Slack.UsersInfoRequest.Builder ## UsersInfoResponse Class Gets information about a user. **Usage** See Slack's [users.info method](https://api.slack.com/methods/users.info). ### UsersInfoResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `UsersInfoResponse`. #### getUser() **Signature** ```java public Slack.User getUser() ``` **Return Value** Type: Slack.User #### setUser(user) **Signature** ```java public void setUser(Slack.User user) ``` **Parameters** _user_ Type: Slack.User **Return Value** Type: void ## UsersListRequest Class Sends a request to lists all users in a Slack team. **Usage** See Slack's [users.list method](https://api.slack.com/methods/users.list). ### UsersListRequest Methods The following are methods for `UsersListRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.UsersListRequest.Builder builder() ``` **Return Value** Type: Slack.UsersListRequest.Builder ## UsersListRequest.Builder Class Contains methods to build an instance of the `Slack.UsersListRequest` class. A Builder object is obtained by invoking one of the `UsersListRequest.Builder` methods defined by the `UsersListRequest` class. ### UsersListRequest.Builder Methods The following are methods for `UsersListRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of `Slack.UsersListRequest`. **Signature** ```java public Slack.UsersListRequest build() ``` **Return Value** Type: Slack.UsersListRequest #### cursor(cursor) **Signature** ```java public Slack.UsersListRequest.Builder cursor(String cursor) ``` **Parameters** _cursor_ Type: String **Return Value** Type: Slack.UsersListRequest.Builder #### includeLocale(includeLocale) **Signature** ```java public Slack.UsersListRequest.Builder includeLocale(Boolean includeLocale) ``` **Parameters** _includeLocale_ Type: Boolean **Return Value** Type: Slack.UsersListRequest.Builder #### limitValue(limitValue) **Signature** ```java public Slack.UsersListRequest.Builder limitValue(Integer limitValue) ``` **Parameters** _limitValue_ Type: Integer **Return Value** Type: Slack.UsersListRequest.Builder #### teamId(teamId) **Signature** ```java public Slack.UsersListRequest.Builder teamId(String teamId) ``` **Parameters** _teamId_ Type: String **Return Value** Type: Slack.UsersListRequest.Builder ## UsersListResponse Class Lists all users in a Slack team. **Usage** See Slack's [users.list method](https://api.slack.com/methods/users.list). ### UsersListResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `UsersListResponse`. #### getCacheTs() **Signature** ```java public String getCacheTs() ``` **Return Value** Type: String #### getMembers() **Signature** ```java public List getMembers() ``` **Return Value** Type: List #### getOffset() **Signature** ```java public String getOffset() ``` **Return Value** Type: String #### getResponseMetadata() **Signature** ```java public Slack.ResponseMetadata getResponseMetadata() ``` **Return Value** Type: [Slack.ResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#responsemetadata-class) #### setCacheTs(cacheTs) **Signature** ```java public void setCacheTs(String cacheTs) ``` **Parameters** _cacheTs_ Type: String **Return Value** Type: void #### setMembers(members) **Signature** ```java public void setMembers(List members) ``` **Parameters** _members_ Type: List **Return Value** Type: void #### setOffset(offset) **Signature** ```java public void setOffset(String offset) ``` **Parameters** _offset_ Type: String **Return Value** Type: void ## UsersLookupByEmailRequest Class Sends a request to find a user with an email address. **Usage** See Slack's [users.lookupByEmail method](https://api.slack.com/methods/users.lookupByEmail). ### UsersLookupByEmailRequest Methods The following are methods for `UsersLookupByEmailRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.UsersLookupByEmailRequest.Builder builder() ``` **Return Value** Type: Slack.UsersLookupByEmailRequest.Builder ## UsersLookupByEmailRequest.Builder Class Contains methods to build an instance of the `Slack.UsersLookupByEmailRequest` class. A Builder object is obtained by invoking one of the `UsersLookupByEmailRequest.Builder` methods defined by the `UsersLookupByEmailRequest` class. ### UsersLookupByEmailRequest.Builder Methods The following are methods for `UsersLookupByEmailRequest.Builder`. #### build() Required. Returns an instance of `Slack.UsersLookupByEmailRequest`. **Signature** ```java public Slack.UsersLookupByEmailRequest build() ``` **Return Value** Type: Slack.UsersLookupByEmailRequest #### email(email) Required. An email address belonging to a user in the workspace. **Signature** ```java public Slack.UsersLookupByEmailRequest.Builder email(String email) ``` **Parameters** _email_ Type: String **Return Value** Type: Slack.UsersLookupByEmailRequest.Builder ## UsersLookupByEmailResponse Class Find a user with an email address. **Usage** See Slack's [users.lookupByEmail method](https://api.slack.com/methods/users.lookupByEmail). ### UsersLookupByEmailResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `UsersLookupByEmailResponse`. #### getUser() **Signature** ```java public Slack.User getUser() ``` **Return Value** Type: Slack.User #### setUser(user) **Signature** ```java public void setUser(Slack.User user) ``` **Parameters** _user_ Type: Slack.User **Return Value** Type: void ## UsersProfileGetRequest Class Sends a request to retrieve a user's profile information, including their custom status. **Usage** See Slack's [users.profile.get method](https://api.slack.com/methods/users.profile.get). ### UsersProfileGetRequest Methods The following are methods for `UsersProfileGetRequest`. #### builder() **Signature** ```java public static Slack.UsersProfileGetRequest.Builder builder() ``` **Return Value** Type: Slack.UsersProfileGetRequest.Builder ## UsersProfileGetRequest.Builder Class Contains methods to build an instance of the `Slack.UsersProfileGetRequest` class. A Builder object is obtained by invoking one of the `UsersProfileGetRequest.Builder` methods defined by the `UsersProfileGetRequest` class. ### UsersProfileGetRequest.Builder Methods The following are methods for `UsersProfileGetRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of `Slack.UsersProfileGetRequest`. **Signature** ```java public Slack.UsersProfileGetRequest build() ``` **Return Value** Type: Slack.UsersProfileGetRequest #### includeLabels(includeLabels) **Signature** ```java public Slack.UsersProfileGetRequest.Builder includeLabels(Boolean includeLabels) ``` **Parameters** _includeLabels_ Type: Boolean **Return Value** Type: Slack.UsersProfileGetRequest.Builder #### user(user) **Signature** ```java public Slack.UsersProfileGetRequest.Builder user(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: Slack.UsersProfileGetRequest.Builder ## UsersProfileGetResponse Class Retrieve a user's profile information, including their custom status. **Usage** See Slack's [users.profile.get method](https://api.slack.com/methods/users.profile.get). ### UsersProfileGetResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). ## UsersProfileSetRequest Class Sends a request to set a user's profile information, including custom status. **Usage** See Slack's [users.profile.set method](https://api.slack.com/methods/users.profile.set). ### UsersProfileSetRequest Methods The following are methods for `UsersProfileSetRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.UsersProfileSetRequest.Builder builder() ``` **Return Value** Type: Slack.UsersProfileSetRequest.Builder ## UsersProfileSetRequest.Builder Class Contains methods to build an instance of the `Slack.UsersProfileSetRequest` class. A Builder object is obtained by invoking one of the `UsersProfileSetRequest.Builder` methods defined by the `UsersProfileSetRequest` class. ### UsersProfileSetRequest.Builder Methods The following are methods for `UsersProfileSetRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of `Slack.UsersProfileSetRequest. **Signature** ```java public Slack.UsersProfileSetRequest build() ``` #### name(name) **Signature** ```java public Slack.UsersProfileSetRequest.Builder name(String name) ``` **Parameters** _name_ Type: String **Return Value** Type: Slack.UsersProfileSetRequest.Builder #### user(user) **Signature** ```java public Slack.UsersProfileSetRequest.Builder user(String user) ``` **Parameters** _user_ Type: String **Return Value** Type: Slack.UsersProfileSetRequest.Builder #### value(value) **Signature** ```java public Slack.UsersProfileSetRequest.Builder value(String value) ``` **Parameters** _value_ Type: String **Return Value** Type: Slack.UsersProfileSetRequest.Builder ## UsersProfileSetResponse Class Set a user's profile information, including custom status. **Usage** See Slack's [users.profile.set method](https://api.slack.com/methods/users.profile.set). ### UsersProfileSetResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `UsersProfileSetResponse`. #### getUsername() **Signature** ```java public String getUsername() ``` **Return Value** Type: String ## UsersSetActiveRequest Class Sent a request to mark a user as active. Deprecated and non-functional. **Usage** See Slack's [users.setActive method](https://api.slack.com/methods/users.setActive). ### UsersSetActiveRequest Methods The following are methods for `UsersSetActiveRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.UsersSetActiveRequest.Builder builder() ``` **Return Value** Type: Slack.UsersSetActiveRequest.Builder ## UsersSetActiveRequest.Builder Class Contains methods to build an instance of the `Slack.UsersSetActiveRequest` class. A Builder object is obtained by invoking one of the `UsersSetActiveRequest.Builder` methods defined by the `UsersSetActiveRequest` class. ### UsersSetActiveRequest.Builder Methods The following are methods for `UsersSetActiveRequest.Builder`. #### build() Required. Returns an instance of `Slack.UsersSetActiveRequest`. **Signature** ```java public Slack.UsersSetActiveRequest build() ``` **Return Value** Type: Slack.UsersSetActiveRequest ## UsersSetActiveResponse Class Marked a user as active. **Usage** See Slack's [users.setActive method](https://api.slack.com/methods/users.setActive). ### UsersSetActiveResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). ## UsersSetPresenceRequest Class Sends a request to manually sets user presence. **Usage** See Slack's [users.setPresence method](https://api.slack.com/methods/users.setPresence). ### UsersSetPresenceRequest Methods The following are methods for `UsersSetPresenceRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.UsersSetPresenceRequest.Builder builder() ``` **Return Value** Type: Slack.UsersSetPresenceRequest.Builder ## UsersSetPresenceRequest.Builder Class Contains methods to build an instance of the `Slack.UsersSetPresenceRequest` class. A Builder object is obtained by invoking one of the `UsersSetPresenceRequest.Builder` methods defined by the `UsersSetPresenceRequest` class. ### UsersSetPresenceRequest.Builder Methods The following are methods for `UsersSetPresenceRequest.Builder`. #### build() Required. Returns an instance of `Slack.UsersSetPresenceRequest`. **Signature** ```java public Slack.UsersSetPresenceRequest build() ``` **Return Value** Type: Slack.UsersSetPresenceRequest #### presence(presence) Required. Either `auto` or `away`. **Signature** ```java public Slack.UsersSetPresenceRequest.Builder presence(String presence) ``` **Parameters** _presence_ Type: String **Return Value** Type: Slack.UsersSetPresenceRequest.Builder ## UsersSetPresenceResponse Class Manually sets user presence. **Usage** See Slack's [users.setPresence method](https://api.slack.com/methods/users.setPresence). ### UsersSetPresenceResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). # Work with Views The following are Apex classes for the Slack `views` [API methods](https://api.slack.com/methods?filter=views). ## ViewContext Class Contains information about a view. ### ViewContext Methods `ViewContext` has the following methods. #### getId() The ID of the view. **Signature** ```java public String getId() ``` **Return Value** Type: String #### getHash() A unique value that's optionally accepted in `views.update` and `views.publish` API calls. When provided to those APIs, the hash is validated such that only the most recent view can be updated. This should be used to ensure the correct view is being updated when updates are happening asynchronously. **Signature** ```java public String getHash() ``` **Return Value** Type: String --- ## ViewReference Class Represents a view definition. This class provides access to `ViewDefinition` records where the `targetType` is `slack`. **Usage** ```java ViewReference myViewReference = Slack.View.namespace.name; // returns a ViewReference myViewReference.setParameter("recordId", "001........."); Slack.App.myApp.getBotClient(...).postMessage(myViewReference); ``` ### ViewReference Methods The following are methods for `ViewReference`. #### setParameter(name, value) Sets the name and value of the view definition. **Signature** ```java public void setParameter(String name, Object value) ``` **Parameters** _name_ Type: String The name of the view definition. _value_ Type: Object **Return Value** Type: void --- ## ViewsOpenRequest Class Sends a request to open a view for a user. **Usage** See Slack’s [view.open](https://api.slack.com/methods/views.open) method. ### ViewsOpenRequest Methods The following are methods for `ViewsOpenRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.ViewsOpenRequest.Builder builder() ``` **Return Value** Type: Slack.ViewsOpenRequest.Builder ## ViewsOpenRequest.Builder Class Contains methods to build an instance of the `Slack.ViewsOpenRequest` class. A Builder object is obtained by invoking one of the `ViewsOpenRequest.builder` methods defined by the `ViewsOpenRequest` class. ### ViewsOpenRequest.Builder Methods The following are methods for `ViewsOpenRequest.Builder`. #### build() Required. Returns an instance of `Slack.ViewsOpenRequest`. **Signature** ```java public Slack.ViewsOpenRequest build() ``` **Return Value** Type: Slack.ViewsOpenRequest #### triggerId(triggerId) Required. Exchanges a trigger to post to the user. **Signature** ```java public Slack.ViewsOpenRequest.Builder triggerId(String triggerId) ``` **Parameters** _triggerId_ Type: String **Return Value** Type: Slack.ViewsOpenRequest.Builder #### view(view) Required. A view payload in the form of a JSON-encoded string. **Signature** ```java public Slack.ViewsOpenRequest.Builder view(Slack.ModalView view) ``` **Parameters** _view_ Type: Slack.ModalView **Return Value** Type: Slack.ViewsOpenRequest.Builder ## ViewsOpenResponse Class Opens a view for a user. **Usage** See Slack’s [view.open](https://api.slack.com/methods/views.open) method. ### ViewsOpenResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `ViewsOpenResponse`. #### getRenderedView() **Signature** ```java public Slack.View getRenderedView() ``` **Return Value** Type: Slack.View #### getResponseMetadata() **Signature** ```java public Slack.ErrorResponseMetadata getResponseMetadata() ``` **Return Value** Type: [Slack.ErrorResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#errorresponsemetadata-class) #### setResponseMetadata(responseMetadata) **Signature** ```java public void setResponseMetadata(Slack.ErrorResponseMetadata responseMetadata) ``` **Parameters** _responseMetadata_ Type: [Slack.ErrorResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#errorresponsemetadata-class) **Return Value** Type: void ## ViewsPublishRequest Class Sends a request to publish a static view for a user. **Usage** See Slack’s [view.publish method](https://api.slack.com/methods/views.publish). ### ViewsPublishRequest Methods The following are methods for `ViewsPublishRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.ViewsPublishRequest.Builder builder() ``` ## ViewsPublishRequest.Builder Class Contains methods to build an instance of the `Slack.ViewsPublishedRequest` class. A Builder object is obtained by invoking one of the `ViewsPublishRequest.Builder` methods defined by the `ViewsPublishRequest` class. ### ViewsPublishRequest.Builder Methods The following are methods for `ViewsPublishRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of the `Slack.ViewsPublishRequest` object. **Signature** ```java public Slack.ViewsPublishRequest build() ``` **Return Value** Type: Slack.ViewsPublishRequest #### hash(hash) A string that represents view state to protect against possible race conditions. **Signature** ```java public Slack.ViewsPublishRequest.Builder hash(String hash) ``` **Parameters** _hash_ Type: String **Return Value** Type: Slack.ViewsPublishRequest.Builder #### userId(userId) Required. The ID of the user you want to publish a view to. **Signature** ```java public Slack.ViewsPublishRequest.Builder userId(String userId) ``` **Parameters** _userId_ Type: String **Return Value** Type: Slack.ViewsPublishRequest.Builder #### view(view) Required. A JSON-encoded string that contains the [view payload](https://api.slack.com/reference/surfaces/views). **Signature** ```java public Slack.ViewsPublishRequest.Builder view(Slack.HomeView view) ``` **Parameters** _view_ Type: Type: Slack.HomeView **Return Value** Type: Slack.ViewsPublishRequest.Builder ## HomeView Class Build views for the App Home page. **Usage** `HomeView` enables you to build a view for your App Home page, and publish the view when an action is dispatched. ```java Slack.HomeView homeView = new Slack.HomeView.builder() .viewReference(viewReference) .build(); Slack.ViewsPublishRequest req = new Slack.ViewsPublishRequest.builder() .userId(context.getUserId()) .view(homeView) .build(); Slack.ViewsPublishResponse response = botClient.viewsPublish(req); if (response.getError() != null) { System.debug(response.getError()); } ``` You can also publish the view in response to a slash command. See [ChatPostMessageRequest](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_chat.md#chatpostmessagerequest-class). ### HomeView Methods The following are methods for `HomeView`. #### builder() Builds an object which is used when executing the API call. **Signature** ```java public static Slack.HomeView.Builder builder() ``` **Return Value** Type: Slack.HomeView.Builder ## HomeView.Builder Class Contains methods to build an instance of the `Slack.HomeView` class. A Builder object is obtained by invoking one of the `HomeView.builder` methods defined by the `ViewsOpenRequest` class. ### HomeView.Builder Methods The following are methods for `HomeView.Builder`. #### build() **Signature** ```java public Slack.HomeView build() ``` **Return Value** Type: Slack.HomeView #### externalId(externalId) **Signature** ```java public Slack.HomeView.Builder externalId(String externalId) ``` **Parameters** _externalId_ Type: String **Return Value** Type: Slack.HomeView.Builder #### viewReference(viewReference) **Signature** ```java public Slack.HomeView.Builder viewReference(Slack.ViewReference viewReference) ``` **Parameters** _viewReference_ Type: Slack.ViewReference **Return Value** Type: Slack.HomeView.Builder ## ViewsPublishResponse Class Publish a static view for a user. **Usage** See Slack’s [view.publish method](https://api.slack.com/methods/views.publish). ### ViewsPublishResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `ViewsPublishResponse`. #### getResponseMetadata() **Signature** ```java public Slack.ErrorResponseMetadata getResponseMetadata() ``` **Return Value** Type: [Slack.ErrorResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#errorresponsemetadata-class) #### setResponseMetadata(responseMetadata) **Signature** ```java public void setResponseMetadata(Slack.ErrorResponseMetadata responseMetadata) ``` **Parameters** _responseMetadata_ Type: [Slack.ErrorResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#errorresponsemetadata-class) **Return Value** Type: void ## ViewsPushRequest Class Sends a request to push a view onto the stack of a root view. **Usage** See Slack’s [views.push method](https://api.slack.com/methods/views.push). ### ViewsPushRequest Methods The following are methods for `ViewsPushRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.ViewsPushRequest.Builder builder() ``` **Return Value** Type: Slack.ViewsPushRequest.Builder ## ViewsPushRequest.Builder Class Contains methods to build an instance of the `Slack.ViewsPushRequest` class. A Builder object is obtained by invoking one of the `ViewsPushRequest.Builder` methods defined by the `ViewsPushRequest` class. ### ViewsPushRequest.Builder Methods The following are methods for `ViewsPushRequest.Builder`. #### build() Required. Returns an instance of `Slack.ViewsPushRequest`. **Signature** public Slack.ViewsPushRequest build() **Return Value** Type: Slack.ViewsPushRequest #### triggerId(triggerId) Required. Exchanges a trigger to post to the user. **Signature** ```java public Slack.ViewsPushRequest.Builder triggerId(String triggerId) ``` **Parameters** _triggerId_ Type: String **Return Value** Type: Slack.ViewsPushRequest.Builder #### view(view) Required. A view payload in the form of a JSON-encoded string. **Signature** ```java public Slack.ViewsPushRequest.Builder view(Slack.ModalView view) ``` **Parameters** _view_ Type: Slack.ModalView **Return Value** Type: Slack.ViewsPushRequest.Builder ## ViewsPushResponse Class Pushes a view onto the stack of a root view. **Usage** See Slack’s [views.push method](https://api.slack.com/methods/views.push). ### ViewsPushResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `ViewsPushResponse`. #### getResponseMetadata() **Signature** ```java public Slack.ErrorResponseMetadata getResponseMetadata() ``` **Return Value** Type: [Slack.ErrorResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#errorresponsemetadata-class) #### setResponseMetadata(responseMetadata) **Signature** ```java public void setResponseMetadata(Slack.ErrorResponseMetadata responseMetadata) ``` **Parameters** _responseMetadata_ Type: [Slack.ErrorResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#errorresponsemetadata-class) **Return Value** Type: void ## ViewsUpdateRequest Class Sends a request to update an existing view. **Usage** See Slack’s [views.update method](https://api.slack.com/methods/views.update). ### ViewsUpdateRequest Methods The following are methods for `ViewsUpdateRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.ViewsUpdateRequest.Builder builder() ``` **Return Value** Type: Slack.ViewsUpdateRequest.Builder ## ViewsUpdateRequest.Builder Class Contains methods to build an instance of the `Slack.ViewsUpdateRequest` class. A Builder object is obtained by invoking one of the `ViewsUpdateRequest.Builder` methods defined by the `ViewsUpdateRequest` class. ### ViewsUpdateRequest.Builder Methods The following are methods for `ViewsUpdateRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of `Slack.ViewsUpdateRequest`. **Signature** ```java public Slack.ViewsUpdateRequest build() ``` **Return Value** Type: Slack.ViewsUpdateRequest #### externalId(externalId) Required if `view(view)` is not provided. A unique identifier of the view set by the developer. Must be unique for all views on a team. Max length of 255 characters. **Signature** ```java public Slack.ViewsUpdateRequest.Builder externalId(String externalId) ``` **Parameters** _externalId_ Type: String **Return Value** Type: Slack.ViewsUpdateRequest.Builder #### hash(hash) A string that represents view state to protect against possible race conditions. **Signature** ```java public Slack.ViewsUpdateRequest.Builder hash(String hash) ``` **Parameters** _hash_ Type: String **Return Value** Type: Slack.ViewsUpdateRequest.Builder #### view(view) Required if `externalId(externalId)` is not provided. A view object in the format of a JSON-encoded string. **Signature** ```java public Slack.ViewsUpdateRequest.Builder view(Slack.ModalView view) ``` **Parameters** _view_ Type: Slack.ModalView **Return Value** Type: Slack.ViewsUpdateRequest.Builder #### viewId(viewId) A unique identifier of the view to be updated. Required if the external ID is not provided. **Signature** ```java public Slack.ViewsUpdateRequest.Builder viewId(String viewId) ``` **Parameters** _viewId_ Type: String **Return Value** Type: Slack.ViewsUpdateRequest.Builder ## ViewsUpdateResponse Class Updates an existing view. **Usage** See Slack’s [views.update method](https://api.slack.com/methods/views.update). ### ViewsUpdateResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). The following are methods for `ViewsUpdateResponse`. #### getRenderedView() **Signature** ```java public Slack.View getRenderedView() ``` **Return Value** Type: Slack.View #### getResponseMetadata() **Signature** ```java public Slack.ErrorResponseMetadata getResponseMetadata() ``` **Return Value** Type: [Slack.ErrorResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#errorresponsemetadata-class) #### setResponseMetadata(responseMetadata) **Signature** ```java public void setResponseMetadata(Slack.ErrorResponseMetadata responseMetadata) ``` **Parameters** _responseMetadata_ Type: [Slack.ErrorResponseMetadata](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#errorresponsemetadata-class) **Return Value** Type: void # Work with Workflows The following are Apex classes for the Slack `workflows` [API methods](https://api.slack.com/methods?query=workflows). ## WorkflowsStepCompletedRequest Class Sends a request to indicate that an app's step in a workflow completed execution. **Usage** See Slack’s [workflows.stepCompleted method](https://api.slack.com/methods/workflows.stepCompleted). ### WorkflowsStepCompletedRequest Methods The following are methods for `WorkflowsStepCompletedRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.WorkflowsStepCompletedRequest.Builder builder() ``` **Return Value** Type: Slack.WorkflowsStepCompletedRequest.Builder ## WorkflowsStepCompletedRequest.Builder Class Contains methods to build an instance of the `Slack.WorkflowsStepCompletedRequest` class. A Builder object is obtained by invoking one of the `WorkflowsStepCompletedRequest.Builder` methods defined by the `WorkflowsStepCompletedRequest` class. ### WorkflowsStepCompletedRequest.Builder Methods The following are methods for `WorkflowsStepCompletedRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of `Slack.WorkflowsStepCompletedRequest`. **Signature** ```java public Slack.WorkflowsStepCompletedRequest build() ``` **Return Value** Type: Slack.WorkflowsStepCompletedRequest #### outputs(outputs) **Signature** ```java public Slack.WorkflowsStepCompletedRequest.Builder outputs(Map outputs) ``` **Parameters** _outputs_ Type: Map **Return Value** Type: Slack.WorkflowsStepCompletedRequest.Builder #### outputsAsString(outputsAsString) **Signature** ```java public Slack.WorkflowsStepCompletedRequest.Builder outputsAsString(String outputsAsString) ``` **Parameters** _outputsAsString_ Type: String **Return Value** Type: Slack.WorkflowsStepCompletedRequest.Builder #### workflowStepExecuteId(workflowStepExecuteId) Required. Context identifier that maps to the correct workflow step execution. **Signature** ```java public Slack.WorkflowsStepCompletedRequest.Builder workflowStepExecuteId(String workflowStepExecuteId) ``` **Parameters** _workflowStepExecuteId_ Type: String **Return Value** Type: Slack.WorkflowsStepCompletedRequest.Builder ## WorkflowsStepCompletedResponse Class Indicates that an app's step in a workflow completed execution. **Usage** See Slack’s [workflows.stepCompleted method](https://api.slack.com/methods/workflows.stepCompleted). ### WorkflowsStepCompletedResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). ## WorkflowsStepFailedRequest Class Sends a request to indicate that an app's step in a workflow failed to execute. **Usage** See Slack’s [workflows.stepFailed method](https://api.slack.com/methods/workflows.stepFailed). ### WorkflowsStepFailedRequest Methods The following are methods for `WorkflowsStepFailedRequest`. #### builder() Builds a request object that's used when executing the API call. **Signature** ```java public static Slack.WorkflowsStepFailedRequest.Builder builder() ``` **Return Value** Type: Slack.WorkflowsStepFailedRequest.Builder ## WorkflowsStepFailedRequest.Builder Class Contains methods to build an instance of the `Slack.WorkflowsStepFailedRequest` class. A Builder object is obtained by invoking one of the `WorkflowsStepFailedRequest.Builder` methods defined by the `WorkflowsStepFailedRequest` class. ### WorkflowsStepFailedRequest.builder Methods The following are methods for `WorkflowsStepFailedRequest.Builder`. #### build() Required. Returns an instance of `Slack.WorkflowsStepFailedRequest`. **Signature** ```java public Slack.WorkflowsStepFailedRequest build() ``` **Return Value** Type: Slack.WorkflowsStepFailedRequest #### error(error) Required. A JSON-based object with a `message` property that contains an error message. **Signature** ```java public Slack.WorkflowsStepFailedRequest.Builder error(Map error) ``` **Parameters** _error_ Type: Map **Return Value** Type: Slack.WorkflowsStepFailedRequest.Builder #### workflowStepExecuteId(workflowStepExecuteId) Required. Context identifier that maps to the correct workflow step execution. **Signature** ```java public Slack.WorkflowsStepFailedRequest.Builder workflowStepExecuteId(String workflowStepExecuteId) ``` **Parameters** _workflowStepExecuteId_ Type: String **Return Value** Type: Slack.WorkflowsStepFailedRequest.Builder ## WorkflowsStepFailedResponse Class Indicates that an app's step in a workflow failed to execute. **Usage** See Slack’s [workflows.stepFailed method](https://api.slack.com/methods/workflows.stepFailed). ### WorkflowsStepFailedResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md). ## WorkflowStepInput Class ### WorkflowStepInput Methods The following are methods for `WorkflowStepInput`. #### getSkipVariableReplacement() **Signature** ```java public Boolean getSkipVariableReplacement() ``` **Return Value** Type: Boolean #### getValue() **Signature** ```java public Object getValue() ``` **Return Value** Type: Object #### getVariables() **Signature** ```java public Map getVariables() ``` **Return Value** Type: Map #### setSkipVariableReplacement(skipVariableReplacement) **Signature** ```java public void setSkipVariableReplacement(Boolean skipVariableReplacement) ``` **Parameters** _skipVariableReplacement_ Type: Boolean **Return Value** Type: void #### setValue(value) **Signature** ```java public void setValue(Object value) ``` **Parameters** _value_ Type: Object **Return Value** Type: void #### setVariables(variables) **Signature** ```java public void setVariables(Map variables) ``` **Parameters** _variables_ Type: Map **Return Value** Type: void ## WorkflowStepOutput Class ### WorkflowStepOutput Methods The following are methods for `WorkflowStepOutput`. #### getLabel() **Signature** ```java public String getLabel() ``` **Return Value** Type: String #### getName() **Signature** ```java public String getName() ``` **Return Value** Type: String #### getType() **Signature** ```java public String getType() ``` **Return Value** Type: String #### setLabel(label) **Signature** ```java public void setLabel(String label) ``` **Parameters** _label_ Type: String **Return Value** Type: void #### setName(name) **Signature** ```java public void setName(String name) ``` **Parameters** _name_ Type: String **Return Value** Type: void #### setType(type) **Signature** ```java public void setType(String type) ``` **Parameters** _type_ Type: String **Return Value** Type: void ## WorkflowsUpdateStepRequest Class Sends a request to update the configuration for a workflow step. **Usage** See Slack’s [workflows.updateStep method](https://api.slack.com/methods/workflows.updateStep). ### WorkflowsUpdateStepRequest Methods The following are methods for `WorkflowsUpdateStepRequest`. #### builder() **Signature** ```java public static Slack.WorkflowsUpdateStepRequest.Builder builder() ``` **Return Value** Type: Slack.WorkflowsUpdateStepRequest.Builder ## WorkflowsUpdateStepRequest.Builder Class Contains methods to build an instance of the `Slack.WorkflowsStepFailedRequest` class. A Builder object is obtained by invoking one of the `WorkflowsStepFailedRequest.Builder` methods defined by the `WorkflowsStepFailedRequest` class. ### WorkflowsUpdateStepRequest.Builder Methods The following are methods for `WorkflowsUpdateStepRequest.Builder`. These methods are optional unless specified otherwise. #### build() Required. Returns an instance of `Slack.WorkflowsUpdateStepRequest`. **Signature** ```java public Slack.WorkflowsUpdateStepRequest build() ``` **Return Value** Type: Slack.WorkflowsUpdateStepRequest #### inputs(inputs) **Signature** ```java public Slack.WorkflowsUpdateStepRequest.Builder inputs(Map inputs) ``` **Parameters** _inputs_ Type: Map **Return Value** Type: Slack.WorkflowsUpdateStepRequest.Builder #### inputsAsString(inputsAsString) **Signature** ```java public Slack.WorkflowsUpdateStepRequest.Builder inputsAsString(String inputsAsString) ``` **Parameters** _inputsAsString_ Type: String **Return Value** Type: Slack.WorkflowsUpdateStepRequest.Builder #### outputs(outputs) **Signature** ```java public Slack.WorkflowsUpdateStepRequest.Builder outputs(List outputs) ``` **Parameters** _outputs_ Type: List **Return Value** Type: Slack.WorkflowsUpdateStepRequest.Builder #### outputsAsString(outputsAsString) **Signature** ```java public Slack.WorkflowsUpdateStepRequest.Builder outputsAsString(String outputsAsString) ``` **Parameters** _outputsAsString_ Type: String **Return Value** Type: Slack.WorkflowsUpdateStepRequest.Builder #### stepImageUrl(stepImageUrl) **Signature** ```java public Slack.WorkflowsUpdateStepRequest.Builder stepImageUrl(String stepImageUrl) ``` **Parameters** _stepImageUrl_ Type: String **Return Value** Type: Slack.WorkflowsUpdateStepRequest.Builder #### stepName(stepName) **Signature** ```java public Slack.WorkflowsUpdateStepRequest.Builder stepName(String stepName) ``` **Parameters** _stepName_ Type: String **Return Value** Type: Slack.WorkflowsUpdateStepRequest.Builder #### workflowStepEditId(workflowStepEditId) Required. A context identifier provided with `view_submission` payloads used to call back to [WorkflowsUpdateStepRequest](#workflowsupdatesteprequest-class). **Signature** ```java public Slack.WorkflowsUpdateStepRequest.Builder workflowStepEditId(String workflowStepEditId) ``` **Parameters** _workflowStepEditId_ Type: String **Return Value** Type: Slack.WorkflowsUpdateStepRequest.Builder ## WorkflowsUpdateStepResponse Class Update the configuration for a workflow step. **Usage** See Slack’s [workflows.updateStep method](https://api.slack.com/methods/workflows.updateStep). ### WorkflowsUpdateStepResponse Methods This class contains [standard response methods](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md).