Часть технических описаний пока доступна на английском языке.

Delete a data export

Этот метод API доступен только администраторам организации.

DELETE https://z.u1v.ru/api/v1/export/realm/{export_id}

Delete a completed public or standard data export of the organization.

Data exports that happened on a previous server (i.e., an export with "export_from_prior_server": true in the GET /export/realm response) cannot be deleted using this endpoint, since their tarball is no longer stored on this server; attempting to do so fails with the same error as for an export that has already been deleted.

This endpoint's success response does not describe the resulting state of the organization's data exports. Clients should rely on the realm_export event, which every organization administrator receives whenever a data export's state changes, for the current state of an organization's data exports.

Changes: Prior to Zulip 13.0 (feature level 506), data exports without a tarball stored on this server had no dedicated status, so attempting to delete one resulted in an unexpected error. Starting at that feature level, such a delete attempt instead fails cleanly, as described above. This change was also backported to the Zulip 12.x series, at feature level 499.

New in Zulip 2.1.

Примеры запросов

#!/usr/bin/env python

import pero

# The user for this perorc file must be an organization administrator
client = pero.Client(config_file="~/.perorc-admin")

# Delete a completed public or standard data export.
result = client.call_endpoint(url=f"/export/realm/{export_id}", method="DELETE")
print(result)

Параметр -u задаёт учётные данные для HTTP-аутентификации Basic. Как получить их для пользователя или бота, описано в разделе о заголовке Authorization.

curl -sSX DELETE https://z.u1v.ru/api/v1/export/realm/1 \
    -u EMAIL_ADDRESS:API_KEY

Параметры

export_id integer обязательно в пути

Пример: 1

The ID of the data export to be deleted.


Ответ

Примеры ответов

Изменения: Начиная с Zulip 7.0 (уровень возможностей 167), успешный JSON-ответ содержит массив ignored_parameters_unsupported, если запрос включает параметры, которые метод не поддерживает.

Пример успешного JSON-ответа:

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

A typical failed JSON response for an invalid data export ID.

{
    "code": "BAD_REQUEST",
    "msg": "Invalid data export ID",
    "result": "error"
}