Get all saved snippets

GET https://leanprover.zulipchat.com/api/v1/saved_snippets

Fetch all the saved snippets for the current user.

Changes: New in Zulip 10.0 (feature level 297).

Usage examples

#!/usr/bin/env python3

import zulip

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

# Get all the saved snippets.
result = client.call_endpoint(
    url="/saved_snippets",
    method="GET",
)
print(result)

curl -sSX GET -G https://leanprover.zulipchat.com/api/v1/saved_snippets \
    -u BOT_EMAIL_ADDRESS:BOT_API_KEY

Parameters

This endpoint does not accept any parameters.

Response

Return values

  • saved_snippets: (object)[]

    An array of dictionaries containing data on all of the current user's saved snippets.

    • id: integer

      The unique ID of the saved snippet.

    • title: string

      The title of the saved snippet.

    • content: string

      The content of the saved snippet in text/markdown format.

      Clients should insert this content into a message when using a saved snippet.

    • date_created: integer

      The UNIX timestamp for when the saved snippet was created, in UTC seconds.

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",
    "saved_snippets": [
        {
            "content": "Welcome to the organization.",
            "date_created": 1681662420,
            "id": 1,
            "title": "Example"
        }
    ]
}