Получить комментарии

Возвращает активные начальные комментарии обсуждений на странице. Ответы внутри веток не входят в
этот список: используйте GET /v1/pages/{idx}/comments/{comment_id}/thread.

По умолчанию комментарии отсортированы по дате создания от новых к старым.

Общие заголовки и способы аутентификации описаны в разделе Доступ к API. Примеры сценариев приведены в разделе Примеры использования API.

Request

GET

https://api.wiki.yandex.net/v1/pages/{idx}/comments

Path parameters

Name

Description

idx

Type: integer

Идентификатор страницы. Значение idx совпадает со значением поля id в ответе GET /v1/pages?slug=… или POST /v1/pages.

Query parameters

Name

Description

cursor

Type: string

Курсор страницы выдачи из next_cursor или prev_cursor предыдущего ответа

Example: ``

order_by

Type: string

Если указано, отсортировать выдачу по полю в направлении order_direction

Const: created_at

Example: ``

order_direction

All of: OrderDirection
  • OrderDirection

    Type: string

    An enumeration.

    Enum: asc, desc

Если указано поле order_by, направление сортировки

Default: asc

Example: ``

page_size

Type: integer

Число результатов на странице выдачи.

Default: 50

Min value: 1

Max value: 100

status_filter

All of: CommentResolveStatus
  • CommentResolveStatus

    Type: string

    An enumeration.

    Enum: resolved, unresolved

Фильтрация по статусу комментария. Возможные значения: resolved, unresolved.

Example: ``

Responses

200 OK

OK

Body

application/json
{
  "results": [
    {
      "id": 0,
      "body": "example",
      "inline_text": "example",
      "parent_id": 0,
      "author": {
        "id": 0,
        "identity": null,
        "username": "example",
        "display_name": "example",
        "is_dismissed": true,
        "affiliation": "example"
      },
      "thread_id": 0,
      "created_at": "2025-01-01T00:00:00Z",
      "is_deleted": true,
      "resolve_status": "resolved",
      "reactions": [
        {
          "type": null,
          "author": null,
          "created_at": "2025-01-01T00:00:00Z"
        }
      ],
      "thread_info": {
        "total_posts": 0,
        "last_comment": null
      }
    }
  ],
  "next_cursor": "example",
  "prev_cursor": "example"
}

Name

Description

results

Type: CommentSchemaExt[]

Элементы текущей страницы выдачи

Example
[
  {
    "id": 0,
    "body": "example",
    "inline_text": "example",
    "parent_id": 0,
    "author": {
      "id": 0,
      "identity": null,
      "username": "example",
      "display_name": "example",
      "is_dismissed": true,
      "affiliation": "example"
    },
    "thread_id": 0,
    "created_at": "2025-01-01T00:00:00Z",
    "is_deleted": true,
    "resolve_status": "resolved",
    "reactions": [
      {
        "type": "like",
        "author": null,
        "created_at": "2025-01-01T00:00:00Z"
      }
    ],
    "thread_info": {
      "total_posts": 0,
      "last_comment": null
    }
  }
]

next_cursor

Type: string

Курсор для запроса следующей страницы выдачи

Example: example

prev_cursor

Type: string

Курсор для запроса предыдущей страницы выдачи

Example: example

UserIdentity

Идентификатор пользователя

Name

Description

cloud_uid

Type: string

Идентификатор пользователя в облаке

Example: example

uid

Type: string

Идентификатор пользователя в Яндексе

Example: example

Example
{
  "uid": "example",
  "cloud_uid": "example"
}

UserSchema

Информация о пользователе

Name

Description

affiliation

Type: string

Принадлежность пользователя

Example: example

display_name

Type: string

Отображаемое имя пользователя

Example: example

id

Type: integer

Внутренний идентификатор пользователя

is_dismissed

Type: boolean

Пользователь уволен

username

Type: string

Логин пользователя

Example: example

identity

All of 1 type
  • UserIdentity

    Type: UserIdentity

    Идентификатор пользователя

    Example
    {
      "uid": "example",
      "cloud_uid": "example"
    }
    

Идентификатор пользователя в системе

Example
{
  "uid": "example",
  "cloud_uid": "example"
}
Example
{
  "id": 0,
  "identity": {
    "uid": "example",
    "cloud_uid": "example"
  },
  "username": "example",
  "display_name": "example",
  "is_dismissed": true,
  "affiliation": "example"
}

CommentResolveStatus

Статус решения комментария:

  • resolved — комментарий решен
  • unresolved — комментарий не решен

Type: string

Enum: resolved, unresolved

ReactionType

Тип реакции на комментарий:

  • like — нравится
  • hooray — ура
  • confused — в замешательстве
  • heart — сердце
  • rocket — ракета
  • eyes — вижу
  • fire — огонь
  • ok — ок
  • facepalm — фейспалм
  • check — галочка
  • laugh — смех
  • dislike — не нравится

Type: string

Enum: like, hooray, confused, heart, rocket, eyes, fire, ok, facepalm, check, laugh, dislike

CommentReactionSchema

Name

Description

author

All of 1 type
  • UserSchema

    Type: UserSchema

    Информация о пользователе

    Example
    {
      "id": 0,
      "identity": {
        "uid": "example",
        "cloud_uid": "example"
      },
      "username": "example",
      "display_name": "example",
      "is_dismissed": true,
      "affiliation": "example"
    }
    

Пользователь, поставивший реакцию

Example
{
  "id": 0,
  "identity": {
    "uid": "example",
    "cloud_uid": "example"
  },
  "username": "example",
  "display_name": "example",
  "is_dismissed": true,
  "affiliation": "example"
}

created_at

Type: string<date-time>

Дата и время добавления реакции

Example: 2025-01-01T00:00:00Z

type

All of 1 type
  • ReactionType

    Type: ReactionType

    Тип реакции на комментарий:

    • like — нравится
    • hooray — ура
    • confused — в замешательстве
    • heart — сердце
    • rocket — ракета
    • eyes — вижу
    • fire — огонь
    • ok — ок
    • facepalm — фейспалм
    • check — галочка
    • laugh — смех
    • dislike — не нравится

    Enum: like, hooray, confused, heart, rocket, eyes, fire, ok, facepalm, check, laugh, dislike

Тип реакции

Example: like

Example
{
  "type": "like",
  "author": {
    "id": 0,
    "identity": {
      "uid": "example",
      "cloud_uid": "example"
    },
    "username": "example",
    "display_name": "example",
    "is_dismissed": true,
    "affiliation": "example"
  },
  "created_at": "2025-01-01T00:00:00Z"
}

CommentSchema

Комментарий к странице

Name

Description

author

All of 1 type
  • UserSchema

    Type: UserSchema

    Информация о пользователе

    Example
    {
      "id": 0,
      "identity": {
        "uid": "example",
        "cloud_uid": "example"
      },
      "username": "example",
      "display_name": "example",
      "is_dismissed": true,
      "affiliation": "example"
    }
    

Автор комментария

Example
{
  "id": 0,
  "identity": {
    "uid": "example",
    "cloud_uid": "example"
  },
  "username": "example",
  "display_name": "example",
  "is_dismissed": true,
  "affiliation": "example"
}

body

Type: string

Текст комментария

Example: example

created_at

Type: string<date-time>

Дата и время создания комментария

Example: 2025-01-01T00:00:00Z

id

Type: integer

Уникальный идентификатор комментария

is_deleted

Type: boolean

Признак удаленного комментария

reactions

Type: CommentReactionSchema[]

Реакции на комментарий

Example
[
  {
    "type": "like",
    "author": {
      "id": 0,
      "identity": null,
      "username": "example",
      "display_name": "example",
      "is_dismissed": true,
      "affiliation": "example"
    },
    "created_at": "2025-01-01T00:00:00Z"
  }
]

resolve_status

All of 1 type
  • CommentResolveStatus

    Type: CommentResolveStatus

    Статус решения комментария:

    • resolved — комментарий решен
    • unresolved — комментарий не решен

    Enum: resolved, unresolved

Статус решения комментария

Example: resolved

inline_text

Type: string

Текст, к которому привязан комментарий (для инлайн-комментариев)

Example: example

parent_id

Type: integer

ID родительского комментария (для ответов в ветке)

thread_id

Type: integer

ID ветки комментариев

Example
{
  "id": 0,
  "body": "example",
  "inline_text": "example",
  "parent_id": 0,
  "author": {
    "id": 0,
    "identity": {
      "uid": "example",
      "cloud_uid": "example"
    },
    "username": "example",
    "display_name": "example",
    "is_dismissed": true,
    "affiliation": "example"
  },
  "thread_id": 0,
  "created_at": "2025-01-01T00:00:00Z",
  "is_deleted": true,
  "resolve_status": "resolved",
  "reactions": [
    {
      "type": "like",
      "author": null,
      "created_at": "2025-01-01T00:00:00Z"
    }
  ]
}

ThreadSchema

Name

Description

last_comment

All of 1 type
  • CommentSchema

    Type: CommentSchema

    Комментарий к странице

    Example
    {
      "id": 0,
      "body": "example",
      "inline_text": "example",
      "parent_id": 0,
      "author": {
        "id": 0,
        "identity": {
          "uid": "example",
          "cloud_uid": "example"
        },
        "username": "example",
        "display_name": "example",
        "is_dismissed": true,
        "affiliation": "example"
      },
      "thread_id": 0,
      "created_at": "2025-01-01T00:00:00Z",
      "is_deleted": true,
      "resolve_status": "resolved",
      "reactions": [
        {
          "type": "like",
          "author": null,
          "created_at": "2025-01-01T00:00:00Z"
        }
      ]
    }
    

Последний активный ответ в ветке комментариев

Example
{
  "id": 0,
  "body": "example",
  "inline_text": "example",
  "parent_id": 0,
  "author": {
    "id": 0,
    "identity": null,
    "username": "example",
    "display_name": "example",
    "is_dismissed": true,
    "affiliation": "example"
  },
  "thread_id": 0,
  "created_at": "2025-01-01T00:00:00Z",
  "is_deleted": true,
  "resolve_status": "resolved",
  "reactions": [
    {
      "type": "like",
      "author": null,
      "created_at": "2025-01-01T00:00:00Z"
    }
  ]
}

total_posts

Type: integer

Количество ответов в ветке комментариев

Example
{
  "total_posts": 0,
  "last_comment": {
    "id": 0,
    "body": "example",
    "inline_text": "example",
    "parent_id": 0,
    "author": {
      "id": 0,
      "identity": null,
      "username": "example",
      "display_name": "example",
      "is_dismissed": true,
      "affiliation": "example"
    },
    "thread_id": 0,
    "created_at": "2025-01-01T00:00:00Z",
    "is_deleted": true,
    "resolve_status": "resolved",
    "reactions": [
      {
        "type": null,
        "author": null,
        "created_at": "2025-01-01T00:00:00Z"
      }
    ]
  }
}

CommentSchemaExt

Name

Description

author

All of 1 type
  • UserSchema

    Type: UserSchema

    Информация о пользователе

    Example
    {
      "id": 0,
      "identity": {
        "uid": "example",
        "cloud_uid": "example"
      },
      "username": "example",
      "display_name": "example",
      "is_dismissed": true,
      "affiliation": "example"
    }
    

Автор комментария

Example
{
  "id": 0,
  "identity": {
    "uid": "example",
    "cloud_uid": "example"
  },
  "username": "example",
  "display_name": "example",
  "is_dismissed": true,
  "affiliation": "example"
}

body

Type: string

Текст комментария

Example: example

created_at

Type: string<date-time>

Дата и время создания комментария

Example: 2025-01-01T00:00:00Z

id

Type: integer

Уникальный идентификатор комментария

is_deleted

Type: boolean

Признак удаленного комментария

reactions

Type: CommentReactionSchema[]

Реакции на комментарий

Example
[
  {
    "type": "like",
    "author": {
      "id": 0,
      "identity": null,
      "username": "example",
      "display_name": "example",
      "is_dismissed": true,
      "affiliation": "example"
    },
    "created_at": "2025-01-01T00:00:00Z"
  }
]

resolve_status

All of 1 type
  • CommentResolveStatus

    Type: CommentResolveStatus

    Статус решения комментария:

    • resolved — комментарий решен
    • unresolved — комментарий не решен

    Enum: resolved, unresolved

Статус решения комментария

Example: resolved

inline_text

Type: string

Текст, к которому привязан комментарий (для инлайн-комментариев)

Example: example

parent_id

Type: integer

ID родительского комментария (для ответов в ветке)

thread_id

Type: integer

ID ветки комментариев

thread_info

All of 1 type
  • ThreadSchema

    Type: ThreadSchema

    Example
    {
      "total_posts": 0,
      "last_comment": {
        "id": 0,
        "body": "example",
        "inline_text": "example",
        "parent_id": 0,
        "author": {
          "id": 0,
          "identity": null,
          "username": "example",
          "display_name": "example",
          "is_dismissed": true,
          "affiliation": "example"
        },
        "thread_id": 0,
        "created_at": "2025-01-01T00:00:00Z",
        "is_deleted": true,
        "resolve_status": "resolved",
        "reactions": [
          {
            "type": null,
            "author": null,
            "created_at": "2025-01-01T00:00:00Z"
          }
        ]
      }
    }
    

Сведения об ответах в ветке. Заполняется для начального комментария, если есть ответы.

Example
{
  "total_posts": 0,
  "last_comment": {
    "id": 0,
    "body": "example",
    "inline_text": "example",
    "parent_id": 0,
    "author": null,
    "thread_id": 0,
    "created_at": "2025-01-01T00:00:00Z",
    "is_deleted": true,
    "resolve_status": "resolved",
    "reactions": [
      {}
    ]
  }
}
Example
{
  "id": 0,
  "body": "example",
  "inline_text": "example",
  "parent_id": 0,
  "author": {
    "id": 0,
    "identity": {
      "uid": "example",
      "cloud_uid": "example"
    },
    "username": "example",
    "display_name": "example",
    "is_dismissed": true,
    "affiliation": "example"
  },
  "thread_id": 0,
  "created_at": "2025-01-01T00:00:00Z",
  "is_deleted": true,
  "resolve_status": "resolved",
  "reactions": [
    {
      "type": "like",
      "author": null,
      "created_at": "2025-01-01T00:00:00Z"
    }
  ],
  "thread_info": {
    "total_posts": 0,
    "last_comment": {
      "id": 0,
      "body": "example",
      "inline_text": "example",
      "parent_id": 0,
      "author": null,
      "thread_id": 0,
      "created_at": "2025-01-01T00:00:00Z",
      "is_deleted": true,
      "resolve_status": null,
      "reactions": [
        null
      ]
    }
  }
}
Предыдущая