Slack.Web.Admin.Emoji (SlackKit v1.0.0-alpha.0)

View Source

Summary

Functions

List emoji for an Enterprise organization.

Remove an emoji across an Enterprise organization

Functions

add(name, url, optional_params \\ %{})

Add an emoji.

API reference

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

View on docs.slack.dev ↗

Required Params

  • name - The name of the emoji to be added (using lower-case letters only). Colons (:myemoji:) around the value are not required, although they may be included.
  • url - The URL of a file to use as an image for the emoji. Square images under 128KB and with transparent backgrounds work best.

Errors the API can return:

  • emoji_limit_reached - Unable to add emoji due to limit reached.
  • error_bad_format - Invalid image data was provided.
  • error_bad_name_i18n - Value passed for name was invalid.
  • error_bad_upload - There was an error uploading the image.
  • error_bad_wide - The image width or height is too large.
  • error_lower_case_names_only - Capital letters are not allowed in emoji names.
  • error_missing_name - Value passed for name is missing or empty.
  • error_name_taken - Value passed for name already exists.
  • error_name_taken_i18n - Value passed for name already exists.
  • error_no_image - Empty image data was provided.
  • error_too_big - The image file size is too large.
  • failed_to_add_emoji - Failed to add the specified emoji.
  • failed_to_fetch_active_team - There are no active teams on the org and we need at least one.
  • feature_not_enabled - The Admin APIs feature is not enabled for this team.
  • no_image_uploaded - No image data was provided.
  • not_an_admin - This method is only accessible by org owners and Admins.
  • resized_but_still_too_large - The image is still too large after resizing.
  • too_many_frames - The image has too many frames.

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

add_alias(alias_for, name, optional_params \\ %{})

Add an emoji alias.

API reference

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

View on docs.slack.dev ↗

Required Params

  • alias_for - Name of the emoji for which the alias is being made. Any wrapping whitespace or colons will be automatically trimmed.
  • name - The new alias for the specified emoji. Any wrapping whitespace or colons will be automatically trimmed.

Errors the API can return:

  • emoji_limit_reached - Unable to add emoji due to limit reached.
  • error_bad_name_i18n - Value passed for name was invalid.
  • error_invalid_alias - Value passed for alias_for does not exist.
  • error_missing_name - Value passed for name is missing or empty.
  • error_name_taken - Value passed for name already exists.
  • error_name_taken_i18n - The name has already been taken by another emoji, in the international set. Emoji must have unique names.
  • failed_to_alias_emoji - Failed to alias the specified emoji.
  • feature_not_enabled - The Admin APIs feature is not enabled for this team.
  • no_alias_selected - Value passed for alias_for was invalid.
  • not_an_admin - This method is only accessible by org owners and Admins.

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

list(optional_params \\ %{})

List emoji for an Enterprise organization.

API reference

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

View on docs.slack.dev ↗

Optional Params

  • cursor - Set cursor to next_cursor returned by the previous call to list items in the next page ex: 5c3e53d5
  • limit - The maximum number of items to return. Must be between 1 - 1000 both inclusive. ex: 100

Errors the API can return:

  • feature_not_enabled - The Admin APIs feature is not enabled for this team.
  • invalid_cursor - Value passed for cursor was not valid or is no longer valid.
  • not_an_admin - This method is only accessible by org owners and Admins.

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

remove(name, optional_params \\ %{})

Remove an emoji across an Enterprise organization

API reference

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

View on docs.slack.dev ↗

Required Params

  • name - The name of the emoji to be removed. Colons (:myemoji:) around the value are not required, although they may be included.

Errors the API can return:

  • emoji_not_found - Value passed for name was invalid.
  • failed_to_remove_emoji - Failed to remove the specified emoji.
  • failure_removing_emoji - This emoji could not be removed. It might be part of the standard Unicode set or the default Slack package.
  • feature_not_enabled - The Admin APIs feature is not enabled for this team.
  • not_an_admin - This method is only accessible by org owners and Admins.

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

rename(name, new_name, optional_params \\ %{})

Rename an emoji.

API reference

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

View on docs.slack.dev ↗

Required Params

  • name - The name of the emoji to be renamed. Colons (:myemoji:) around the value are not required, although they may be included.
  • new_name - The new name of the emoji.

Errors the API can return:

  • cannot_resolve_alias - The alias emoji could not be resolved
  • error_bad_name_i18n - Value passed for new_name was invalid.
  • error_invalid_emoji_to_rename - Value passed for name was invalid.
  • error_missing_name - Value passed for name is missing or empty.
  • error_name_taken - Value passed for name already exists.
  • error_name_taken_i18n - The name has already been taken by another emoji, in the international set. Emoji must have unique names.
  • failed_to_fetch_active_team - There are no active teams on the org and we need at least one.
  • failed_to_rename_emoji - The emoji could not be renamed.
  • feature_not_enabled - The Admin APIs feature is not enabled for this team.
  • not_an_admin - This method is only accessible by org owners and Admins.

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