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

View Source

Summary

Functions

Save an item for later. Formerly known as adding a star.

Listed a user's saved items, formerly known as stars.

Removes a saved item (star) from an item.

Functions

add(optional_params \\ %{})

Save an item for later. Formerly known as adding a star.

API reference

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

View on docs.slack.dev ↗

Optional Params

  • channel - Channel to add star to, or channel where the message to add star to was posted (used with timestamp). One of file, file_comment, channel, or the combination of channel and timestamp must be specified.
  • file - File to add star to. One of file, file_comment, channel, or the combination of channel and timestamp must be specified.
  • file_comment - File comment to add star to. One of file, file_comment, channel, or the combination of channel and timestamp must be specified.
  • timestamp - Timestamp of the message to add star to. One of file, file_comment, channel, or the combination of channel and timestamp must be specified.

Errors the API can return:

  • already_starred - The specified item has already been starred by the authenticated user.
  • bad_timestamp - Value passed for timestamp was invalid.
  • channel_not_found - Channel, private group, or DM specified by channel does not exist
  • external_channel_migrating - Channel is undergoing active migration
  • 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, channel and timestamp was not specified.

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

list(optional_params \\ %{})

Listed a user's saved items, formerly known as stars.

API reference

Rate limit: Tier 3: 50+ 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=
  • 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 stars in, required if org token is used

Errors the API can return:

  • missing_argument - A required argument is missing.

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

remove(optional_params \\ %{})

Removes a saved item (star) from an item.

API reference

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

View on docs.slack.dev ↗

Optional Params

  • channel - Channel to remove star from, or channel where the message to remove star from was posted (used with timestamp). One of file, file_comment, channel, or the combination of channel and timestamp must be specified.
  • file - File to remove star from. One of file, file_comment, channel, or the combination of channel and timestamp must be specified.
  • file_comment - File comment to remove star from. One of file, file_comment, channel, or the combination of channel and timestamp must be specified.
  • timestamp - Timestamp of the message to remove star from. One of file, file_comment, channel, 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 - Channel, private group, or DM specified by channel does not exist
  • 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, channel and timestamp was not specified.
  • not_starred - The specified item is not currently starred by the authenticated user.

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