Get a bot's stored data

GET https://mariadb.zulipchat.com/api/v1/bot_storage

Note: This endpoint is only available to bot user accounts.

Retrieve data stored for a bot user.

Changes: Prior to Zulip 12.0 (feature level 494), users who were not bots could access this endpoint.

Usage examples

#!/usr/bin/env python3

import zulip

# Pass the path to your zuliprc file here.
client = zulip.Client(config_file="~/zuliprc")

# Retrieve all data stored for a bot user.
result = client.get_storage()
print(result)

The -u line implements HTTP Basic authentication. See the Authorization header documentation for how to get those credentials for Zulip users and bots.

curl -sSX GET -G https://mariadb.zulipchat.com/api/v1/bot_storage \
    -u EMAIL_ADDRESS:API_KEY

Parameters

keys (string)[] optional

Example: ["foo"]

A JSON-encoded list of keys for data in the bot's storage.

If not provided, then all data that's stored for the bot is returned.


Response

Return values

  • storage: object

    A dictionary with string key-value pairs of data stored for the bot user.

    If the keys parameter was passed, then only the key-value pairs matching the list of keys will be returned.

    • {key}: string

      The stored string value for this key.

Example response(s)

Changes: As of Zulip 7.0 (feature level 167), if any parameters sent in the request are not supported by this endpoint, a successful JSON response will include an ignored_parameters_unsupported array.

A typical successful JSON response may look like:

{
    "msg": "",
    "result": "success",
    "storage": {
        "foo": "bar"
    }
}

A typical failed JSON response when a requested key does not exist in the bot's storage:

{
    "code": "BAD_REQUEST",
    "msg": "Key does not exist.",
    "result": "error"
}

A typical failed JSON response when the user is not a bot:

{
    "code": "PERMISSION_DENIED",
    "msg": "Must be a bot user",
    "result": "error"
}