Slack v0.23.5 Slack.Web.Pins View Source

Link to this section Summary

Functions

Pins an item to a channel

Lists items pinned to a channel

Un-pins an item from a channel

Link to this section Functions

Link to this function

add(channel, optional_params \\ %{}) View Source

Pins an item to a channel.

Required Params

  • channel - Channel to pin the item in.

Optional Params

  • file - File to pin.
  • file_comment - File comment to pin.
  • timestamp - Timestamp of the message to pin.

Errors the API can return:

  • already_pinned - The specified item is already pinned to the channel.
  • bad_timestamp - Value passed for timestamp was invalid.
  • channel_not_found - The channel argument was not specified or 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.
  • file_not_shared - File specified by file is not public nor shared to the channel.
  • message_not_found - Message specified by channel and timestamp does not exist.
  • no_item_specified - One of file, file_comment, or timestamp was not specified.
  • permission_denied - The user does not have permission to add pins to the channel.
Link to this function

list(channel, optional_params \\ %{}) View Source

Lists items pinned to a channel.

Required Params

  • channel - Channel to get pinned items for.

Errors the API can return:

  • channel_not_found - Value passed for channel was invalid.
Link to this function

remove(channel, optional_params \\ %{}) View Source

Un-pins an item from a channel.

Required Params

  • channel - Channel where the item is pinned to.

Optional Params

  • file - File to un-pin.
  • file_comment - File comment to un-pin.
  • timestamp - Timestamp of the message to un-pin.

Errors the API can return:

  • bad_timestamp - Value passed for timestamp 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 - One of file, file_comment, or timestamp was not specified.
  • not_pinned - The specified item is not pinned to the channel.
  • permission_denied - The user does not have permission to remove pins from the channel.