Check thumbnail status

GET https://chat.zulip.org/api/v1/thumbnail/status/{realm_id_str}/{filename}

Check whether a thumbnail exists for a specific file uploaded by a user. This endpoint is intended to be polled by clients to determine when thumbnail generation is complete.

Changes: New in Zulip 12.0 (feature level 479).

Usage examples

#!/usr/bin/env python3

import zulip

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

# Check thumbnail status.
result = client.call_endpoint(
    url=f"/thumbnail/status/{realm_id_str}/{filename}",
    method="GET",
)
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://chat.zulip.org/api/v1/thumbnail/status/1/4e/m2A3MSqFnWRLUf9SaPzQ0Up_/zulip.txt \
    -u EMAIL_ADDRESS:API_KEY

Parameters

realm_id_str integer required in path

Example: 1

The realm ID component of the file's path_id. If the path_id is 1/4e/m2A3MSqFnWRLUf9SaPzQ0Up_/zulip.txt, the realm_id_str would be 1.


filename string required in path

Example: "4e/m2A3MSqFnWRLUf9SaPzQ0Up_/zulip.txt"

The file path component of the file's path_id (everything after the first /). If the path_id is 1/4e/m2A3MSqFnWRLUf9SaPzQ0Up_/zulip.txt, the filename would be 4e/m2A3MSqFnWRLUf9SaPzQ0Up_/zulip.txt.


Response

Return values

  • has_thumbnail: boolean

    A boolean indicating whether the thumbnail exists.

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:

{
    "has_thumbnail": true,
    "msg": "",
    "result": "success"
}