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

Delete a custom profile field

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

DELETE https://z.u1v.ru/api/v1/realm/profile_fields/{field_id}

Delete a custom profile field in the user's organization.

This will also permanently delete any value configured for the custom profile field from every user profile in the database. Therefore, it's recommended that clients warn the active user of the related data removal before submitting the request, e.g., notify them of how many users will have their profile data deleted as a result of deleting the custom profile field.

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

#!/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 custom profile field in the user's organization.
result = client.call_endpoint(url=f"/realm/profile_fields/{field_id}", method="DELETE")
print(result)

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

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

Параметры

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

Пример: 4

The ID of the target custom profile field.


Ответ

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

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

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

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

A typical failed JSON response for when there is no custom profile field with the requested ID:

{
    "code": "BAD_REQUEST",
    "msg": "Field id 4 not found.",
    "result": "error"
}