zulip/templates/zerver/api/add-playground.md
Sumanth V Rao 251b415987 realm/playground: Add API endpoint for creating playground entry.
This endpoint will allow clients to create a playground entry
containing the name, pygments language and url_prefix for the
playground of their choice.

Introduced the `do_*` function in-charge of creating the entry in
the model. Handling the process of sending events which will be
done in a follow up commit.

Added the openAPI format data to zulip.yaml for POST
/realm/playgrounds. Also added python and curl examples for using
the endpoint in its markdown documented (add-playground.md).

Tests added.
2021-04-07 08:20:53 +05:30

588 B

Add a playground

{generate_api_description(/realm/playgrounds:post)}

Usage examples

{start_tabs} {tab|python}

{generate_code_example(python)|/realm/playgrounds:post|example}

{tab|curl}

{generate_code_example(curl)|/realm/playgrounds:post|example}

{end_tabs}

Parameters

{generate_api_arguments_table|zulip.yaml|/realm/playgrounds:post}

Response

Return values

{generate_return_values_table|zulip.yaml|/realm/playgrounds:post}

Example response

A typical successful JSON response may look like:

{generate_code_example|/realm/playgrounds:post|fixture(200)}