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

View Source

Summary

Functions

Gets reactions for an item.

Lists reactions made by a user.

Removes a reaction from an item.

Functions

add(channel, name, timestamp, optional_params \\ %{})

Adds a reaction to an item.

API reference

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

View on docs.slack.dev ↗

Required Params

  • channel - Channel where the message to add reaction to was posted. Specify only channel and timestamp instead.
  • name - Reaction (emoji) name ex: thumbsup
  • timestamp - Timestamp of the message to add reaction to. Specify only channel and timestamp instead.

Errors the API can return:

  • already_reacted - The specified item already has the user/reaction combination.
  • bad_timestamp - Value passed for timestamp was invalid.
  • channel_not_found - Value passed for channel is invalid.
  • external_channel_migrating - The channel is in the process of being migrated.
  • invalid_name - Value passed for name was invalid.
  • is_archived - Channel specified has been archived.
  • message_not_found - Message specified by channel and timestamp does not exist.
  • no_access - User does not have access to react to this canvas.
  • no_item_specified - combination of channel and timestamp was not specified.
  • not_reactable - Whatever you passed in, like a file or file_comment, can't be reacted to anymore. Your app can react to messages though.
  • thread_locked - Reactions are disabled as the specified message is part of a locked thread.
  • too_many_emoji - The limit for distinct reactions (i.e emoji) on the item has been reached.
  • too_many_reactions - The limit for reactions a person may add to the item has been reached.

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

get(optional_params \\ %{})

Gets reactions for an item.

API reference

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

View on docs.slack.dev ↗

Optional Params

  • channel - Channel where the message to get reactions for was posted. ex: C0NF841BK
  • file - File to get reactions for. ex: F1234567890
  • file_comment - File comment to get reactions for.
  • full - If true always return the complete reaction list.
  • timestamp - Timestamp of the message to get reactions for. ex: 1524523204.000192

Errors the API can return:

  • bad_timestamp - Value passed for timestamp was invalid.
  • channel_not_found - Value passed for channel was invalid.
  • file_comment_not_found - File comment specified by file_comment does not exist.
  • file_not_found - File specified by file does not exist.
  • message_not_found - Message specified by channel and timestamp does not exist.
  • no_item_specified - file, file_comment, or combination of channel and timestamp was not specified.

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

list(optional_params \\ %{})

Lists reactions made by a user.

API reference

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

View on docs.slack.dev ↗

Optional Params

  • count -
  • cursor - Parameter for pagination. Set cursor equal to the next_cursor attribute returned by the previous request's response_metadata. This parameter is optional, but pagination is mandatory: the default value simply fetches the first "page" of the collection. See pagination for more details. ex: dXNlcjpVMDYxTkZUVDI=
  • full - If true always return the complete reaction list.
  • limit - The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached. 0 ex: 20
  • page -
  • team_id - encoded team id to list reactions in, required if org token is used
  • user - Show reactions made by this user. Defaults to the authed user.

Errors the API can return:

  • user_not_found - Value passed for user was invalid.

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

remove(name, optional_params \\ %{})

Removes a reaction from an item.

API reference

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

View on docs.slack.dev ↗

Required Params

  • name - Reaction (emoji) name. ex: thumbsup

Optional Params

  • channel - Channel where the message to remove reaction from was posted. One of file, file_comment, or the combination of channel and timestamp must be specified.
  • file - File to remove reaction from. One of file, file_comment, or the combination of channel and timestamp must be specified.
  • file_comment - File comment to remove reaction from. One of file, file_comment, or the combination of channel and timestamp must be specified.
  • timestamp - Timestamp of the message to remove reaction from. One of file, file_comment, or the combination of channel and timestamp must be specified.

Errors the API can return:

  • bad_timestamp - Value passed for timestamp was invalid.
  • channel_not_found - The specified channel was not found.
  • external_channel_migrating - The reaction is in a channel that is being migrated
  • file_comment_not_found - File comment specified by file_comment does not exist.
  • file_not_found - File specified by file does not exist.
  • invalid_name - Value passed for name was invalid.
  • message_not_found - Message specified by channel and timestamp does not exist.
  • no_access - The requestor does not have permission to perform this action on the specified item.
  • no_item_specified - file, file_comment, or combination of channel and timestamp was not specified.
  • no_reaction - The specified reaction does not exist, or the requestor is not the original reaction author.
  • thread_locked - Reactions are disabled as the specified message is part of a locked thread.

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