> For the complete documentation index, see [llms.txt](https://docs.exoclick.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.exoclick.com/api/zh/guang-gao-tou-fang-api/ad-plac-errors.md).

# 错误

广告位投放 API 可以返回以下响应代码：

| 代码  | 描述   | 说明                                                                         |
| --- | ---- | -------------------------------------------------------------------------- |
| 400 | 错误请求 | 表示发送的数据格式不正确。                                                              |
| 200 | 成功   | 这表示请求正确，或者有一些无法找到的广告位。响应会告诉你这些是哪些广告位。                                      |
| 500 | 内部错误 | 表示发生了内部错误，但原因未知。请联系您的客户经理或 [客户成功](https://www.exoclick.com/contact/) 寻求帮助。 |

## 400 错误消息

| 消息          | 说明            |
| ----------- | ------------- |
| JSON 正文格式错误 | 语法错误          |
| 不支持的请求类型    | 使用了错误的请求动词    |
| 此字段缺失       | 缺少必填字段        |
| 未预期此字段      | 请求中添加了无法识别的参数 |
| 此值应为 X 类型   | 特定参数使用了错误的格式  |

### 400 错误示例

请求：

```json
{
    "user": {
        "testing": false
    },
    "zones": [
        {
            "id": "12345"
        }
    ]
}
```

响应：

```json
{
    "errors": [
        {
            "[user][ua]": "此字段缺失。"
        },
        {
            "[user][testing]": "此字段未预期。"
        },
        {
            "[zones][0]": "[id] 此值应为 int 类型。"
        }
    ]
}
```

## 200 错误消息

| 消息        | 说明                             |
| --------- | ------------------------------ |
| 未找到广告位 ID | 无法找到广告位 ID，或者端点的域名与所请求的广告格式不匹配 |
| 广告位或站点无效  | 该广告位或发布者已被屏蔽。                  |

### 200 错误示例

在此示例中，我们请求了多个广告位的广告，其中一些返回了错误。

请求：

```json
{
    "user": {
        "ip": "179.127.135.233",
        "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:81.0) Gecko/20100101 Firefox/81.0"
    },
    "zones": [
        {
            "id": 1
        },
        {
            "id": 2
        },
        {
            "id": 3
        }   
    ]
}
```

响应：

```json
{
    "zones": [
        null,
        {
            "idzone": 2,
            "type": "banner",
            "data": {
                "url": "https://main.example.rocks/click.php?data=H4sIAAAAAAAAA0WPO27DQAxEr.LG7YK__bBMk8ZFzrArrZAiQQLYgFzM4UNZRUCCIMjhw_ACI69SHNYIn4_H7_2qb1d5j9z3Pc1nX.9p.fkGQAAXUvGj4n_D1RNLTaw5iSpgVoQbcbCV2CsytZgyNACBCZASPSUTOAIsSQ1qlFsOVWXeNKDDZ1cuS56j5o1Gtz7K1BonhPHVI09nB_GC1_gMtcwcTl4dHd8dIqdT2k6h4eOG5kK1.7Kts.ncyuijs64unlerZf4BvX2zxCABAAA-",
                "impression": "https://syndication.example.rocks/cimp.php?t=imp&api=1&data=H4sIAAAAAAAAAzVPSW4DMQz7Sj8wBrV5ya1FX9CiD7An9qlFD73MQY+PkmlEG5ZMwqQZjI2wMb0QLpovKk6lJeKSSCyxiL99vLqSz6Nf/9L+++MqrFKeRy3aqrlCQK24oUbfCufmqpmpgpyyiyMgCqsWr8WQtHqBf32+P3aonF2Agw3R320pRJyQyBtc4xJHUJxEvRAtiaijzS6Ud5uj2MLo2keekevuMb57rEdonEj4p54QNaL45UbngHvwKPiDjqqnPPKpwstqmHNera9OZe053DCHrdGXGPUbbttiKlIBAAA=",
                "image": "https://static.example.rocks/library/432437/42ec0144a74a1663f2973ad3070234f8e5633855.jpg"
            }
        },
        null
    ],
    "errors": {
        "0": [
            "未找到广告位 1"
        ],
        "2": [
            "未找到广告位 3"
        ]
    }
}
```

## zones.data 为 null

极少数情况下，广告位请求会返回正确响应，但 `data` 该字段将为 null。这意味着系统未找到任何可满足给定请求的广告，考虑到用户地区、浏览器等因素。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.exoclick.com/api/zh/guang-gao-tou-fang-api/ad-plac-errors.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
