Slack v0.23.5 Slack.Web.Im View Source

Link to this section Summary

Functions

Close a direct message channel

Fetches history of messages and events from direct message channel

Lists direct message channels for the calling user

Sets the read cursor in a direct message channel

Opens a direct message channel

Retrieve a thread of messages posted to a direct message conversation

Link to this section Functions

Link to this function

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

Close a direct message channel.

Required Params

  • channel - Direct message channel to close.

Errors the API can return:

  • channel_not_found - Value passed for channel was invalid.
  • user_does_not_own_channel - Calling user does not own this DM channel.
Link to this function

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

Fetches history of messages and events from direct message channel.

Required Params

  • channel - Direct message channel to fetch history for.

Optional Params

  • count - Number of messages to return, between 1 and 1000. ex: 100
  • inclusive - Include messages with latest or oldest timestamp in results. ex: 1
  • latest - End of time range of messages to include in results.
  • oldest - Start of time range of messages to include in results.
  • unreads - Include unread_count_display in the output? ex: 1

Errors the API can return:

  • channel_not_found - Value passed for channel was invalid.
  • invalid_ts_latest - Value passed for latest was invalid
  • invalid_ts_oldest - Value passed for oldest was invalid
Link to this function

list(optional_params \\ %{}) View Source

Lists direct message channels for the calling user.

Link to this function

mark(channel, ts, optional_params \\ %{}) View Source

Sets the read cursor in a direct message channel.

Required Params

  • channel - Direct message channel to set reading cursor in.
  • ts - Timestamp of the most recently seen message.

Errors the API can return:

  • channel_not_found - Value passed for channel was invalid.
  • invalid_timestamp - Value passed for timestamp was invalid.
  • not_in_channel - Caller is not a member of the channel.
Link to this function

open(user, optional_params \\ %{}) View Source

Opens a direct message channel.

Required Params

  • user - User to open a direct message channel with.

Errors the API can return:

  • user_disabled - The user has been disabled.
  • user_not_found - Value passed for user was invalid.
  • user_not_visible - The calling user is restricted from seeing the requested user.
Link to this function

replies(channel, thread_ts, optional_params \\ %{}) View Source

Retrieve a thread of messages posted to a direct message conversation.

Required Params

  • channel - Direct message channel to fetch thread from
  • thread_ts - Unique identifier of a thread's parent message.

Errors the API can return:

  • channel_not_found - Value passed for channel was invalid.
  • thread_not_found - Value for thread_ts was missing or invalid.