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

Delete your profile picture

DELETE https://z.u1v.ru/api/v1/users/me/avatar

Delete the current user's uploaded profile picture, reverting to the organization's default style for profile pictures.

This endpoint is idempotent: if the current user has not uploaded a custom profile picture, the request succeeds without making any changes.

In organizations that restrict profile picture changes, only administrators can use this endpoint.

Changes: Prior to Zulip 12.0 (feature level 443), this endpoint was not idempotent; calling it when the current user had not uploaded a custom profile picture would still increment their avatar version and send a redundant user update event to clients.

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

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

curl -sSX DELETE https://z.u1v.ru/api/v1/users/me/avatar \
    -u EMAIL_ADDRESS:API_KEY

Параметры

Этот метод не принимает параметров.

Ответ

Возвращаемые поля

  • avatar_url: string

    The URL of the current user's profile picture, which now uses the organization's default style for profile pictures. Its format depends on whether that style is the default abstract design or Gravatar.

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

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

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

{
    "avatar_url": "/user_avatars/2/3a7bd3e2360a3d29eea436fcfb7e44c735d117c4.png",
    "msg": "",
    "result": "success"
}

An example JSON response for when a non-administrator attempts to change their profile picture in an organization that has disabled profile picture changes:

{
    "code": "BAD_REQUEST",
    "msg": "Avatar changes are disabled in this organization.",
    "result": "error"
}