Datastore
Data store#
Using the dataStore resource, developers can store arbitrary data for their apps. Access to a datastore's key is based on its sharing settings. By default all keys created are publicly accessible (read and write). Additionally, access to a datastore's namespace is limited to the user's access to the corresponding app, if the app has reserved the namespace. For example a user with access to the "sampleApp" application will also be able to use the sampleApp namespace in the datastore. If a namespace is not reserved, no specific access is required to use it.
Data store structure#
Data store entries consist of a namespace, key and value. The combination of namespace and key is unique. The value data type is JSON.
Get keys and namespaces#
For a list of all existing namespaces:
Example curl request for listing:
Example response:
For a list of all keys in a namespace:
Example curl request for listing:
Example response:
To retrieve a value for an existing key from a namespace:
Example curl request for retrieval:
Example response:
To retrieve meta-data for an existing key from a namespace:
Example curl request for retrieval:
Example response:
Create values#
To create a new key and value for a namespace:
Example curl request for create, assuming a valid JSON payload:
Example response:
If you require the data you store to be encrypted (for example user credentials or similar) you can append a query to the url like this:
Update values#
To update a key that exists in a namespace:
Example curl request for update, assuming valid JSON payload:
Example response:
Delete keys#
To delete an existing key from a namespace:
Example curl request for delete:
Example response:
To delete all keys in a namespace:
Example curl request for delete:
Example response:
Sharing datastore keys#
Sharing of datastore keys follows the same principle as for other metadata sharing (see Sharing).
To get sharing settings for a specific datastore key:
To modify sharing settings for a specific datastore key:
with the following request:
User data store#
In addition to the dataStore which is shared between all users of the system, a user-based data store is also available. Data stored to the userDataStore is associated with individual users, so that each user can have different data on the same namespace and key combination. All calls against the userDataStore will be associated with the logged in user. This means one can only see, change, remove and add values associated with the currently logged in user.
User data store structure#
userDataStore consists of a user, a namespace, keys and associated values. The combination of user, namespace and key is unique.
Get namespaces#
Returns an array of all existing namespaces
Example request:
Get keys#
Returns an array of all existing keys in a given namespace
Example request:
Get values#
Returns the value for a given namespace and key
Example request:
Create value#
Adds a new value to a given key in a given namespace.
Example request:
If you require the value to be encrypted (For example user credentials and such) you can append a query to the url like this:
Update values#
Updates an existing value
Example request:
Delete key#
Delete a key
Example request:
Delete namespace#
Delete all keys in the given namespace
Example request: