Module: Slack::Web::Api::Endpoints::Bookmarks

Included in:
Slack::Web::Api::Endpoints
Defined in:
lib/slack/web/api/endpoints/bookmarks.rb

Instance Method Summary collapse

Instance Method Details

#bookmarks_add(options = {}) ⇒ Object

Add bookmark to a channel.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :channel_id (string)

    Channel to add bookmark in.

  • :title (string)

    Title for the bookmark.

  • :type (string)

    Type of the bookmark i.e link.

  • :emoji (string)

    Emoji tag to apply to the link.

  • :entity_id (string)

    ID of the entity being bookmarked. Only applies to message and file types.

  • :link (string)

    Link to bookmark.

  • :parent_id (string)

    Id of this bookmark’s parent.

See Also:



28
29
30
31
32
33
# File 'lib/slack/web/api/endpoints/bookmarks.rb', line 28

def bookmarks_add(options = {})
  throw ArgumentError.new('Required arguments :channel_id missing') if options[:channel_id].nil?
  throw ArgumentError.new('Required arguments :title missing') if options[:title].nil?
  throw ArgumentError.new('Required arguments :type missing') if options[:type].nil?
  post('bookmarks.add', options)
end

#bookmarks_edit(options = {}) ⇒ Object

Edit bookmark.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :bookmark_id (string)

    Bookmark to update.

  • :channel_id (string)

    Channel to update bookmark in.

  • :emoji (string)

    Emoji tag to apply to the link.

  • :link (string)

    Link to bookmark.

  • :title (string)

    Title for the bookmark.

See Also:



50
51
52
53
54
# File 'lib/slack/web/api/endpoints/bookmarks.rb', line 50

def bookmarks_edit(options = {})
  throw ArgumentError.new('Required arguments :bookmark_id missing') if options[:bookmark_id].nil?
  throw ArgumentError.new('Required arguments :channel_id missing') if options[:channel_id].nil?
  post('bookmarks.edit', options)
end

#bookmarks_list(options = {}) ⇒ Object

List bookmark for the channel.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :channel_id (string)

    Channel to list bookmarks in.

See Also:



63
64
65
66
# File 'lib/slack/web/api/endpoints/bookmarks.rb', line 63

def bookmarks_list(options = {})
  throw ArgumentError.new('Required arguments :channel_id missing') if options[:channel_id].nil?
  post('bookmarks.list', options)
end

#bookmarks_remove(options = {}) ⇒ Object

Remove bookmark from the channel.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :bookmark_id (string)

    Bookmark to remove.

  • :channel_id (string)

    Channel to remove bookmark.

See Also:



77
78
79
80
81
# File 'lib/slack/web/api/endpoints/bookmarks.rb', line 77

def bookmarks_remove(options = {})
  throw ArgumentError.new('Required arguments :bookmark_id missing') if options[:bookmark_id].nil?
  throw ArgumentError.new('Required arguments :channel_id missing') if options[:channel_id].nil?
  post('bookmarks.remove', options)
end