Changes: New in Zulip 4.0 (feature level 49). A parameter encoding bug was
fixed in Zulip 4.0 (feature level 57).
Usage examples
Python
curl
#!/usr/bin/env python3importzulip# Pass the path to your zuliprc file here.client=zulip.Client(config_file="~/zuliprc")# Add a realm playground for Pythonrequest={"name":"Python playground","pygments_language":"Python","url_template":"https://python.example.com?code={code}",}result=client.call_endpoint(url="/realm/playgrounds",method="POST",request=request)print(result)
The user-visible display name of the playground which can be
used to pick the target playground, especially when multiple
playground options exist for that programming language.
pygments_languagestringrequired
Example: "Python"
The name of the Pygments language lexer for that
programming language.
url_templatestringrequired
Example: "https://python.example.com?code={code}"
The RFC 6570
compliant URL template for the playground. The template should
contain exactly one variable named code, which determines how the
extracted code should be substituted in the playground URL.
Changes: New in Zulip 8.0 (feature level 196). This replaced the
url_prefix parameter, which was used to construct URLs by just
concatenating url_prefix and code.
Response
Return values
id: integer
The numeric ID assigned to this playground.
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.