Module: Slack::Web::Api::Endpoints::Canvases

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

Instance Method Summary collapse

Instance Method Details

#canvases_create(options = {}) ⇒ Object

Create canvas for a user

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :title (string)

    Title of the newly created canvas.

  • :document_content (Object)

    Structure describing the type and value of the content to create.

  • :channel_id (string)

    Channel ID of the channel the canvas will be tabbed in. This is a required field for free teams.

See Also:



20
21
22
# File 'lib/slack/web/api/endpoints/canvases.rb', line 20

def canvases_create(options = {})
  post('canvases.create', options)
end

#canvases_delete(options = {}) ⇒ Object

Deletes a canvas

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :canvas_id (Object)

    Encoded ID of the canvas.

Raises:

  • (ArgumentError)

See Also:



31
32
33
34
# File 'lib/slack/web/api/endpoints/canvases.rb', line 31

def canvases_delete(options = {})
  raise ArgumentError, 'Required arguments :canvas_id missing' if options[:canvas_id].nil?
  post('canvases.delete', options)
end

#canvases_edit(options = {}) ⇒ Object

Update an existing canvas

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :canvas_id (Object)

    Encoded ID of the canvas.

  • :changes (array)

    List of changes to apply on the specified canvas.

Raises:

  • (ArgumentError)

See Also:



45
46
47
48
49
# File 'lib/slack/web/api/endpoints/canvases.rb', line 45

def canvases_edit(options = {})
  raise ArgumentError, 'Required arguments :canvas_id missing' if options[:canvas_id].nil?
  raise ArgumentError, 'Required arguments :changes missing' if options[:changes].nil?
  post('canvases.edit', options)
end