Work with User Groups

The following are Apex classes for the Slack usergroups API methods.

Represents a group of users.

Usage

See Slack's usergroup object type.

Usergroup Methods

The following are methods for Usergroup.

getAutoType()

Signature

Return Value

Type: String

getChannelCount()

Signature

Return Value

Type: Integer

getCreatedBy()

Signature

Return Value

Type: String

getDateCreate()

Signature

Return Value

Type: Integer

getDateDelete()

Signature

Return Value

Type: Integer

getDateUpdate()

Signature

Return Value

Type: Integer

getDeletedBy()

Signature

Return Value

Type: String

getDescription()

Signature

Return Value

Type: String

getEnterpriseSubteamId()

Signature

Return Value

Type: String

getHandle()

Signature

Return Value

Type: String

getId()

Signature

Return Value

Type: String

getName()

Signature

Return Value

Type: String

getPrefs()

Signature

Return Value

Type: Slack.Usergroup.Prefs

getTeamId()

Signature

Return Value

Type: String

getUpdatedBy()

Signature

Return Value

Type: String

getUserCount()

Signature

Return Value

Type: Integer

getUsers()

Signature

Return Value

Type: List<String>

isAutoProvision()

Signature

Return Value

Type: Boolean

isExternal()

Signature

Return Value

Type: Boolean

isSubteam()

Signature

Return Value

Type: Boolean

isUsergroup()

Signature

Return Value

Type: Boolean

setAutoProvision(autoProvision)

Signature

Parameters

autoProvision

Type: Boolean

Return Value

Type: void

setAutoType(autoType)

Signature

Parameters

autoType

Type: String

Return Value

Type: void

setChannelCount(channelCount)

Signature

Parameters

channelCount

Type: Integer

Return Value

Type: void

setCreatedBy(createdBy)

Signature

Parameters

createdBy

Type: String

Return Value

Type: void

setDateCreate(dateCreate)

Signature

Parameters

dateCreate

Type: Integer

Return Value

Type: void

setDateDelete(dateDelete)

Signature

Parameters

dateDelete

Type: Integer

Return Value

Type: void

setDateUpdate(dateUpdate)

Signature

Parameters

dateUpdate

Type: Integer

Return Value

Type: void

setDeletedBy(deletedBy)

Signature

Parameters

deletedBy

Type: String

Return Value

Type: void

setDescription(description)

Signature

Parameters

description

Type: String

Return Value

Type: void

setEnterpriseSubteamId(enterpriseSubteamId)

Signature

Parameters

enterpriseSubteamId

Type: String

Return Value

Type: void

setExternal(external)

Signature

Parameters

external

Type: Boolean

Return Value

Type: void

setHandle(handle)

Signature

Parameters

handle

Type: String

Return Value

Type: void

setId(id)

Signature

Parameters

id

Type: String

Return Value

Type: void

setName(name)

Signature

Parameters

name

Type: String

Return Value

Type: void

setPrefs(prefs)

Signature

Parameters

prefs

Type: Slack.Usergroup.Prefs

Return Value

Type: void

setSubteam(subteam)

Signature

Parameters

subteam

Type: Boolean

Return Value

Type: void

setTeamId(teamId)

Signature

Parameters

teamId

Type: String

Return Value

Type: void

setUpdatedBy(updatedBy)

Signature

Parameters

updatedBy

Type: String

Return Value

Type: void

setUserCount(userCount)

Signature

Parameters

userCount

Type: Integer

Return Value

Type: void

setUsergroup(usergroup)

Signature

Parameters

usergroup

Type: Boolean

Return Value

Type: void

setUsers(users)

Signature

Parameters

users

Type: List<String>

Return Value

Type: void

Represent the default channels and groups (private channels) that members are invited to when they join.

Usage

See Slack's usergroup object type.

Usergroup.Prefs Methods

The following are methods for Usergroup.Prefs.

getChannels()

Signature

Return Value

Type: List<String>

getGroups()

Signature

Return Value

Type: List<String>

setChannels(channels)

Signature

Parameters

channels

Type: List<String>

Return Value

Type: void

setGroups(groups)

Signature

Parameters

groups

Type: List<String>

Return Value

Type: void

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

Return Value

Type: Slack.UsergroupsCreateRequest.Builder.

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

Return Value

Type: Slack.UsergroupsCreateRequest

channels(channels)

Signature

Parameters

channels

Type: List<String>

Return Value

Type: Slack.UsergroupsCreateRequest.Builder

description(description)

Signature

Parameters

description Type: String

Return Value

Type: Slack.UsergroupsCreateRequest.Builder

handle(handle)

Signature

Parameters

handle Type: String

Return Value

Type: Slack.UsergroupsCreateRequest.Builder

includeCount(includeCount)

Signature

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

Parameters

name Type: String

Return Value

Type: Slack.UsergroupsCreateRequest.Builder

teamId(teamId)

Signature

Parameters

teamId

Type: String

Return Value

Type: Slack.UsergroupsCreateRequest.Builder

Creates a user group.

UsergroupsCreateResponse Methods

This class contains standard response methods.

The following are methods for UsergroupsCreateResponse.

getUsergroup()

Signature

Return Value

Type: Slack.Usergroup

setUsergroup(usergroup)

Signature

Parameters

usergroup

Type: Slack.Usergroup

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

Return Value

Type: Slack.UsergroupsDisableRequest

includeCount(includeCount)

Signature

Parameters

includeCount

Type: Boolean

Return Value

Type: Slack.UsergroupsDisableRequest.Builder

usergroup(usergroup)

Required. The ID of the user group to disable.

Signature

Parameters

usergroup Type: String

Return Value

Type: Slack.UsergroupsDisableRequest.Builder

teamId(teamId)

Signature

Parameters

teamId

Type: String

Return Value

Type: Slack.UsergroupsDisableRequest.Builder

Sends a request to disable an existing user group.

UsergroupsDisableRequest Methods

The following are methods for UsergroupsDisableRequest.

builder()

Signature

Return Value

Type: Slack.UsergroupsDisableRequest.Builder

Disables an existing user group.

UsergroupsDisableResponse Methods

This class contains standard response methods.

The following are methods for UsergroupsDisableResponse.

getUsergroup()

Signature

Return Value

Type: Slack.Usergroup

setUsergroup(usergroup)

Signature

Parameters

usergroup

Type: Slack.Usergroup

Return Value

Type: void

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

Return Value

Type: Slack.UsergroupsEnableRequest

includeCount(includeCount)

Signature

Parameters

includeCount Type: Boolean

Return Value

Type: Slack.UsergroupsEnableRequest.Builder

usergroup(usergroup)

Required. The ID of the user group to enable.

Signature

Parameters

usergroup Type: String

Return Value

Type: Slack.UsergroupsEnableRequest.Builder

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

Return Value

Type: Slack.UsergroupsEnableRequest.Builder

teamId(teamId)

Signature

Parameters

teamId

Type: String

Return Value

Type: Slack.UsergroupsEnableRequest.Builder

Enables a user group.

UsergroupsEnableResponse Methods

This class contains standard response methods.

The following are methods for UsergroupsEnableResponse.

getUsergroup()

Signature

Return Value

Type: Slack.Usergroup

setUsergroup(usergroup)

Signature

Parameters

usergroup

Type: Slack.Usergroup

Return Value

Type: void

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

Return Value

Type: Slack.UsergroupsListRequest

includeCount(includeCount)

Signature

Parameters

includeCount Type: Boolean

Return Value

Type: Slack.UsergroupsListRequest.Builder

includeDisabled(includeDisabled)

Signature

Parameters

includeDisabled Type: Boolean

Return Value

Type: Slack.UsergroupsListRequest.Builder

includeUsers(includeUsers)

Signature

Parameters

includeUsers Type: Boolean

Return Value

Type: Slack.UsergroupsListRequest.Builder

teamId(teamId)

Signature

Parameters

teamId

Type: String

Return Value

Type: Slack.UsergroupsListRequest.Builder

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

Return Value

Type: Slack.UsergroupsListRequest.Builder

Lists all user groups for a team.

UsergroupsListResponse Methods

This class contains standard response methods.

The following are methods for UsergroupsListResponse.

getUsergroups()

Signature

Return Value

Type: List<Slack.Usergroup>

setUsergroups(usergroups)

Signature

Parameters

usergroups

Type: List<Slack.Usergroup>

Return Value

Type: void

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

Return Value

Type: Slack.UsergroupsUpdateRequest

channnels()

Signature

Parameters

channels

Type: List<String>

Return Value

Type: Slack.UsergroupsUpdateRequest.Builder

description(description)

Signature

Parameters

description

Type: String

Return Value

Type: Slack.UsergroupsUpdateRequest.Builder

handle(handle)

Signature

Parameters

handle

Type: String

Return Value

Type: Slack.UsergroupsUpdateRequest.Builder

includeCount(includeCount)

Signature

Parameters

includeCount

Type: Boolean

Return Value

Type: Slack.UsergroupsUpdateRequest.Builder

name(name)

Parameters

name

Type: String

Signature

Return Value

Type: Slack.UsergroupsUpdateRequest.Builder

teamId(teamId)

Signature

Parameters

teamId

Type: String

Return Value

Type: Slack.UsergroupsUpdateRequest.Builder

usergroup(usergroup)

Required. The ID of the user group to update.

Signature

Parameters

usergroup

Type: String

Return Value

Type: Slack.UsergroupsUpdateRequest.Builder

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

Return Value

Type: Slack.UsergroupsUpdateRequest.Builder

Updates the list of users for a user group.

UsergroupsUpdateResponse Methods

This class contains standard response methods.

The following are methods for UsergroupsUpdateResponse.

getUsergroup()

Signature

Return Value

Type: Slack.Usergroup

setUsergroup(usergroup)

Signature

Parameters

usergroup

Type: Slack.Usergroup

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

Return Value

Type: Slack.UsergroupsUsersListRequest

includeDisabled(includeDisabled)

Signature

Parameters

includeDisabled

Type: Boolean

Return Value

Type: Slack.UsergroupsUsersListRequest.Builder

teamId(teamId)

Signature

Parameters

teamId

Type: String

Return Value

Type: Slack.UsergroupsUsersListRequest.Builder

usergroup(usergroup)

Required. The ID of the user group to list.

Signature

Parameters

usergroup

Type: String

Return Value

Type: Slack.UsergroupsUsersListRequest.Builder

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

Return Value

Type: Slack.UsergroupsUsersListRequest.Builder

Lists all users in a user group.

UsergroupsUsersListResponse Methods

This class contains standard response methods.

The following are methods for UsergroupsUsersListResponse.

getUsers()

Signature

Return Value

Type: List<String>

setUsers(users)

Signature

Parameters

users

Type: String

Return Value

Type: void

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

Return Value

Type: Slack.UsergroupsUsersUpdateRequest

includeCount(includeCount)

Signature

Parameters

includeCount

Type: Boolean

Return Value

Type: Slack.UsergroupsUsersUpdateRequest.Builder

teamId(teamId)

Signature

Parameters

teamId

Type: String

Return Value

Type: Slack.UsergroupsUsersUpdateRequest.Builder

usergroup(usergroup)

Required. The ID of the user group to update.

Signature

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

Parameters

users

Type: List<String>

Return Value

Type: Slack.UsergroupsUsersUpdateRequest.Builder

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

Return Value

Type: Slack.UsergroupsUsersUpdateRequest.Builder

Updates the list of users for a user group.

UsergroupsUsersUpdateResponse Methods

This class contains standard response methods.

The following are methods for UsergroupsUsersUpdateResponse.

getUsergroup()

Signature

Return Value

Type: Slack.Usergroup

setUsergroup(usergroup)

Signature

Parameters

usergroup

Type: Slack.Usergroup