创建与客户的新聊天
方法适用于所有模式.
如果您使用API-Key令牌,调用该方法时需要具备列表中可用权限之一
- communication — 与买家沟通
 - all-methods — 全面管理账户
 
创建与客户的新聊天并返回有关他或以前创建的客户的信息。
卖家可以开始的聊天类型:
- 奉命行事;
 - 退款(只适用于 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。 要找到答案,请使用请求 GET v2/campaigns. Min value:   | 
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:   | 
| 
 type*  | 
 Type: ChatContextIdentifiableType 聊天类型: 
 有关订单和退款聊天的更多信息,请参阅 燕基科斯.对卖家的市场帮助. Enum:   | 
ChatContextIdentifiableType
聊天类型:
ORDER— 奉命行事。RETURN— 关于退款(FBY, FBS 和 Express).
有关订单和退款聊天的更多信息,请参阅 燕基科斯.对卖家的市场帮助.
| 
 Type  | 
 Description  | 
| 
 Enum:   | 
Responses
200 OK
有关新聊天或以前创建的聊天的信息。
Body
application/json
{
    "status": "OK",
    "result": {
        "chatId": 0
    }
}
        
    | 
 Name  | 
 Description  | 
| 
 status*  | 
 Type: ApiResponseStatusType 响应的类型。 可能的值: 
 Enum:   | 
| 
 result  | 
 Type: CreateChatResultDTO 有关创建的聊天的信息。  | 
ApiResponseStatusType
响应的类型。 可能的值:
OK— 没有错误。ERROR— 处理请求时出错。
| 
 Type  | 
 Description  | 
| 
 Enum:   | 
CreateChatResultDTO
有关创建的聊天的信息。
| 
 Name  | 
 Description  | 
| 
 chatId*  | 
 Type: integer<int64> 的聊天ID。 Min value:   | 
400 Bad Request
请求包含不正确的数据。 有关错误的更多信息
Body
application/json
{
    "status": "OK",
    "errors": [
        {
            "code": "string",
            "message": "string"
        }
    ]
}
        
    | 
 Name  | 
 Description  | 
| 
 errors  | 
 Type: ApiErrorDTO[] 错误列表。 Min items:   | 
| 
 status  | 
 Type: ApiResponseStatusType 响应的类型。 可能的值: 
 Enum:   | 
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:   | 
| 
 status  | 
 Type: ApiResponseStatusType 响应的类型。 可能的值: 
 Enum:   | 
403 Forbidden
授权数据不正确或禁止访问资源。 有关错误的更多信息
Body
application/json
{
    "status": "OK",
    "errors": [
        {
            "code": "string",
            "message": "string"
        }
    ]
}
        
    | 
 Name  | 
 Description  | 
| 
 errors  | 
 Type: ApiErrorDTO[] 错误列表。 Min items:   | 
| 
 status  | 
 Type: ApiResponseStatusType 响应的类型。 可能的值: 
 Enum:   | 
404 Not Found
找不到请求的资源。 有关错误的更多信息
Body
application/json
{
    "status": "OK",
    "errors": [
        {
            "code": "string",
            "message": "string"
        }
    ]
}
        
    | 
 Name  | 
 Description  | 
| 
 errors  | 
 Type: ApiErrorDTO[] 错误列表。 Min items:   | 
| 
 status  | 
 Type: ApiResponseStatusType 响应的类型。 可能的值: 
 Enum:   | 
420 Method Failure
已超出资源访问限制。 有关错误的更多信息
Body
application/json
{
    "status": "OK",
    "errors": [
        {
            "code": "string",
            "message": "string"
        }
    ]
}
        
    | 
 Name  | 
 Description  | 
| 
 errors  | 
 Type: ApiErrorDTO[] 错误列表。 Min items:   | 
| 
 status  | 
 Type: ApiResponseStatusType 响应的类型。 可能的值: 
 Enum:   | 
500 Internal Server Error
市场的内部错误。 有关错误的更多信息
Body
application/json
{
    "status": "OK",
    "errors": [
        {
            "code": "string",
            "message": "string"
        }
    ]
}
        
    | 
 Name  | 
 Description  | 
| 
 errors  | 
 Type: ApiErrorDTO[] 错误列表。 Min items:   | 
| 
 status  | 
 Type: ApiResponseStatusType 响应的类型。 可能的值: 
 Enum:   | 
No longer supported, please use an alternative and newer version.