---
metadata:
  - name: generator
    content: Diplodoc Platform v5.55.0
alternate:
  - https://yandex.com/dev/market/partner-api/doc/en/concepts/method-call.md
  - https://yandex.com/dev/market/partner-api/doc/ru/concepts/method-call.md
  - https://yandex.com/dev/market/partner-api/doc/zh/concepts/method-call.md
  - href: zh/concepts/method-call.md
    type: text/markdown
    title: Markdown version
  - href: ../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/market/partner-api/doc/zh/llms.txt

# 调用方法

要求 Yandex Market API 通过HTTPS传输，超时 — 10秒，保活不支持。

```no-highlight translate=no
<http_method> https://api.partner.market.yandex.ru/<version>/<resource>.<format>?<query_parameters>
```

哪里:
- `<http_method>` ― DELETE, GET, POST 或 PUT.
- `<version>` -具体方法的版本（v1，v2，v3，。..).
  - 不同方法的版本是独立的。
  - 此方法的页面上列出了当前版本。
  - 版本在路径中指定 URL 这是强制性的。

    {% note warning "如果您以前没有这样做，请务必指定版本。" %}

    我们很快就会禁用在不指定版本的情况下处理查询的功能。

    {% endnote %}

- `<resource>` ― URL 正在执行操作的资源。 资源的名称在相应方法的描述中给出。

    路径参数传递到这里 — 根据商店或橱柜的不同而不同的数据。

    {% cut "例子：" %}

    ```no-highlight translate=no
    https://api.partner.market.yandex.ru/v2/campaigns/{campaignId}
    ```

    `/{campaignId}` — 指定营销活动ID的路径参数。

    {% endcut %}

- `<format>` -这是影响响应呈现方式的请求的可选部分。 响应格式可以在HTTP标头中指定。 `Accept`. 数据以JSON格式传输。 每种方法的描述都包含请求和响应的示例。
- `<query_parameters>` -必需和可选的请求参数。

    这是传输密钥及其值的地方，这是精炼请求，过滤和排序传入信息以及分页所需的。

    请求参数与 URL 使用问号，键值对之间使用＆符号（＆）。

    {% cut "例子：" %}

    ```no-highlight translate=no
    https://api.partner.market.yandex.ru/v2/reports/shows-sales/generate?format=CSV
    ```

    `?格式=CSV` — 请求参数。

    {% endcut %}

**对于Yandex Go市场的卖家:** 也阅读 [指示说明](https://yandex.com/dev/market/partner-api/doc/zh/market-yandex-go-sellers.md#method-call).

如果发生错误，则停止处理请求并返回有关请求的信息。 [错误的类型以及如何处理它们](https://yandex.com/dev/market/partner-api/doc/zh/concepts/error-codes.md)


### 方法版本控制的工作原理 {#how-versioning-works}

版本是指特定的方法。 不同的方法可能具有不同的当前版本（例如，一个 — v1，其他 — v3)。

#### 不同版本中相同方法的示例

```no-highlight translate=no
GET https://api.partner.market.yandex.ru/v1/campaigns
GET https://api.partner.market.yandex.ru/v2/campaigns
```

这里 `v1` 和 `v2` — 相同方法的版本 `.../campaigns`. 它们在字段、验证规则和可用参数的组成上可能不同。

{% note info "注" %}

方法版本 `GET /v1/campaigns` 从支持中删除，不可用。

{% endnote %}

#### 如何选择和修复版本

- 在文档中打开所需方法的页面 — 它显示当前版本和以前版本的状态。
- 修复客户端中的特定版本和 URL （不要使用"默认最新"）。
- 在方法页面上跟踪有关新版本的公告，并计划停用旧版本。

#### 版本之间的迁移

1. 检查方法页面上的更改（添加/更改/删除的内容）。
2. 更新新版本的请求/响应架构和参数。
3. 测试您的更改。
4. 将版本切换到 URL 到一个新的。
5. 监控错误和指标；如有必要，请暂时切换回以前的版本。

#### 常见问题

- 如果指定不存在的版本，会发生什么？
  — 错误将返回 [`404 Not Found`](https://yandex.com/dev/market/partner-api/doc/zh/concepts/error-codes.md#404). 指定小写字母 `v`,大写字母 `V` 它也会导致错误。 `404`.
- 在哪里可以看到当前正在使用的版本？
  — 在 URL 你的要求：细分 `v1`/`v2`/`v3` 在路上。
- 所有方法的版本是否一次更改？
  — 非也。. 每种方法都是独立版本化的。
