Slack. Web. Apps. Datastore
(SlackKit v1.0.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
Delete items from a datastore in bulk
API reference
Rate limit: Tier 3: 50+ per minute
Scopes:
- Bot token:
datastore:write
Required Params
datastore- name of the datastoreids- IDs of items to be deleted ex:["7c6dd137", "c7d6d731"]
Optional Params
app_id-
Errors the API can return:
app_not_hosted- The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps.datastore_error- Datastore errordatastore_migration_in_progress- The datastore is currently unavailable due to an in progress Enterprise org migration.free_team_not_allowed- Datastore put not allowed on a free team.invalid_app_id- The app_id provided is not valid for team and user.invalid_datastore- The provided datastore is invalid.partial_failure- some items failed to be deletedrestricted_plan_level- Feature is not available on this teamteam_quota_exceeded- Total number of requests exceeded team quota.unknown_method- This method does not exist
See the Common Errors guide for errors returned by every Web API method.
Get items from a datastore in bulk
API reference
Rate limit: Tier 3: 50+ per minute
Scopes:
- Bot token:
datastore:read
Required Params
datastore- name of the datastoreids- items' ids ex:["7c6dd137", "c7d6d731"]
Optional Params
app_id-
Errors the API can return:
app_not_hosted- The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps.datastore_error- Datastore errordatastore_migration_in_progress- The datastore is currently unavailable due to an in progress Enterprise org migration.free_team_not_allowed- Datastore put not allowed on a free team.invalid_app_id- The app_id provided is not valid for team and user.invalid_datastore- The provided datastore is invalid.partial_failure- some items failed to be retrievedrestricted_plan_level- Feature is not available on this teamteam_quota_exceeded- Total number of requests exceeded team quota.unknown_method- This method does not exist
See the Common Errors guide for errors returned by every Web API method.
Creates or replaces existing items in bulk
API reference
Rate limit: Tier 3: 50+ per minute
Scopes:
- Bot token:
datastore:write
Required Params
datastore- name of the datastoreitems- 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:
app_not_hosted- The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps.datastore_error- Datastore errordatastore_migration_in_progress- The datastore is currently unavailable due to an in progress Enterprise org migration.free_team_not_allowed- Datastore put not allowed on a free team.invalid_app_id- The app_id provided is not valid for team and user.invalid_datastore- The provided datastore is invalid.partial_failure- some items failed to be updatedrestricted_plan_level- Feature is not available on this teamteam_quota_exceeded- Total number of requests exceeded team quota.unknown_method- This method does not exist
See the Common Errors guide for errors returned by every Web API method.
Count the number of items in a datastore that match a query
API reference
Rate limit: Tier 3: 50+ per minute
Scopes:
- Bot token:
datastore:read
Required Params
datastore- Name of the datastore
Optional Params
app_id- Required if calling with user tokenexpression- A query filter expression ex:#artist = :artist_nameexpression_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:
app_not_hosted- The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps.datastore_error- Datastore errordatastore_migration_in_progress- The datastore is currently unavailable due to an in progress Enterprise org migration.free_team_not_allowed- Datastore query not allowed on a free team.invalid_app_id- The app_id provided is not valid for team and user.invalid_datastore- The provided datastore is invalid.restricted_plan_level- Feature is not available on this teamteam_quota_exceeded- Total number of requests exceeded team quota.
See the Common Errors guide for errors returned by every Web API method.
Delete an item from a datastore
API reference
Rate limit: Tier 4: 100+ per minute
Scopes:
- Bot token:
datastore:write
Required Params
datastore- name of the datastoreid- item id
Optional Params
app_id-
Errors the API can return:
app_not_hosted- The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps.datastore_error- Datastore errordatastore_migration_in_progress- The datastore is currently unavailable due to an in progress Enterprise org migration.free_team_not_allowed- Datastore delete not allowed on a free team.invalid_app_id- The app_id provided is not valid for team and user.invalid_datastore- The provided datastore is invalid.restricted_plan_level- Feature is not available on this team
See the Common Errors guide for errors returned by every Web API method.
Get an item from a datastore
API reference
Rate limit: Tier 4: 100+ per minute
Scopes:
- Bot token:
datastore:read
Required Params
datastore- name of the datastoreid- item id
Optional Params
app_id-
Errors the API can return:
app_not_hosted- The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps.datastore_error- Datastore error.datastore_migration_in_progress- The datastore is currently unavailable due to an in progress Enterprise org migration.free_team_not_allowed- Datastore get not allowed on a free team.invalid_app_id- The app_id provided is not valid for team and user.invalid_datastore- The provided datastore is invalid.restricted_plan_level- Feature is not available on this teamteam_quota_exceeded- Total number of requests exceeded team quota.
See the Common Errors guide for errors returned by every Web API method.
Creates a new item, or replaces an old item with a new item.
API reference
Rate limit: Tier 4: 100+ per minute
Scopes:
- Bot token:
datastore:write
Required Params
datastore- name of the datastoreitem- attribute names and values of the item
Optional Params
app_id-
Errors the API can return:
app_not_hosted- The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps.datastore_error- Datastore errordatastore_migration_in_progress- The datastore is currently unavailable due to an in progress Enterprise org migration.free_team_not_allowed- Datastore put not allowed on a free team.invalid_app_id- The app_id provided is not valid for team and user.invalid_datastore- The provided datastore is invalid.restricted_plan_level- Feature is not available on this teamteam_quota_exceeded- Total number of requests exceeded team quota.
See the Common Errors guide for errors returned by every Web API method.
Query a datastore for items
API reference
Rate limit: Tier 4: 100+ per minute
Scopes:
- Bot token:
datastore:read
Required Params
datastore- Name of the datastore
Optional Params
app_id- Required if calling with user tokencursor- Setcursortonext_cursorreturned by the previous call to list items in the next page ex:5c3e53d5expression- A query filter expression ex:#artist = :artist_nameexpression_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, anext_cursorvalue will be provided for use in subsequent requests. ex:100
Errors the API can return:
app_not_hosted- The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps.datastore_error- Datastore errordatastore_migration_in_progress- The datastore is currently unavailable due to an in progress Enterprise org migration.free_team_not_allowed- Datastore query not allowed on a free team.invalid_app_id- The app_id provided is not valid for team and user.invalid_datastore- The provided datastore is invalid.restricted_plan_level- Feature is not available on this teamteam_quota_exceeded- Total number of requests exceeded team quota.
See the Common Errors guide for errors returned by every Web API method.
Edits an existing item's attributes, or adds a new item if it does not already exist.
API reference
Rate limit: Tier 4: 100+ per minute
Scopes:
- Bot token:
datastore:write
Required Params
datastore- name of the datastoreitem- attribute names and values to be updated
Optional Params
app_id-
Errors the API can return:
app_not_hosted- The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps.datastore_error- Datastore errordatastore_migration_in_progress- The datastore is currently unavailable due to an in progress Enterprise org migration.free_team_not_allowed- Datastore put not allowed on a free team.invalid_app_id- The app_id provided is not valid for team and user.invalid_datastore- The provided datastore is invalid.restricted_plan_level- Feature is not available on this teamteam_quota_exceeded- Total number of requests exceeded team quota.
See the Common Errors guide for errors returned by every Web API method.