SlackWebAPI v1.2.0 SlackWebAPI.Api.Pins View Source

API calls for all endpoints tagged Pins.

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

pins_add(connection, opts \\ [])

View Source
pins_add(Tesla.Env.client(), keyword()) ::
  {:ok, map()} | {:error, Tesla.Env.t()}

Pins an item to a channel.

Parameters

  • connection (SlackWebAPI.Connection): Connection to server
  • opts (KeywordList): [optional] Optional parameters

    • :token (String.t): Authentication token. Requires scope: pins:write
    • :file_comment (String.t): File comment to pin.
    • :timestamp (float()): Timestamp of the message to pin.
    • :file (String.t): File to pin.
    • :channel (String.t): Channel to pin the item in.

Returns

{:ok, %{}} on success {:error, info} on failure

Link to this function

pins_list(connection, opts \\ [])

View Source
pins_list(Tesla.Env.client(), keyword()) ::
  {:ok, Map.t()} | {:error, Tesla.Env.t()}

Lists items pinned to a channel.

Parameters

  • connection (SlackWebAPI.Connection): Connection to server
  • opts (KeywordList): [optional] Optional parameters

    • :token (String.t): Authentication token. Requires scope: pins:read
    • :channel (String.t): Channel to get pinned items for.

Returns

{:ok, %SlackWebAPI.Model.Map{}} on success {:error, info} on failure

Link to this function

pins_remove(connection, opts \\ [])

View Source
pins_remove(Tesla.Env.client(), keyword()) ::
  {:ok, map()} | {:error, Tesla.Env.t()}

Un-pins an item from a channel.

Parameters

  • connection (SlackWebAPI.Connection): Connection to server
  • opts (KeywordList): [optional] Optional parameters

    • :token (String.t): Authentication token. Requires scope: pins:write
    • :file_comment (String.t): File comment to un-pin.
    • :timestamp (float()): Timestamp of the message to un-pin.
    • :file (String.t): File to un-pin.
    • :channel (String.t): Channel where the item is pinned to.

Returns

{:ok, %{}} on success {:error, info} on failure