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

View Source

Summary

Functions

Open a view for a user.

Publish a static view for a User.

Push a view onto the stack of a root view.

Update an existing view.

Functions

open(view, optional_params \\ %{})

Open a view for a user.

API reference

Rate limit: Tier 4: 100+ per minute
Scopes: No scopes required

View on docs.slack.dev ↗

Required Params

  • view - A view payload. This must be a JSON-encoded string.

Optional Params

  • interactivity_pointer - Exchange an interactivity pointer to post to the user. ex: 12345.98765.abcd2358fdea
  • trigger_id - Exchange a trigger to post to the user. ex: 12345.98765.abcd2358fdea

Errors the API can return:

  • duplicate_external_id - Error returned when the given external_id has already be used.
  • exchanged_trigger_id - The trigger_id was already exchanged in a previous call.
  • expired_trigger_id - The trigger_id is expired.
  • invalid_trigger_id - The trigger_id is invalid. The expected format for the trigger_id argument is "132456.7890123.abcdef".
  • view_too_large - Error returned if the provided view is greater than 250kb.

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

publish(user_id, view, optional_params \\ %{})

Publish a static view for a User.

API reference

Rate limit: Tier 4: 100+ per minute
Scopes: No scopes required

View on docs.slack.dev ↗

Required Params

  • user_id - id of the user you want publish a view to. ex: U0BPQUNTA
  • view - A view payload. This must be a JSON-encoded string.

Optional Params

  • hash - A string that represents view state to protect against possible race conditions. ex: 156772938.1827394

Errors the API can return:

  • duplicate_external_id - Error returned when the given external_id has already be used.
  • hash_conflict - Error returned when the provided hash doesn't match the current stored value.
  • missing_profile_id - A profile id was not provided when trying to publish a view of type profile.
  • not_enabled - Error returned if a home view is published but the Home tab isn't enabled for the app.
  • not_implemented - The profile view experiment is not enabled for this user.
  • view_too_large - Error returned if the provided view is greater than 250kb.

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

push(view, optional_params \\ %{})

Push a view onto the stack of a root view.

API reference

Rate limit: Tier 4: 100+ per minute
Scopes: No scopes required

View on docs.slack.dev ↗

Required Params

  • view - A view payload. This must be a JSON-encoded string.

Optional Params

  • interactivity_pointer - Exchange an interactivity pointer to post to the user. ex: 12345.98765.abcd2358fdea
  • trigger_id - Exchange a trigger to post to the user. ex: 12345.98765.abcd2358fdea

Errors the API can return:

  • duplicate_external_id - Error returned when the given external_id has already be used.
  • exchanged_trigger_id - The trigger_id was already exchanged in a previous call.
  • expired_trigger_id - The trigger_id is expired.
  • invalid_trigger_id - The trigger_id is invalid. The expected format for the trigger_id argument is "132456.7890123.abcdef".
  • not_found - Error returned when the requested view can't be found.
  • push_limit_reached - Error returned when the max push limit has been reached for views. Currently the limit is 3.
  • view_too_large - Error returned if the provided view is greater than 250kb.

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

update(view, optional_params \\ %{})

Update an existing view.

API reference

Rate limit: Tier 4: 100+ per minute
Scopes: No scopes required

View on docs.slack.dev ↗

Required Params

  • view - A view object. This must be a JSON-encoded string.

Optional Params

  • external_id - A unique identifier of the view set by the developer. Must be unique for all views on a team. Max length of 255 characters. Either view_id or external_id is required. Update a view by passing a new view definition object along with the view_id returned in views.open or the external_id. ex: bmarley_view2
  • hash - A string that represents view state to protect against possible race conditions. ex: 156772938.1827394
  • view_id - A unique identifier of the view to be updated. Either view_id or external_id is required. Update a view by passing a new view definition object along with the view_id returned in views.open or the external_id. ex: VMM512F2U

Errors the API can return:

  • duplicate_external_id - Error returned when the given external_id has already be used.
  • hash_conflict - Error returned when the provided hash doesn't match the current stored value.
  • not_found - Error returned when the given view_id or external_id doesn't exist.
  • view_too_large - Error returned if the provided view is greater than 250kb.

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