zulip/templates/zerver/api/upload-file.md
Suyash Vardhan Mathur 1fa82c2fcd apidocs: Fix response in API templates.
Now, the descriptions and all subschemas
are directly returned just by
`generate_code_example`, and so, these individual
subschemas and descriptions can be removed from the
templates.

All API endpoints docs are exactly the same after the
change, except few where missing 400 responses got added
due to the modification
2021-06-09 12:43:12 -07:00

913 B

{generate_api_title(/user_uploads:post)}

{generate_api_description(/user_uploads:post)}

Usage examples

{start_tabs}

{tab|python}

{generate_code_example(python)|/user_uploads:post|example}

{tab|curl}

{generate_code_example(curl)|/user_uploads:post|example}

{end_tabs}

Parameters

As described above, the file to upload must be provided in the request's body.

Maximum file size

The maximum file size for uploads can be configured by the administrator of the Zulip server by setting MAX_FILE_UPLOAD_SIZE in the server's settings. MAX_FILE_UPLOAD_SIZE defaults to 25MB.

Response

Return values

{generate_return_values_table|zulip.yaml|/user_uploads:post}

Example response

{generate_code_example|/user_uploads:post|fixture(200)}

{generate_code_example|/user_uploads:post|fixture(400)}