Slack.Web.Canvases (SlackKit v1.0.0-alpha.0)

View Source

Summary

Functions

create(optional_params \\ %{})

Create canvas for a user

API reference

Rate limit: Tier 2: 20+ per minute
Scopes:

View on docs.slack.dev ↗

Optional Params

  • channel_id - Channel ID of the channel the canvas will be tabbed in. This is a required field for free teams.
  • document_content - Structure describing the type and value of the content to create ex: {"type": "markdown", "markdown": "> standalone canvas!"}
  • title - Title of the newly created canvas ex: Your Brilliant Title

Errors the API can return:

  • canvas_creation_failed - Canvas was unable to be created.
  • canvas_disabled_user_team - Canvas is disabled on user's team
  • free_teams_cannot_create_non_tabbed_canvases - Free teams cannot create non-tabbed standalone canvases
  • restricted_action - User does not have permission to perform this action.

See the Common Errors guide for errors returned by every Web API method.

delete(canvas_id, optional_params \\ %{})

Deletes a canvas

API reference

Rate limit: Tier 3: 50+ per minute
Scopes:

View on docs.slack.dev ↗

Required Params

  • canvas_id - Encoded ID of the canvas ex: F1234ABCD

Errors the API can return:

  • canvas_deleting_disabled - This functionality is disabled.
  • canvas_not_found - The canvas does not exist, or is not visible to the calling user.
  • restricted_action - User does not have permission to perform this action.

See the Common Errors guide for errors returned by every Web API method.

edit(canvas_id, changes, optional_params \\ %{})

Update an existing canvas

API reference

Rate limit: Tier 3: 50+ per minute
Scopes:

View on docs.slack.dev ↗

Required Params

  • canvas_id - Encoded ID of the canvas ex: F1234ABCD
  • changes - List of changes to apply on the specified canvas ex: [{"operation":"insert_before","document_content":{"type":"markdown","markdown":"Example content"},"section_id":"temp:C:AAAAAAAAAAAAAAAAAAAAAAAAAAAA"}]

Errors the API can return:

  • canvas_disabled_user_team - Canvas is disabled on user's team
  • canvas_editing_failed - The changes to the canvas failed to be applied.
  • canvas_not_found - The canvas you wish to apply changes to is not available.
  • free_teams_cannot_edit_standalone_canvases - Free teams cannot edit standalone canvases
  • restricted_action - User does not have permission to perform this action.

See the Common Errors guide for errors returned by every Web API method.