Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Перевели просмотр списка сообщений в отклике/приглашении в OpenAPI #833

Merged
merged 2 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 1 addition & 133 deletions docs/employer_negotiations.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,139 +135,7 @@
> [менеджера работодателя](docs/employer_negotiations.md#get-messages) устарели, и новые возможности [чатов](https://feedback.hh.ru/knowledge-base/article/1290) в них не будут поддерживаться.
> В связи с этим переписка может некорректно отображаться.

Сообщения в отклике/приглашении могут быть:

* сопроводительным письмом, оставленным соискателем при отклике на вакансию
* текстом, отправленным работодателем при приглашении на вакансию, приглашении
на интервью или отказе
* сообщениями свободной переписки между соискателем и работодателем

Для того, чтобы посмотреть список сообщений в отклике необходимо сделать запрос по урлу (поле `messages_url`), пришедшему в
[списке откликов/приглашений](#negotiations-list) или в [просмотре отклика/приглашения](#get-negotiation).
Например:

`GET /negotiations/123456789/messages`

Параметры:

Имя | Обязательный | Принимаемые значения | Описание
--- | ------------ | -------------------- | --------
with_text_only | нет | true/false | Вернуть только те сообщения, которые содержат текст в поле `text`, по умолчанию: `false`, т.е. будут возвращены все сообщения

### Ответ

Успешный ответ приходит с кодом `200 OK` и содержит:

```json
{
"found": 2,
"pages": 1,
"page": 0,
"per_page": 20,
"items": [
{
"id": "123",
"text": "Приглашаем вас на нашу вакансию ...",
"created_at": "2015-05-15T19:23:35+0300",
"author": {
"participant_type": "employer"
},
"viewed_by_opponent": true,
"viewed_by_me": true,
"state": {
"id": "invitation",
"name": "Приглашение"
},
"address": {
"building": "10",
"city": "Москва",
"description": "Направо под знак",
"lat": 35.0,
"lng": 30.0,
"metro": {
"lat": 55.789704,
"line_id": "2",
"line_name": "Замоскворецкая",
"lng": 37.558212,
"station_id": "2.34",
"station_name": "Динамо"
},
"metro_stations": [
{
"lat": 55.789704,
"line_id": "2",
"line_name": "Замоскворецкая",
"lng": 37.558212,
"station_id": "2.34",
"station_name": "Динамо"
}
],
"street": "ул. Динамо"
},
"assessments": [
{
"id": "123",
"name": "Динамический тест числовых способностей",
"actions": [
{
"id": "proceed",
"name": "Перейти к тестированию",
"enabled": true,
"alternate_url": "https://hh.ru/applicant/assessment/123"
}
]
}
]
},
{
"id": "321",
"text": "Отлично, с удовольствием пройду интервью ...",
"created_at": "2015-05-15T19:23:35+0300",
"author": {
"participant_type": "applicant"
},
"viewed_by_me": false,
"viewed_by_opponent": true,
"state": {
"id": "text",
"name": "Текст"
},
"address": null
}
]
}
```

где:

Имя | Тип | Описание
--- | --- | --------
found | число | Количество сообщений в переписке ( ≥ 0 )
pages | число | Количество страниц с сообщениями ( ≥ 1 )
per_page | число | Количество сообщений на страницу ( > 0 )
page | число | Номер текущей страницы ( ≥ 0 )

Сообщения отсортированы в следующем порядке: самое старое - первое, самое новое - последнее.

<a name="negotiations-message-item"></a>
В элементе `items` содержатся данные о сообщениях:

Имя | Тип | Описание
--- | --- | --------
id | строка | Идентификатор сообщения
viewed_by_me | логический | Прочитано ли сообщение смотрящим (для сообщений отправленных работодателем всегда `true`)
viewed_by_opponent | логический | Прочитано ли сообщение соискателем (для сообщений соискателя всегда `true`)
created_at | строка | Дата и время создания сообщения
text | строка, null | Текст сообщения. `null` может быть в случае, когда соискатель не оставил сопроводительное письмо к отклику.
state | объект | Текущее состояние отклика. Возможные значения находятся в справочнике [/dictionaries](https://api.hh.ru/openapi/redoc#tag/Obshie-spravochniki/operation/get-dictionaries) в разделе `negotiations_state`
author | объект | Кто автор сообщения
author.participant_type | строка | Роль автора сообщения. Возможные значения находятся в справочнике [/dictionaries](https://api.hh.ru/openapi/redoc#tag/Obshie-spravochniki/operation/get-dictionaries) в разделе `negotiations_participant_type`
address | объект, null | [Адрес](./address.md), привязанный к отклику/приглашению
assessments | массив | [инструменты оценки](assessment.md), привязанные к сообщению

В случае, когда отклик/приглашение не существует или переписка недоступна
текущему пользователю возвращается ответ `404 Not Found`.

> !! Данный метод доступен в [OpenAPI](https://api.hh.ru/openapi/redoc#tag/Otklikipriglasheniya-rabotodatelya/operation/get-negotiation-messages)

<a name="add-messages"></a>
## Отправка сообщения в отклике/приглашении
Expand Down
140 changes: 1 addition & 139 deletions docs_eng/employer_negotiations.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,145 +132,7 @@ or [individual response/invitation](#get-negotiation)
>‼️ Please note that the methods for handling response/invitation messages on behalf of the [applicant](negotiations.md#get_messages) and
> [employer manager](employer_negotiations.md#get-messages) are deprecated and the new chat capabilities will not be supported in these methods. As such, correspondence may not display correctly.

Messages contained in the response/invitation can be made as:

* cover letter left by the applicant upon response to the vacancy
* text sent by the employer upon inviting for the vacancy, for the interview
or upon rejection
* free negotiation messages between the applicant and the employer

### Request

```
GET /negotiations/{nid}/messages
```

where `nid` is the response/invitation ID.

Usually is taken from key `messages_url` in
[the list of responses/invitations](#negotiations-list) or in
[view the response/invitation](#get-negotiation).

Parameters:

Name | Required | Possible values | Description
---- | -------- | --------------- | -----------
with_text_only | no | true/false | Return only messages with non empty `text` field, by default: `false`, so all messages will be returned

### Response

Successful server response is returned with `200 OK` code and contains:

```json
{
"found": 2,
"pages": 1,
"page": 0,
"per_page": 20,
"items": [
{
"id": "123",
"text": "You are invited for the vacancy...",
"created_at": "2015-05-15T19:23:35+0300",
"author": {
"participant_type": "employer"
},
"viewed_by_opponent": true,
"viewed_by_me": true,
"state": {
"id": "invitation",
"name": "Invitation"
},
"address": {
"building": "10",
"city": "Moscow",
"description": "Turn right following the sign",
"lat": 35.0,
"lng": 30.0,
"metro": {
"lat": 55.789704,
"line_id": "2",
"line_name": "Zamoskvoretskaya",
"lng": 37.558212,
"station_id": "2.34",
"station_name": "Dinamo"
},
"metro_stations": [
{
"lat": 55.789704,
"line_id": "2",
"line_name": "Zamoskvoretskaya",
"lng": 37.558212,
"station_id": "2.34",
"station_name": "Dinamo"
}
],
"street": "ul. Dinamo"
},
"assessments": [
{
"id": "123",
"name": "Dynamic numerical ability test",
"actions": [
{
"id": "proceed",
"name": "Go to testing",
"enabled": true,
"alternate_url": "https://hh.ru/applicant/assessment/123"
}
]
}
]
},
{
"id": "321",
"text": "Great! I will be glad to meet you for an interview...",
"created_at": "2015-05-15T19:23:35+0300",
"author": {
"participant_type": "applicant"
},
"viewed_by_me": false,
"viewed_by_opponent": true,
"state": {
"id": "text",
"name": "Text"
},
"address": null
}
]
}
```

where:

Name | Type | Description
--- | --- | --------
found | number | Number of messages in negotiation ( ≥ 0 )
pages | number | Number of pages with messages ( ≥ 1 )
per_page | number | Number of messages per page ( > 0 )
page | number | Number of the current page ( ≥ 0 )

Messages are sorted in the following order: the oldest message is first and the newest last.

<a name="negotiations-message-item"></a>
The `items` entity contains message data:

Name | Type | Description
--- | --- | --------
id | string | Message ID
viewed_by_me| logical | Whether the message was read by the viewer (for messages sent by employer the value is always `true`)
viewed_by_opponent| logical | Whether the message was read by the applicant (for messages sent by applicant the value is always `true`)
created_at | string | Message creation date and time
text| string, null | Message text. `null` can be displayed if the applicant didn't attach the cover letter to the response.
state | object | Current state of the application. Possible values are listed in the [/dictionaries](https://api.hh.ru/openapi/en/redoc#tag/Public-directories/operation/get-dictionaries) reference, section `negotiations_state`
author| object | Who is the message author
author.participant_type| string | Message author role. Possible values are listed in the [/dictionaries](https://api.hh.ru/openapi/en/redoc#tag/Public-directories/operation/get-dictionaries) reference, section `negotiations_participant_type`
address| object, null | [Address](./address.md) linked to the response/invitation
assessments| array | [assessment tools](assessment.md) linked to the message

If response/invitation doesn't exist or negotiation not available to the current user,
`404 Not Found` response will be returned.

>!! Method is defined in [OpenAPI](https://api.hh.ru/openapi/en/redoc#tag/Employer-responsesinvitations/operation/get-negotiation-messages)

<a name="add-messages"></a>
## Sending a message in the response/invitation
Expand Down
Loading