创建与客户的新聊天

方法适用于所有模式.

如果您使用API-Key令牌,调用该方法时需要具备列表中可用权限之一

创建与客户的新聊天并返回有关他或以前创建的客户的信息。

卖家可以开始的聊天类型:

  • 奉命行事;
  • 对于退款(仅适用于FBY,FBS和Express商店)。
**⚙️ 限制:**每小时1,000个请求

Request

POST

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

Path parameters

Name

Description

businessId*

Type: integer<int64>

内阁ID。 要找到答案,请使用请求 :no-translate[GET v2/campaigns].

ℹ️ 什么是市场上的橱柜和商店?

Min value: 1

Body

application/json
{
    "orderId": 0,
    "context": {
        "type": "ORDER",
        "id": 0
    }
}

Name

Description

context

Type: ChatContextDTO

有关开始聊天的订单或退款的信息。

orderId

Type: integer<int64>

市场上的订单ID。

ChatContextDTO

有关开始聊天的订单或退款的信息。

Name

Description

id*

Type: integer<int64>

订单或退款ID。

Min value: 1

type*

Type: ChatContextIdentifiableType

聊天类型:

  • ORDER -奉命行事。
  • RETURN -退款(FBY, FBS 和快递)。

有关订单和退款聊天的更多信息,请参阅 燕基科斯.对卖家的市场帮助.

Enum: ORDER, RETURN

ChatContextIdentifiableType

聊天类型:

  • ORDER -奉命行事。
  • RETURN -退款(FBY, FBS 和快递)。

有关订单和退款聊天的更多信息,请参阅 燕基科斯.对卖家的市场帮助.

Type

Description

ChatContextIdentifiableType

Enum: ORDER, RETURN

Responses

200 OK

有关新聊天或以前创建的聊天的信息。

Body

application/json
{
    "status": "OK",
    "result": {
        "chatId": 0
    }
}

Name

Description

status*

Type: ApiResponseStatusType

响应的类型。 可能的值:

  • OK -没有错误。
  • ERROR -处理请求时发生错误。

Enum: OK, ERROR

result

Type: CreateChatResultDTO

有关创建的聊天的信息。

ApiResponseStatusType

响应的类型。 可能的值:

  • OK -没有错误。
  • ERROR -处理请求时发生错误。

Type

Description

ApiResponseStatusType

Enum: OK, ERROR

CreateChatResultDTO

有关创建的聊天的信息。

Name

Description

chatId*

Type: integer<int64>

的聊天ID。

Min value: 1

400 Bad Request

请求包含不正确的数据。 有关错误的更多信息

Body

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

Name

Description

errors

Type: ApiErrorDTO[]

错误列表。
一般错误格式。

Min items: 1

status

Type: ApiResponseStatusType

响应的类型。 可能的值:

  • OK -没有错误。
  • ERROR -处理请求时发生错误。

Enum: OK, ERROR

ApiErrorDTO

一般错误格式。

Name

Description

code*

Type: string

的错误代码。

message

Type: string

错误的描述。

401 Unauthorized

请求中未指定授权数据。 有关错误的更多信息

Body

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

Name

Description

errors

Type: ApiErrorDTO[]

错误列表。
一般错误格式。

Min items: 1

status

Type: ApiResponseStatusType

响应的类型。 可能的值:

  • OK -没有错误。
  • ERROR -处理请求时发生错误。

Enum: OK, ERROR

403 Forbidden

授权数据不正确或禁止访问资源。 有关错误的更多信息

Body

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

Name

Description

errors

Type: ApiErrorDTO[]

错误列表。
一般错误格式。

Min items: 1

status

Type: ApiResponseStatusType

响应的类型。 可能的值:

  • OK -没有错误。
  • ERROR -处理请求时发生错误。

Enum: OK, ERROR

404 Not Found

找不到请求的资源。 有关错误的更多信息

Body

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

Name

Description

errors

Type: ApiErrorDTO[]

错误列表。
一般错误格式。

Min items: 1

status

Type: ApiResponseStatusType

响应的类型。 可能的值:

  • OK -没有错误。
  • ERROR -处理请求时发生错误。

Enum: OK, ERROR

420 Method Failure

已超出资源访问限制。 有关错误的更多信息

Body

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

Name

Description

errors

Type: ApiErrorDTO[]

错误列表。
一般错误格式。

Min items: 1

status

Type: ApiResponseStatusType

响应的类型。 可能的值:

  • OK -没有错误。
  • ERROR -处理请求时发生错误。

Enum: OK, ERROR

500 Internal Server Error

Yandex的内部错误。 市场。 有关错误的更多信息

Body

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

Name

Description

errors

Type: ApiErrorDTO[]

错误列表。
一般错误格式。

Min items: 1

status

Type: ApiResponseStatusType

响应的类型。 可能的值:

  • OK -没有错误。
  • ERROR -处理请求时发生错误。

Enum: OK, ERROR

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

上一篇
下一篇