> 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/ad-placement-api/ad-plac-errors.md).

# Errors

The Ad Placement API can return the following response codes:

| Code | Description    | Explanation                                                                                                                                                         |
| ---- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 400  | Bad Request    | Indicates that the data sent is incorrectly formatted.                                                                                                              |
| 200  | OK             | This indicates that either the request is correct or there are some zones which could not be found. The response will tell you which zones these are.               |
| 500  | Internal Error | Indicates that an internal error happened but the cause is unknown. Contact your Account Manager or [Customer Success](https://www.exoclick.com/contact/) for help. |

## 400 Error Messages

| Message                        | Explanation                                         |
| ------------------------------ | --------------------------------------------------- |
| Malformed JSON Body            | Syntax error                                        |
| Unsupported Request Type       | Wrong request verb used                             |
| This field is missing          | A compulsory field is missing                       |
| This field was not expected    | A non-recognized parameter was added to the request |
| This value should be of type X | Wrong format used for a specific parameter          |

### 400 Error Example

Request:

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

Response:

```json
{
    "errors": [
        {
            "[user][ua]": "This field is missing."
        },
        {
            "[user][testing]": "This field was not expected."
        },
        {
            "[zones][0]": "[id] This value should be of type int."
        }
    ]
}
```

## 200 Error Messages

| Message                | Explanation                                                                                             |
| ---------------------- | ------------------------------------------------------------------------------------------------------- |
| Zone id not found      | The zone id cannot be found OR the domain of the endpoint doesn't correspond to the requested ad format |
| Zone or site not valid | The zone or Publisher is blocked.                                                                       |

### 200 Error Example

In this example, we have requested ads for multiple zones and some of them returned errors.

Request:

```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
        }   
    ]
}
```

Response:

```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": [
            "Zone 1 not found"
        ],
        "2": [
            "Zone 3 not found"
        ]
    }
}
```

## zones.data null

Very rarely, an ad zone request will return a correct response, but the `data` field will be null. This means that the system found no ads to satisfy the given request given user locale, browser etc.


---

# 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/ad-placement-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.
