Slack v0.9.2 Slack.Web.Im

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

Functions

close(channel, optional_params \\ %{})

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.
history(channel, optional_params \\ %{})

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
list(optional_params \\ %{})

Lists direct message channels for the calling user.

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

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.
open(user, optional_params \\ %{})

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.