Slack.Web.Dnd (SlackKit v1.0.0-alpha.0)

View Source

Summary

Functions

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

Ends the current user's snooze mode immediately.

Retrieves a user's current Do Not Disturb status.

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

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

Functions

end_dnd(optional_params \\ %{})

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

API reference

Rate limit: Tier 2: 20+ per minute
Scopes:

View on docs.slack.dev ↗

Errors the API can return:

  • not_in_dnd - The auth'd user isn't in DND mode.

See the Common Errors guide for errors returned by every Web API method.

end_snooze(optional_params \\ %{})

Ends the current user's snooze mode immediately.

API reference

Rate limit: Tier 2: 20+ per minute
Scopes:

View on docs.slack.dev ↗

Errors the API can return:

  • snooze_end_failed - There was a problem setting the user's Do Not Disturb status

See the Common Errors guide for errors returned by every Web API method.

info(optional_params \\ %{})

Retrieves a user's current Do Not Disturb status.

API reference

Rate limit: Tier 3: 50+ per minute
Scopes:

View on docs.slack.dev ↗

Optional Params

  • team_id - Encoded team id where passed in user param belongs, required if org token is used. If no user param is passed, then a team which has access to the app should be passed
  • user - User to fetch status for (defaults to current user) ex: U1234

Errors the API can return:

  • user_not_found - Value passed for user was invalid.
  • user_not_visible - User is not visible for this request.

See the Common Errors guide for errors returned by every Web API method.

set_snooze(num_minutes, optional_params \\ %{})

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

API reference

Rate limit: Tier 2: 20+ per minute
Scopes:

View on docs.slack.dev ↗

Required Params

  • num_minutes - This argument is required. Number of minutes, from now, to snooze until. ex: 60

Errors the API can return:

  • missing_duration - No value provided for num_minutes
  • snooze_failed - There was a problem setting the user's Do Not Disturb status
  • too_long - The value for num_minutes was too large

See the Common Errors guide for errors returned by every Web API method.

team_info(users, optional_params \\ %{})

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

API reference

Rate limit: Tier 2: 20+ per minute
Scopes:

View on docs.slack.dev ↗

Required Params

  • users - Comma-separated list of users to fetch Do Not Disturb status for ex: U1234,W4567

Optional Params

  • team_id - Encoded team id where passed in users belong, required if org token is used

Errors the API can return:

  • no_users_provided - Must provide more than one user.
  • user_not_visible - User is not visible for this request.

See the Common Errors guide for errors returned by every Web API method.