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

View Source

Summary

Functions

Pins an item to a channel.

Lists items pinned to a channel.

Un-pins an item from a channel.

Functions

add(channel, optional_params \\ %{})

Pins an item to a channel.

API reference

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

View on docs.slack.dev ↗

Required Params

  • channel - Channel to pin the messsage to. You must also include a timestamp when pinning messages. Both the channel and timestamp arguments are functionally required. The provided channel should be the ID of a public or private channel you want to pin to and the timestamp should be the ts value of a message within that conversation.

Optional Params

  • timestamp - Timestamp of the message to pin. You must also include the channel. Both the channel and timestamp arguments are functionally required. The provided channel should be the ID of a public or private channel you want to pin to and the timestamp should be the ts value of a message within that conversation.

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
  • external_channel_migrating - Channel is undergoing an active migration.
  • file_not_found - File not found.
  • 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.
  • not_in_channel - Item is not in channel.
  • not_pinnable - This message type is not pinnable.
  • restricted_action - The user does not have permission to add pins to the channel.
  • too_many_pins - Too many pins in channel.

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

list(channel, optional_params \\ %{})

Lists items pinned to a channel.

API reference

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

View on docs.slack.dev ↗

Required Params

  • channel - Channel to get pinned items for.

Errors the API can return:

  • channel_not_found - Value passed for channel was invalid.
  • restricted_action - The user does not have permission to view the channel.

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

remove(channel, optional_params \\ %{})

Un-pins an item from a channel.

API reference

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

View on docs.slack.dev ↗

Required Params

  • channel - Channel where the item is pinned to. The channel argument is required and one of file, file_comment, or timestamp must also be specified.

Optional Params

  • timestamp - Timestamp of the message to un-pin. The channel argument is required and one of file, file_comment, or timestamp must also be specified.

Errors the API can return:

  • bad_timestamp - Value passed for timestamp was invalid.
  • channel_not_found - The channel argument was not specified or was invalid
  • external_channel_migrating - Channel is undergoing an 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 - One of file, file_comment, or timestamp was not specified.
  • no_pin - The pin could not be found.
  • not_pinned - The specified item is not pinned to the channel.
  • restricted_action - The user does not have permission to remove pins from the channel.

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