Work with Do Not Disturb Mode

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

Sends a request to end the current user's Do Not Disturb session immediately.

Usage

See Slack’s dnd.endDnd method.

DndEndDndRequest Methods

The following are methods for DndEndDndRequest.

builder()

Builds a request object that's used when executing the API call.

Signature

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

Return Value

Type: Slack.DndEndDndRequest


Ends the current user's Do Not Disturb session immediately.

Usage

See Slack’s dnd.endDnd method.

DndEndDndResponse Methods

This class contains standard response methods.


Sends a request to end the current user's snooze mode immediately.

Usage

See Slack’s dnd.endSnooze method.

DndEndSnoozeRequest Methods

The following are methods for DndEndSnoozeRequest.

builder()

Builds a request object that's used when executing the API call.

Signature

Return Value

Type: Slack.DndEndSnoozeRequest.Builder


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

Return Value

Type: Slack.DndEndSnoozeRequest


Ends the current user's snooze mode immediately.

Usage

See Slack’s dnd.endSnooze method.

DndEndSnoozeResponse Methods

This class contains standard response methods.

The following are methods for DndEndSnoozeResponse.

getNextDndEndTs()

Gets the timestamp for when the next Do Not Disturb session ends.

Signature

Return Value

Type: Integer

getNextDndStartTs()

Gets the timestamp for when the next Do Not Disturb session starts.

Signature

Return Value

Type: Integer

isDndEnabled()

Specifies whether the user’s Do Not Disturb mode is enabled.

Signature

Return Value

Type: Boolean

isSnoozeEnabled()

Specifies whether snooze is enabled.

Signature

Return Value

Type: Boolean

setDndEnabled(dndEnabled)

Sets whether Do Not Disturb mode is enabled .

Signature

Parameters

dndEnabled

Type: Boolean

setNextDndEndTs(nextDndEndTs)

Signature

Parameters

nextDndEndTs

Type: Integer

Return Value

Type: void

setNextDndStartTs(nextDndStartTs)

Signature

Parameters

nextDndStartTs

Type: Integer

Return Value

Type: void

setSnoozeEnabled(snoozeEnabled)

Signature

Parameters

snoozeEnabled

Type: Boolean

Return Value

Type: void


Sends a request to retrieve a user’s current Do Not Disturb status.

Usage

See Slack’s dnd.info method.

DndInfoRequest Methods

The following are methods for DndInfoRequest.

builder()

Builds a request object that's used when executing the API call.

Signature

Return Value

Type: Slack.DndInfoRequest.Builder


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

Return Value

Type: Slack.DndInfoRequest

user(user)

Signature

Parameters

user

Type: String

Return Value

Type: Slack.DndInfoRequest.Builder

teamId(teamId)

Signature

Parameters

teamId

Type: String

Return Value

Type: Slack.DndInfoRequest.Builder

Retrieves a user’s current Do Not Disturb status.

Usage

See Slack’s dnd.info method.

DndInfoResponse Methods

This class contains standard response methods.

The following are methods for DndInfoResponse.

getNextDndEndTs()

Gets the timestamp for when the next Do Not Disturb session ends.

Signature

Return Value

Type: Integer

getNextDndStartTs()

Gets the timestamp for when the next Do Not Disturb session starts.

Signature

Return Value

Type: Integer

getSnoozeEndtime()

Gets the timestamp for when the snooze ends.

Signature

Return Value

Type: Integer

getSnoozeRemaining()

Gets the remaining time for the snooze.

Signature

Return Value

Type: Integer

isDndEnabled()

Specifies whether the user’s Do Not Disturb mode is enabled.

Signature

Return Value

Type: Boolean

isSnoozeEnabled()

Specifies whether snooze is enabled.

Signature

Return Value

Type: Boolean

setDndEnabled(dndEnabled)

Sets whether Do Not Disturb mode is enabled .

Signature

Parameters

dndEnabled

Type: Boolean

setNextDndEndTs(nextDndEndTs)

Signature

Parameters

nextDndEndTs

Type: Integer

Return Value

Type: void

setNextDndStartTs(nextDndStartTs)

Signature

Parameters

nextDndStartTs

Type: Integer

Return Value

Type: void

setSnoozeEnabled(snoozeEnabled)

Signature

Parameters

snoozeEnabled

Type: Boolean

Return Value

Type: void

setSnoozeEndtime(snoozeEndtime)

Signature

Parameters

snoozeEndtime

Type: Integer

Return Value

Type: void

setSnoozeRemaining(snoozeRemaining)

Signature

Parameters

snoozeRemaining

Type: Integer

Return Value

Type: void


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.

DndSetSnoozeRequest Methods

The following are methods for DndSetSnoozeRequest.

builder()

Builds a request object that's used when executing the API call.

Signature

Return Value

Type: Slack.DndSetSnoozeRequest.Builder


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

Return Value

Type: Slack.DndSetSnoozeRequest

numMinutes(numMinutes)

Signature

Parameters

numMinutes

Type: Integer

Return Value

Type: Slack.DndSetSnoozeRequest.Builder


Turns on Do Not Disturb mode for the current user, or changes its duration.

Usage

See Slack’s dnd.setSnooze method

DndSetSnoozeResponse Methods

This class contains standard response methods.

The following are methods for DndSetSnoozeResponse.

getSnoozeEndtime()

Gets the timestamp for when the snooze ends.

Signature

Return Value

Type: Integer

getSnoozeRemaining()

Gets the remaining time for the snooze.

Signature

Return Value

Type: Integer

isSnoozeEnabled()

Specifies whether snooze is enabled.

Signature

Return Value

Type: Boolean

setSnoozeEnabled(snoozeEnabled)

Sets whether the user’s Do Not Disturb mode is enabled.

Signature

Parameters

snoozeEnabled

Type: Boolean

Return Value

Type: void

setSnoozeEndtime(snoozeEndtime)

Sets when the user’s Do Not Disturb mode ends.

Signature

Parameters

snoozeEndtime

Type: Integer

Return Value

Type: void

setSnoozeRemaining(snoozeRemaining)

Sets how long more the Do Not Disturb mode lasts.

Signature

Parameters

snoozeRemaining

Type: Integer

Return Value

Type: void


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.

DndTeamInfoRequest Methods

The following are methods for DndTeamInfoRequest.

builder()

Builds a request object that's used when executing the API call.

Signature

Return Value

Type: Slack.DndTeamInfoRequest.Builder


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

Return Value

Type: Slack.DndTeamInfoRequest

teamId(teamId)

Signature

Parameters

teamId

Type: String

Return Value

Type: Slack.DndTeamInfoRequest.Builder

users(users)

Required. The comma-separated list of users to fetch Do Not Disturb status for.

Signature

Parameters

users

Type: List<String>

Return Value

Type: Slack.DndTeamInfoRequest.Builder


Retrieves the Do Not Disturb status for up to 50 users on a team.

Usage

See Slack’s dnd.teamInfo method.

DndTeamInfoResponse Methods

This class contains standard response methods.

The following are methods for DndTeamInfoResponse.

getUsers()

Signature

Return Value

Type: Map<String,Slack.DndTeamInfoResponse.DndTeamMemberInfo>

setUsers(users)

Signature

Parameters

users

Type: Map<String,Slack.DndTeamInfoResponse.DndTeamMemberInfo>

Return Value

Type: void


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

Return Value

Type: Integer

getNextDndStartTs()

Signature

Return Value

Type: Integer

isDndEnabled()

Signature

Return Value

Type: Boolean

setDndEnabled(dndEnabled)

Signature

Parameters

dndEnabled

Type: Boolean

Return Value

Type: void