Getting a chat by ID

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 the chat 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}/chat

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

Responses

200 OK

Information about the chat.

Body

application/json
{
    "status": "OK",
    "result": {
        "chatId": 0,
        "orderId": 0,
        "context": {
            "type": "ORDER",
            "orderId": 0,
            "returnId": 0
        },
        "type": "CHAT",
        "status": "NEW",
        "createdAt": "2017-11-21T00:00:00+03:00",
        "updatedAt": "2017-11-21T00:00:00+03:00"
    }
}

Name

Description

result

Type: GetChatInfoDTO

Information about the chat.

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

GetChatInfoDTO

Information about the chat.

Name

Description

chatId*

Type: integer<int64>

The chat ID.

Min value: 1

context*

Type: ChatFullContextDTO

Information about the order or refund for which the chat was started.

createdAt*

Type: string<date-time>

Date and time when the chat was created.

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

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

status*

Type: ChatStatusType

Chat status:

  • NEW — new chat.
  • WAITING_FOR_CUSTOMER — we need a buyer's response.
  • WAITING_FOR_PARTNER — we need the store's response.
  • WAITING_FOR_ARBITER — we need an arbitrator's answer.
  • WAITING_FOR_MARKET — we need a response from Yandex. Market.
  • FINISHED — the chat is over.

Enum: NEW, WAITING_FOR_CUSTOMER, WAITING_FOR_PARTNER, WAITING_FOR_ARBITER, WAITING_FOR_MARKET, FINISHED

type*

Type: ChatType

Chat type:

  • CHAT — chat with the buyer.
  • ARBITRAGE — an argument.

Enum: CHAT, ARBITRAGE

updatedAt*

Type: string<date-time>

The date and time of the last message in the chat.

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

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

orderId

Type: integer<int64>

The order ID.

Min value: 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

ChatFullContextDTO

Information about the order or refund for which the chat was started.

Name

Description

type*

Type: ChatContextType

Chat type:

Enum: ORDER, RETURN, DIRECT

orderId

Type: integer<int64>

The order ID.

It is returned for orders and refunds.

Min value: 1

returnId

Type: integer<int64>

The refund ID.

It is returned only for refunds.

Min value: 1

ChatStatusType

Chat status:

  • NEW — new chat.
  • WAITING_FOR_CUSTOMER — we need a buyer's response.
  • WAITING_FOR_PARTNER — we need the store's response.
  • WAITING_FOR_ARBITER — we need an arbitrator's answer.
  • WAITING_FOR_MARKET — we need a response from Yandex. Market.
  • FINISHED — the chat is over.

Type

Description

ChatStatusType

Enum: NEW, WAITING_FOR_CUSTOMER, WAITING_FOR_PARTNER, WAITING_FOR_ARBITER, WAITING_FOR_MARKET, FINISHED

ChatType

Chat type:

  • CHAT — chat with the buyer.
  • ARBITRAGE — an argument.

Type

Description

ChatType

Enum: CHAT, ARBITRAGE

ChatContextType

Chat type:

Type

Description

ChatContextType

Enum: ORDER, RETURN, DIRECT

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 the 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.