---
schema_version: "1"
id: fdca6b5d9a7a400561a9469957efc100e7f1b0425dc77506747e22041d93cde0
title: Authorize an App
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/salesforce-slack-sdk/apex-slack-sdk/guides/apex_ref/apex_ref_auth.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_auth.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: d2e2b34535d8adeb79e6bcda5c8973291bb1eefc595aaaaf9d1d1f145d0cd59c
products:
  - Apex SDK for Slack (Beta)
---
# 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<Slack.AuthTeamsListResponse.Team> getTeams()
```

**Return Value**

Type: List<Slack.AuthTeamsListResponse.Team>

#### 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<Slack.AuthTeamsListResponse.Team> teams)
```

**Parameters**

_teams_

Type: List<Slack.AuthTeamsListResponse.Team>

**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
