Receiving a chat message

The method is available for all models.

If you are using an API Key token, one of the accesses in the list is required to call the method
  • communication — Customer communication
  • all-methods — Full account management
  • all-methods:read-only — View all data

Returns a message by its ID.

Enable API notifications

Yandex.Market will send you a request. POST notification when a new chat or message appears.

How to work with notifications

, Limit: 1,000 requests per hour

Request

GET

https://api.partner.market.yandex.ru/businesses/{businessId}/chats/message

Path parameters

Name

Description

businessId*

Type: integer<int64>

Cabinet ID. To find out, use the request GET campaigns.

ℹ️ What is a cabinet and a store on the Market?

Min value: 1

Query parameters

Name

Description

chatId*

Type: integer<int64>

The chat ID.

Min value: 1

messageId*

Type: integer<int64>

The ID of the message.

Min value: 1

Responses

200 OK

The message and information about it.

Body

application/json
{
    "status": "OK",
    "result": {
        "messageId": 0,
        "createdAt": "2017-11-21T00:00:00+03:00",
        "sender": "PARTNER",
        "message": "string",
        "payload": [
            {
                "name": "string",
                "url": "string",
                "size": 0
            }
        ]
    }
}

Name

Description

result

Type: ChatMessageDTO

Information about the message.

status

Type: ApiResponseStatusType

The type of response. Possible values:

  • OK — there are no mistakes.
  • ERROR — an error occurred while processing the request.

Enum: OK, ERROR

ChatMessageDTO

Information about the message.

Name

Description

createdAt*

Type: string<date-time>

The date and time when the message was created.

Date format: ISO 8601 with an offset relative to UTC.

Example: 2017-11-21T00:00:00+03:00

messageId*

Type: integer<int64>

The ID of the message.

Min value: 1

sender*

Type: ChatMessageSenderType

Sender.

Enum: PARTNER, CUSTOMER, MARKET, SUPPORT

message

Type: string

The text of the message.

Optional parameter if the parameter is returned payload.

payload

Type: ChatMessagePayloadDTO[]

Information about the files attached to the message.

Optional parameter if the parameter is returned message.
Information about the files attached to the message.

Min items: 1

ApiResponseStatusType

The type of response. Possible values:

  • OK — there are no mistakes.
  • ERROR — an error occurred while processing the request.

Type

Description

ApiResponseStatusType

Enum: OK, ERROR

ChatMessageSenderType

Who sent the message:

  • PARTNER — the store.
  • CUSTOMER — the buyer.
  • MARKET — The market.
  • SUPPORT — a Yandex. Market support employee.

Type

Description

ChatMessageSenderType

Enum: PARTNER, CUSTOMER, MARKET, SUPPORT

ChatMessagePayloadDTO

Information about the files attached to the message.

Name

Description

name*

Type: string

The file name.

size*

Type: integer<int32>

The file size in bytes.

url*

Type: string

The link to download the file.

Min length: 1

Max length: 2000

400 Bad Request

The request contains incorrect data. More information about the error

Body

application/json
{
    "status": "OK",
    "errors": [
        {
            "code": "string",
            "message": "string"
        }
    ]
}

Name

Description

errors

Type: ApiErrorDTO[]

A list of errors.
The general error format.

Min items: 1

status

Type: ApiResponseStatusType

The type of response. Possible values:

  • OK — there are no mistakes.
  • ERROR — an error occurred while processing the request.

Enum: OK, ERROR

ApiErrorDTO

The general error format.

Name

Description

code*

Type: string

The error code.

message

Type: string

Description of the error.

401 Unauthorized

The authorization data is not specified in the request. More information about the error

Body

application/json
{
    "status": "OK",
    "errors": [
        {
            "code": "string",
            "message": "string"
        }
    ]
}

Name

Description

errors

Type: ApiErrorDTO[]

A list of errors.
The general error format.

Min items: 1

status

Type: ApiResponseStatusType

The type of response. Possible values:

  • OK — there are no mistakes.
  • ERROR — an error occurred while processing the request.

Enum: OK, ERROR

403 Forbidden

The authorization data is incorrect or access to the resource is prohibited. More information about the error

Body

application/json
{
    "status": "OK",
    "errors": [
        {
            "code": "string",
            "message": "string"
        }
    ]
}

Name

Description

errors

Type: ApiErrorDTO[]

A list of errors.
The general error format.

Min items: 1

status

Type: ApiResponseStatusType

The type of response. Possible values:

  • OK — there are no mistakes.
  • ERROR — an error occurred while processing the request.

Enum: OK, ERROR

404 Not Found

The requested resource was not found. More information about the error

Body

application/json
{
    "status": "OK",
    "errors": [
        {
            "code": "string",
            "message": "string"
        }
    ]
}

Name

Description

errors

Type: ApiErrorDTO[]

A list of errors.
The general error format.

Min items: 1

status

Type: ApiResponseStatusType

The type of response. Possible values:

  • OK — there are no mistakes.
  • ERROR — an error occurred while processing the request.

Enum: OK, ERROR

420 Method Failure

The resource access limit has been exceeded. More information about the error

Body

application/json
{
    "status": "OK",
    "errors": [
        {
            "code": "string",
            "message": "string"
        }
    ]
}

Name

Description

errors

Type: ApiErrorDTO[]

A list of errors.
The general error format.

Min items: 1

status

Type: ApiResponseStatusType

The type of response. Possible values:

  • OK — there are no mistakes.
  • ERROR — an error occurred while processing the request.

Enum: OK, ERROR

500 Internal Server Error

Internal error of Yandex. Market. More information about the error

Body

application/json
{
    "status": "OK",
    "errors": [
        {
            "code": "string",
            "message": "string"
        }
    ]
}

Name

Description

errors

Type: ApiErrorDTO[]

A list of errors.
The general error format.

Min items: 1

status

Type: ApiResponseStatusType

The type of response. Possible values:

  • OK — there are no mistakes.
  • ERROR — an error occurred while processing the request.

Enum: OK, ERROR

No longer supported, please use an alternative and newer version.