将文件发送到聊天

方法适用于所有模式.

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

将文件发送到与买家的聊天。

**⚙️ 限制:**每小时1,000个请求

Request

POST

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

Path parameters

Name

Description

businessId*

Type: integer<int64>

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

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

Min value: 1

Query parameters

Name

Description

chatId*

Type: integer<int64>

的聊天ID。

Min value: 1

Body

multipart/form-data
{
    "file": null
}

Name

Description

file*

Type: string<binary>

文件的内容。 最大文件大小为5MB。

Responses

200 OK

一个空洞的答案。 表示文件已发送。

Body

application/json
{
    "status": "OK"
}

Name

Description

status*

Type: ApiResponseStatusType

响应的类型。 可能的值:

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

Enum: OK, ERROR

ApiResponseStatusType

响应的类型。 可能的值:

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

Type

Description

ApiResponseStatusType

Enum: OK, ERROR

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.

上一篇