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.

Raises:

  • (ArgumentError)

See Also:



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

def bookmarks_add(options = {})
  raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil?
  raise ArgumentError, 'Required arguments :title missing' if options[:title].nil?
  raise ArgumentError, '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.

Raises:

  • (ArgumentError)

See Also:



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

def bookmarks_edit(options = {})
  raise ArgumentError, 'Required arguments :bookmark_id missing' if options[:bookmark_id].nil?
  raise ArgumentError, '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.

Raises:

  • (ArgumentError)

See Also:



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

def bookmarks_list(options = {})
  raise ArgumentError, '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.

  • :quip_section_id (string)

    Quip section ID to unbookmark.

Raises:

  • (ArgumentError)

See Also:



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

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