Slack.Web.Apps.Datastore (SlackKit v0.25.0-alpha.0)

View Source

Summary

Functions

Delete items from a datastore in bulk

Get items from a datastore in bulk

Creates or replaces existing items in bulk

Count the number of items in a datastore that match a query

Delete an item from a datastore

Get an item from a datastore

Creates a new item, or replaces an old item with a new item.

Query a datastore for items

Edits an existing item's attributes, or adds a new item if it does not already exist.

Functions

bulk_delete(datastore, ids, optional_params \\ %{})

Delete items from a datastore in bulk

Required Params

  • datastore - name of the datastore
  • ids - IDs of items to be deleted ex: ["7c6dd137", "c7d6d731"]

Optional Params

  • app_id -

Errors the API can return:

  • unknown_method - This method does not exist
  • token_revoked - Authentication token is for a deleted user or workspace or the app has been removed when using a user token.
  • invalid_arg_name - The method was passed an argument whose name falls outside the bounds of accepted or expected values. This includes very long names and names with non-alphanumeric characters other than _. If you get this error, it is typically an indication that you have made a very malformed API call.
  • two_factor_setup_required - Two factor setup is required.
  • datastore_migration_in_progress - The datastore is currently unavailable due to an in progress Enterprise org migration.
  • team_quota_exceeded - Total number of requests exceeded team quota.
  • invalid_form_data - The method was called via a POST request with Content-Type application/x-www-form-urlencoded or multipart/form-data, but the form data was either missing or syntactically invalid.
  • invalid_post_type - The method was called via a POST request, but the specified Content-Type was invalid. Valid types are: application/json application/x-www-form-urlencoded multipart/form-data text/plain.
  • restricted_plan_level - Feature is not available on this team
  • fatal_error - The server could not complete your operation(s) without encountering a catastrophic error. It's possible some aspect of the operation succeeded before the error was raised.
  • deprecated_endpoint - The endpoint has been deprecated.
  • ratelimited - The request has been ratelimited. Refer to the Retry-After header for when to retry the request.
  • ekm_access_denied - Administrators have suspended the ability to post a message.
  • service_unavailable - The service is temporarily unavailable
  • team_access_not_granted - The token used is not granted the specific workspace access required to complete this request.
  • app_not_hosted - The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps.
  • invalid_arguments - The request is missing required arguments.
  • invalid_array_arg - The method was passed an array as an argument. Please only input valid strings.
  • request_timeout - The method was called via a POST request, but the POST data was either missing or truncated.
  • account_inactive - Authentication token is for a deleted user or workspace when using a bot token.
  • not_authed - No authentication token provided.
  • internal_error - The server could not complete your operation(s) without encountering an error, likely due to a transient issue on our end. It's possible some aspect of the operation succeeded before the error was raised.
  • partial_failure - some items failed to be deleted
  • enterprise_is_restricted - The method cannot be called from an Enterprise.
  • invalid_datastore - The provided datastore is invalid.
  • no_permission - The workspace token used in this request does not have the permissions necessary to complete the request. Make sure your app is a member of the conversation it's attempting to post a message to.
  • access_denied - Not authorized to access the datastore.
  • datastore_error - Datastore error
  • team_added_to_org - The workspace associated with your request is currently undergoing migration to an Enterprise Organization. Web API and other platform operations will be intermittently unavailable until the transition is complete.
  • missing_scope - The token used is not granted the specific scope permissions required to complete this request.
  • missing_post_type - The method was called via a POST request and included a data payload, but the request did not include a Content-Type header.
  • accesslimited - Access to this method is limited on the current network
  • token_expired - Authentication token has expired
  • free_team_not_allowed - Datastore put not allowed on a free team.
  • invalid_charset - The method was called via a POST request, but the charset specified in the Content-Type header was invalid. Valid charset names are: utf-8 iso-8859-1.
  • method_deprecated - The method has been deprecated.
  • invalid_app_id - The app_id provided is not valid for team and user.
  • not_allowed_token_type - The token type used in this request is not allowed.
  • org_login_required - The workspace is undergoing an enterprise migration and will not be available until migration is complete.
  • invalid_auth - Not authorized to create datastore items.

bulk_get(datastore, ids, optional_params \\ %{})

Get items from a datastore in bulk

Required Params

  • datastore - name of the datastore
  • ids - items' ids ex: ["7c6dd137", "c7d6d731"]

Optional Params

  • app_id -

Errors the API can return:

  • unknown_method - This method does not exist
  • token_revoked - Authentication token is for a deleted user or workspace or the app has been removed when using a user token.
  • invalid_arg_name - The method was passed an argument whose name falls outside the bounds of accepted or expected values. This includes very long names and names with non-alphanumeric characters other than _. If you get this error, it is typically an indication that you have made a very malformed API call.
  • two_factor_setup_required - Two factor setup is required.
  • datastore_migration_in_progress - The datastore is currently unavailable due to an in progress Enterprise org migration.
  • team_quota_exceeded - Total number of requests exceeded team quota.
  • invalid_form_data - The method was called via a POST request with Content-Type application/x-www-form-urlencoded or multipart/form-data, but the form data was either missing or syntactically invalid.
  • invalid_post_type - The method was called via a POST request, but the specified Content-Type was invalid. Valid types are: application/json application/x-www-form-urlencoded multipart/form-data text/plain.
  • restricted_plan_level - Feature is not available on this team
  • fatal_error - The server could not complete your operation(s) without encountering a catastrophic error. It's possible some aspect of the operation succeeded before the error was raised.
  • deprecated_endpoint - The endpoint has been deprecated.
  • ratelimited - The request has been ratelimited. Refer to the Retry-After header for when to retry the request.
  • ekm_access_denied - Administrators have suspended the ability to post a message.
  • service_unavailable - The service is temporarily unavailable
  • team_access_not_granted - The token used is not granted the specific workspace access required to complete this request.
  • app_not_hosted - The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps.
  • invalid_arguments - The request is missing required arguments.
  • invalid_array_arg - The method was passed an array as an argument. Please only input valid strings.
  • request_timeout - The method was called via a POST request, but the POST data was either missing or truncated.
  • account_inactive - Authentication token is for a deleted user or workspace when using a bot token.
  • not_authed - No authentication token provided.
  • internal_error - The server could not complete your operation(s) without encountering an error, likely due to a transient issue on our end. It's possible some aspect of the operation succeeded before the error was raised.
  • partial_failure - some items failed to be retrieved
  • enterprise_is_restricted - The method cannot be called from an Enterprise.
  • invalid_datastore - The provided datastore is invalid.
  • no_permission - The workspace token used in this request does not have the permissions necessary to complete the request. Make sure your app is a member of the conversation it's attempting to post a message to.
  • access_denied - Not authorized to access the datastore.
  • datastore_error - Datastore error
  • team_added_to_org - The workspace associated with your request is currently undergoing migration to an Enterprise Organization. Web API and other platform operations will be intermittently unavailable until the transition is complete.
  • missing_scope - The token used is not granted the specific scope permissions required to complete this request.
  • missing_post_type - The method was called via a POST request and included a data payload, but the request did not include a Content-Type header.
  • accesslimited - Access to this method is limited on the current network
  • token_expired - Authentication token has expired
  • free_team_not_allowed - Datastore put not allowed on a free team.
  • invalid_charset - The method was called via a POST request, but the charset specified in the Content-Type header was invalid. Valid charset names are: utf-8 iso-8859-1.
  • method_deprecated - The method has been deprecated.
  • invalid_app_id - The app_id provided is not valid for team and user.
  • not_allowed_token_type - The token type used in this request is not allowed.
  • org_login_required - The workspace is undergoing an enterprise migration and will not be available until migration is complete.
  • invalid_auth - Not authorized to create datastore items.

bulk_put(datastore, items, optional_params \\ %{})

Creates or replaces existing items in bulk

Required Params

  • datastore - name of the datastore
  • items - attribute names and values of the items; limit of 25 ex: [{"id": "7c6dd137", "favourite_meal": "Shawarma", "reason": "Who doesn't like Shawarma?"}]

Optional Params

  • app_id -

Errors the API can return:

  • unknown_method - This method does not exist
  • token_revoked - Authentication token is for a deleted user or workspace or the app has been removed when using a user token.
  • invalid_arg_name - The method was passed an argument whose name falls outside the bounds of accepted or expected values. This includes very long names and names with non-alphanumeric characters other than _. If you get this error, it is typically an indication that you have made a very malformed API call.
  • two_factor_setup_required - Two factor setup is required.
  • datastore_migration_in_progress - The datastore is currently unavailable due to an in progress Enterprise org migration.
  • team_quota_exceeded - Total number of requests exceeded team quota.
  • invalid_form_data - The method was called via a POST request with Content-Type application/x-www-form-urlencoded or multipart/form-data, but the form data was either missing or syntactically invalid.
  • invalid_post_type - The method was called via a POST request, but the specified Content-Type was invalid. Valid types are: application/json application/x-www-form-urlencoded multipart/form-data text/plain.
  • restricted_plan_level - Feature is not available on this team
  • fatal_error - The server could not complete your operation(s) without encountering a catastrophic error. It's possible some aspect of the operation succeeded before the error was raised.
  • deprecated_endpoint - The endpoint has been deprecated.
  • ratelimited - The request has been ratelimited. Refer to the Retry-After header for when to retry the request.
  • ekm_access_denied - Administrators have suspended the ability to post a message.
  • service_unavailable - The service is temporarily unavailable
  • team_access_not_granted - The token used is not granted the specific workspace access required to complete this request.
  • app_not_hosted - The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps.
  • invalid_arguments - The request is missing required arguments.
  • invalid_array_arg - The method was passed an array as an argument. Please only input valid strings.
  • request_timeout - The method was called via a POST request, but the POST data was either missing or truncated.
  • account_inactive - Authentication token is for a deleted user or workspace when using a bot token.
  • not_authed - No authentication token provided.
  • internal_error - The server could not complete your operation(s) without encountering an error, likely due to a transient issue on our end. It's possible some aspect of the operation succeeded before the error was raised.
  • partial_failure - some items failed to be updated
  • enterprise_is_restricted - The method cannot be called from an Enterprise.
  • invalid_datastore - The provided datastore is invalid.
  • no_permission - The workspace token used in this request does not have the permissions necessary to complete the request. Make sure your app is a member of the conversation it's attempting to post a message to.
  • access_denied - Not authorized to access the datastore.
  • datastore_error - Datastore error
  • team_added_to_org - The workspace associated with your request is currently undergoing migration to an Enterprise Organization. Web API and other platform operations will be intermittently unavailable until the transition is complete.
  • missing_scope - The token used is not granted the specific scope permissions required to complete this request.
  • missing_post_type - The method was called via a POST request and included a data payload, but the request did not include a Content-Type header.
  • accesslimited - Access to this method is limited on the current network
  • token_expired - Authentication token has expired
  • free_team_not_allowed - Datastore put not allowed on a free team.
  • invalid_charset - The method was called via a POST request, but the charset specified in the Content-Type header was invalid. Valid charset names are: utf-8 iso-8859-1.
  • method_deprecated - The method has been deprecated.
  • invalid_app_id - The app_id provided is not valid for team and user.
  • not_allowed_token_type - The token type used in this request is not allowed.
  • org_login_required - The workspace is undergoing an enterprise migration and will not be available until migration is complete.
  • invalid_auth - Not authorized to create datastore items.

count(datastore, optional_params \\ %{})

Count the number of items in a datastore that match a query

Required Params

  • datastore - Name of the datastore

Optional Params

  • app_id - Required if calling with user token
  • expression - A query filter expression ex: #artist = :artist_name
  • expression_attributes - A map of attributes referenced in expression ex: { "#artist": "artist" }
  • expression_values - A map of values referenced in expression ex: { ":artist_name": "Fred Rogers" }

Errors the API can return:

  • token_revoked - Authentication token is for a deleted user or workspace or the app has been removed when using a user token.
  • invalid_arg_name - The method was passed an argument whose name falls outside the bounds of accepted or expected values. This includes very long names and names with non-alphanumeric characters other than _. If you get this error, it is typically an indication that you have made a very malformed API call.
  • two_factor_setup_required - Two factor setup is required.
  • datastore_migration_in_progress - The datastore is currently unavailable due to an in progress Enterprise org migration.
  • team_quota_exceeded - Total number of requests exceeded team quota.
  • invalid_form_data - The method was called via a POST request with Content-Type application/x-www-form-urlencoded or multipart/form-data, but the form data was either missing or syntactically invalid.
  • invalid_post_type - The method was called via a POST request, but the specified Content-Type was invalid. Valid types are: application/json application/x-www-form-urlencoded multipart/form-data text/plain.
  • restricted_plan_level - Feature is not available on this team
  • fatal_error - The server could not complete your operation(s) without encountering a catastrophic error. It's possible some aspect of the operation succeeded before the error was raised.
  • deprecated_endpoint - The endpoint has been deprecated.
  • ratelimited - The request has been ratelimited. Refer to the Retry-After header for when to retry the request.
  • ekm_access_denied - Administrators have suspended the ability to post a message.
  • service_unavailable - The service is temporarily unavailable
  • team_access_not_granted - The token used is not granted the specific workspace access required to complete this request.
  • app_not_hosted - The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps.
  • invalid_arguments - The request is missing required arguments.
  • invalid_array_arg - The method was passed an array as an argument. Please only input valid strings.
  • request_timeout - The method was called via a POST request, but the POST data was either missing or truncated.
  • account_inactive - Authentication token is for a deleted user or workspace when using a bot token.
  • not_authed - No authentication token provided.
  • internal_error - The server could not complete your operation(s) without encountering an error, likely due to a transient issue on our end. It's possible some aspect of the operation succeeded before the error was raised.
  • enterprise_is_restricted - The method cannot be called from an Enterprise.
  • invalid_datastore - The provided datastore is invalid.
  • no_permission - The workspace token used in this request does not have the permissions necessary to complete the request. Make sure your app is a member of the conversation it's attempting to post a message to.
  • access_denied - Not authorized to access the datastore.
  • datastore_error - Datastore error
  • team_added_to_org - The workspace associated with your request is currently undergoing migration to an Enterprise Organization. Web API and other platform operations will be intermittently unavailable until the transition is complete.
  • missing_scope - The token used is not granted the specific scope permissions required to complete this request.
  • missing_post_type - The method was called via a POST request and included a data payload, but the request did not include a Content-Type header.
  • accesslimited - Access to this method is limited on the current network
  • token_expired - Authentication token has expired
  • free_team_not_allowed - Datastore query not allowed on a free team.
  • invalid_charset - The method was called via a POST request, but the charset specified in the Content-Type header was invalid. Valid charset names are: utf-8 iso-8859-1.
  • method_deprecated - The method has been deprecated.
  • invalid_app_id - The app_id provided is not valid for team and user.
  • not_allowed_token_type - The token type used in this request is not allowed.
  • org_login_required - The workspace is undergoing an enterprise migration and will not be available until migration is complete.
  • invalid_auth - Not authorized to access datastore items.

delete(datastore, id, optional_params \\ %{})

Delete an item from a datastore

Required Params

  • datastore - name of the datastore
  • id - item id

Optional Params

  • app_id -

Errors the API can return:

  • token_revoked - Authentication token is for a deleted user or workspace or the app has been removed when using a user token.
  • invalid_arg_name - The method was passed an argument whose name falls outside the bounds of accepted or expected values. This includes very long names and names with non-alphanumeric characters other than _. If you get this error, it is typically an indication that you have made a very malformed API call.
  • two_factor_setup_required - Two factor setup is required.
  • datastore_migration_in_progress - The datastore is currently unavailable due to an in progress Enterprise org migration.
  • invalid_form_data - The method was called via a POST request with Content-Type application/x-www-form-urlencoded or multipart/form-data, but the form data was either missing or syntactically invalid.
  • invalid_post_type - The method was called via a POST request, but the specified Content-Type was invalid. Valid types are: application/json application/x-www-form-urlencoded multipart/form-data text/plain.
  • restricted_plan_level - Feature is not available on this team
  • fatal_error - The server could not complete your operation(s) without encountering a catastrophic error. It's possible some aspect of the operation succeeded before the error was raised.
  • deprecated_endpoint - The endpoint has been deprecated.
  • ratelimited - The request has been ratelimited. Refer to the Retry-After header for when to retry the request.
  • ekm_access_denied - Administrators have suspended the ability to post a message.
  • service_unavailable - The service is temporarily unavailable
  • team_access_not_granted - The token used is not granted the specific workspace access required to complete this request.
  • app_not_hosted - The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps.
  • invalid_arguments - The request is missing required arguments.
  • invalid_array_arg - The method was passed an array as an argument. Please only input valid strings.
  • request_timeout - The method was called via a POST request, but the POST data was either missing or truncated.
  • account_inactive - Authentication token is for a deleted user or workspace when using a bot token.
  • not_authed - No authentication token provided.
  • internal_error - The server could not complete your operation(s) without encountering an error, likely due to a transient issue on our end. It's possible some aspect of the operation succeeded before the error was raised.
  • enterprise_is_restricted - The method cannot be called from an Enterprise.
  • invalid_datastore - The provided datastore is invalid.
  • no_permission - The workspace token used in this request does not have the permissions necessary to complete the request. Make sure your app is a member of the conversation it's attempting to post a message to.
  • access_denied - Not authorized to access the datastore.
  • datastore_error - Datastore error
  • team_added_to_org - The workspace associated with your request is currently undergoing migration to an Enterprise Organization. Web API and other platform operations will be intermittently unavailable until the transition is complete.
  • missing_scope - The token used is not granted the specific scope permissions required to complete this request.
  • missing_post_type - The method was called via a POST request and included a data payload, but the request did not include a Content-Type header.
  • accesslimited - Access to this method is limited on the current network
  • token_expired - Authentication token has expired
  • free_team_not_allowed - Datastore delete not allowed on a free team.
  • invalid_charset - The method was called via a POST request, but the charset specified in the Content-Type header was invalid. Valid charset names are: utf-8 iso-8859-1.
  • method_deprecated - The method has been deprecated.
  • invalid_app_id - The app_id provided is not valid for team and user.
  • not_allowed_token_type - The token type used in this request is not allowed.
  • org_login_required - The workspace is undergoing an enterprise migration and will not be available until migration is complete.
  • invalid_auth - Not authorized to delete datastore items.

get(datastore, id, optional_params \\ %{})

Get an item from a datastore

Required Params

  • datastore - name of the datastore
  • id - item id

Optional Params

  • app_id -

Errors the API can return:

  • token_revoked - Authentication token is for a deleted user or workspace or the app has been removed when using a user token.
  • invalid_arg_name - The method was passed an argument whose name falls outside the bounds of accepted or expected values. This includes very long names and names with non-alphanumeric characters other than _. If you get this error, it is typically an indication that you have made a very malformed API call.
  • two_factor_setup_required - Two factor setup is required.
  • datastore_migration_in_progress - The datastore is currently unavailable due to an in progress Enterprise org migration.
  • team_quota_exceeded - Total number of requests exceeded team quota.
  • invalid_form_data - The method was called via a POST request with Content-Type application/x-www-form-urlencoded or multipart/form-data, but the form data was either missing or syntactically invalid.
  • invalid_post_type - The method was called via a POST request, but the specified Content-Type was invalid. Valid types are: application/json application/x-www-form-urlencoded multipart/form-data text/plain.
  • restricted_plan_level - Feature is not available on this team
  • fatal_error - The server could not complete your operation(s) without encountering a catastrophic error. It's possible some aspect of the operation succeeded before the error was raised.
  • deprecated_endpoint - The endpoint has been deprecated.
  • ratelimited - The request has been ratelimited. Refer to the Retry-After header for when to retry the request.
  • ekm_access_denied - Administrators have suspended the ability to post a message.
  • service_unavailable - The service is temporarily unavailable
  • team_access_not_granted - The token used is not granted the specific workspace access required to complete this request.
  • app_not_hosted - The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps.
  • invalid_arguments - The request is missing required arguments.
  • invalid_array_arg - The method was passed an array as an argument. Please only input valid strings.
  • request_timeout - The method was called via a POST request, but the POST data was either missing or truncated.
  • account_inactive - Authentication token is for a deleted user or workspace when using a bot token.
  • not_authed - No authentication token provided.
  • internal_error - The server could not complete your operation(s) without encountering an error, likely due to a transient issue on our end. It's possible some aspect of the operation succeeded before the error was raised.
  • enterprise_is_restricted - The method cannot be called from an Enterprise.
  • invalid_datastore - The provided datastore is invalid.
  • no_permission - The workspace token used in this request does not have the permissions necessary to complete the request. Make sure your app is a member of the conversation it's attempting to post a message to.
  • access_denied - Not authorized to access to the datastore.
  • datastore_error - Datastore error.
  • team_added_to_org - The workspace associated with your request is currently undergoing migration to an Enterprise Organization. Web API and other platform operations will be intermittently unavailable until the transition is complete.
  • missing_scope - The token used is not granted the specific scope permissions required to complete this request.
  • missing_post_type - The method was called via a POST request and included a data payload, but the request did not include a Content-Type header.
  • accesslimited - Access to this method is limited on the current network
  • token_expired - Authentication token has expired
  • free_team_not_allowed - Datastore get not allowed on a free team.
  • invalid_charset - The method was called via a POST request, but the charset specified in the Content-Type header was invalid. Valid charset names are: utf-8 iso-8859-1.
  • method_deprecated - The method has been deprecated.
  • invalid_app_id - The app_id provided is not valid for team and user.
  • not_allowed_token_type - The token type used in this request is not allowed.
  • org_login_required - The workspace is undergoing an enterprise migration and will not be available until migration is complete.
  • invalid_auth - Not authorized to get datastore items.

put(datastore, item, optional_params \\ %{})

Creates a new item, or replaces an old item with a new item.

Required Params

  • datastore - name of the datastore
  • item - attribute names and values of the item

Optional Params

  • app_id -

Errors the API can return:

  • token_revoked - Authentication token is for a deleted user or workspace or the app has been removed when using a user token.
  • invalid_arg_name - The method was passed an argument whose name falls outside the bounds of accepted or expected values. This includes very long names and names with non-alphanumeric characters other than _. If you get this error, it is typically an indication that you have made a very malformed API call.
  • two_factor_setup_required - Two factor setup is required.
  • datastore_migration_in_progress - The datastore is currently unavailable due to an in progress Enterprise org migration.
  • team_quota_exceeded - Total number of requests exceeded team quota.
  • invalid_form_data - The method was called via a POST request with Content-Type application/x-www-form-urlencoded or multipart/form-data, but the form data was either missing or syntactically invalid.
  • invalid_post_type - The method was called via a POST request, but the specified Content-Type was invalid. Valid types are: application/json application/x-www-form-urlencoded multipart/form-data text/plain.
  • restricted_plan_level - Feature is not available on this team
  • fatal_error - The server could not complete your operation(s) without encountering a catastrophic error. It's possible some aspect of the operation succeeded before the error was raised.
  • deprecated_endpoint - The endpoint has been deprecated.
  • ratelimited - The request has been ratelimited. Refer to the Retry-After header for when to retry the request.
  • ekm_access_denied - Administrators have suspended the ability to post a message.
  • service_unavailable - The service is temporarily unavailable
  • team_access_not_granted - The token used is not granted the specific workspace access required to complete this request.
  • app_not_hosted - The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps.
  • invalid_arguments - The request is missing required arguments.
  • invalid_array_arg - The method was passed an array as an argument. Please only input valid strings.
  • request_timeout - The method was called via a POST request, but the POST data was either missing or truncated.
  • account_inactive - Authentication token is for a deleted user or workspace when using a bot token.
  • not_authed - No authentication token provided.
  • internal_error - The server could not complete your operation(s) without encountering an error, likely due to a transient issue on our end. It's possible some aspect of the operation succeeded before the error was raised.
  • enterprise_is_restricted - The method cannot be called from an Enterprise.
  • invalid_datastore - The provided datastore is invalid.
  • no_permission - The workspace token used in this request does not have the permissions necessary to complete the request. Make sure your app is a member of the conversation it's attempting to post a message to.
  • access_denied - Not authorized to access the datastore.
  • datastore_error - Datastore error
  • team_added_to_org - The workspace associated with your request is currently undergoing migration to an Enterprise Organization. Web API and other platform operations will be intermittently unavailable until the transition is complete.
  • missing_scope - The token used is not granted the specific scope permissions required to complete this request.
  • missing_post_type - The method was called via a POST request and included a data payload, but the request did not include a Content-Type header.
  • accesslimited - Access to this method is limited on the current network
  • token_expired - Authentication token has expired
  • free_team_not_allowed - Datastore put not allowed on a free team.
  • invalid_charset - The method was called via a POST request, but the charset specified in the Content-Type header was invalid. Valid charset names are: utf-8 iso-8859-1.
  • method_deprecated - The method has been deprecated.
  • invalid_app_id - The app_id provided is not valid for team and user.
  • not_allowed_token_type - The token type used in this request is not allowed.
  • org_login_required - The workspace is undergoing an enterprise migration and will not be available until migration is complete.
  • invalid_auth - Not authorized to create datastore items.

query(datastore, optional_params \\ %{})

Query a datastore for items

Required Params

  • datastore - Name of the datastore

Optional Params

  • app_id - Required if calling with user token
  • cursor - Set cursor to next_cursor returned by the previous call to list items in the next page ex: 5c3e53d5
  • expression - A query filter expression ex: #artist = :artist_name
  • expression_attributes - A map of attributes referenced in expression ex: { "#artist": "artist" }
  • expression_values - A map of values referenced in expression ex: { ":artist_name": "Fred Rogers" }
  • limit - The maximum number of items to evaluate for a given request (not necessarily the number of matching items). If the given request dataset size exceeds 1 MB before reaching the limit, the returned item count will likely be less than the limit. In any case where there are more items available beyond an imposed limit, a next_cursor value will be provided for use in subsequent requests. ex: 100

Errors the API can return:

  • token_revoked - Authentication token is for a deleted user or workspace or the app has been removed when using a user token.
  • invalid_arg_name - The method was passed an argument whose name falls outside the bounds of accepted or expected values. This includes very long names and names with non-alphanumeric characters other than _. If you get this error, it is typically an indication that you have made a very malformed API call.
  • two_factor_setup_required - Two factor setup is required.
  • datastore_migration_in_progress - The datastore is currently unavailable due to an in progress Enterprise org migration.
  • team_quota_exceeded - Total number of requests exceeded team quota.
  • invalid_form_data - The method was called via a POST request with Content-Type application/x-www-form-urlencoded or multipart/form-data, but the form data was either missing or syntactically invalid.
  • invalid_post_type - The method was called via a POST request, but the specified Content-Type was invalid. Valid types are: application/json application/x-www-form-urlencoded multipart/form-data text/plain.
  • restricted_plan_level - Feature is not available on this team
  • fatal_error - The server could not complete your operation(s) without encountering a catastrophic error. It's possible some aspect of the operation succeeded before the error was raised.
  • deprecated_endpoint - The endpoint has been deprecated.
  • ratelimited - The request has been ratelimited. Refer to the Retry-After header for when to retry the request.
  • ekm_access_denied - Administrators have suspended the ability to post a message.
  • service_unavailable - The service is temporarily unavailable
  • team_access_not_granted - The token used is not granted the specific workspace access required to complete this request.
  • app_not_hosted - The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps.
  • invalid_arguments - The request is missing required arguments.
  • invalid_array_arg - The method was passed an array as an argument. Please only input valid strings.
  • request_timeout - The method was called via a POST request, but the POST data was either missing or truncated.
  • account_inactive - Authentication token is for a deleted user or workspace when using a bot token.
  • not_authed - No authentication token provided.
  • internal_error - The server could not complete your operation(s) without encountering an error, likely due to a transient issue on our end. It's possible some aspect of the operation succeeded before the error was raised.
  • enterprise_is_restricted - The method cannot be called from an Enterprise.
  • invalid_datastore - The provided datastore is invalid.
  • no_permission - The workspace token used in this request does not have the permissions necessary to complete the request. Make sure your app is a member of the conversation it's attempting to post a message to.
  • access_denied - Not authorized to access the datastore.
  • datastore_error - Datastore error
  • team_added_to_org - The workspace associated with your request is currently undergoing migration to an Enterprise Organization. Web API and other platform operations will be intermittently unavailable until the transition is complete.
  • missing_scope - The token used is not granted the specific scope permissions required to complete this request.
  • missing_post_type - The method was called via a POST request and included a data payload, but the request did not include a Content-Type header.
  • accesslimited - Access to this method is limited on the current network
  • token_expired - Authentication token has expired
  • free_team_not_allowed - Datastore query not allowed on a free team.
  • invalid_charset - The method was called via a POST request, but the charset specified in the Content-Type header was invalid. Valid charset names are: utf-8 iso-8859-1.
  • method_deprecated - The method has been deprecated.
  • invalid_app_id - The app_id provided is not valid for team and user.
  • not_allowed_token_type - The token type used in this request is not allowed.
  • org_login_required - The workspace is undergoing an enterprise migration and will not be available until migration is complete.
  • invalid_auth - Not authorized to access datastore items.

update(datastore, item, optional_params \\ %{})

Edits an existing item's attributes, or adds a new item if it does not already exist.

Required Params

  • datastore - name of the datastore
  • item - attribute names and values to be updated

Optional Params

  • app_id -

Errors the API can return:

  • token_revoked - Authentication token is for a deleted user or workspace or the app has been removed when using a user token.
  • invalid_arg_name - The method was passed an argument whose name falls outside the bounds of accepted or expected values. This includes very long names and names with non-alphanumeric characters other than _. If you get this error, it is typically an indication that you have made a very malformed API call.
  • two_factor_setup_required - Two factor setup is required.
  • datastore_migration_in_progress - The datastore is currently unavailable due to an in progress Enterprise org migration.
  • team_quota_exceeded - Total number of requests exceeded team quota.
  • invalid_form_data - The method was called via a POST request with Content-Type application/x-www-form-urlencoded or multipart/form-data, but the form data was either missing or syntactically invalid.
  • invalid_post_type - The method was called via a POST request, but the specified Content-Type was invalid. Valid types are: application/json application/x-www-form-urlencoded multipart/form-data text/plain.
  • restricted_plan_level - Feature is not available on this team
  • fatal_error - The server could not complete your operation(s) without encountering a catastrophic error. It's possible some aspect of the operation succeeded before the error was raised.
  • deprecated_endpoint - The endpoint has been deprecated.
  • ratelimited - The request has been ratelimited. Refer to the Retry-After header for when to retry the request.
  • ekm_access_denied - Administrators have suspended the ability to post a message.
  • service_unavailable - The service is temporarily unavailable
  • team_access_not_granted - The token used is not granted the specific workspace access required to complete this request.
  • app_not_hosted - The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps.
  • invalid_arguments - The request is missing required arguments.
  • invalid_array_arg - The method was passed an array as an argument. Please only input valid strings.
  • request_timeout - The method was called via a POST request, but the POST data was either missing or truncated.
  • account_inactive - Authentication token is for a deleted user or workspace when using a bot token.
  • not_authed - No authentication token provided.
  • internal_error - The server could not complete your operation(s) without encountering an error, likely due to a transient issue on our end. It's possible some aspect of the operation succeeded before the error was raised.
  • enterprise_is_restricted - The method cannot be called from an Enterprise.
  • invalid_datastore - The provided datastore is invalid.
  • no_permission - The workspace token used in this request does not have the permissions necessary to complete the request. Make sure your app is a member of the conversation it's attempting to post a message to.
  • access_denied - Not authorized to access the datastore.
  • datastore_error - Datastore error
  • team_added_to_org - The workspace associated with your request is currently undergoing migration to an Enterprise Organization. Web API and other platform operations will be intermittently unavailable until the transition is complete.
  • missing_scope - The token used is not granted the specific scope permissions required to complete this request.
  • missing_post_type - The method was called via a POST request and included a data payload, but the request did not include a Content-Type header.
  • accesslimited - Access to this method is limited on the current network
  • token_expired - Authentication token has expired
  • free_team_not_allowed - Datastore put not allowed on a free team.
  • invalid_charset - The method was called via a POST request, but the charset specified in the Content-Type header was invalid. Valid charset names are: utf-8 iso-8859-1.
  • method_deprecated - The method has been deprecated.
  • invalid_app_id - The app_id provided is not valid for team and user.
  • not_allowed_token_type - The token type used in this request is not allowed.
  • org_login_required - The workspace is undergoing an enterprise migration and will not be available until migration is complete.
  • invalid_auth - Not authorized to create datastore items.