bad_json
- HTTP status
- 400 Bad Request
- Returned by
- adspend; Analytics; booking; Import and export; forms; Every endpoint (request handling); Conversations, messages and channels; Integrations; Error reporting from the Kweko apps; Tasks, notes and the timeline
What it means
The request body could not be read as the JSON this endpoint expects.
Typical causes
- The body is empty, or not JSON at all (a form body, or a missing
Content-Type: application/jsonon a tool that then sends form data). - A value has the wrong type, for example
"amount": "100"instead of a number.fieldsnames it. - There is data after the JSON value (two objects in one body).
How to fix it
- Send exactly one JSON object. Numbers are JSON numbers, not strings.
Messages
English text, as sent with Accept-Language: en. With ru or uz the API sends the translation.
- A field has the wrong type.
RU: У поля неверный тип.
UZ: Maydon turi notoʻgʻri. - The request body could not be read.
RU: Не удалось прочитать тело запроса.
UZ: Soʻrov tanasini oʻqib boʻlmadi. - The request body has data after the JSON value.
RU: В теле запроса есть данные после JSON.
UZ: Soʻrov tanasida JSON dan keyin ortiqcha maʼlumot bor. - The request body is empty; send a JSON object.
RU: Тело запроса пустое. Отправьте JSON-объект.
UZ: Soʻrov tanasi boʻsh. JSON obyekt yuboring. - The request body is not valid JSON (at byte …).
RU: Тело запроса не является корректным JSON (байт …).
UZ: Soʻrov tanasi toʻgʻri JSON emas (…-bayt). - The request body is not valid JSON.
RU: Тело запроса не является корректным JSON.
UZ: Soʻrov tanasi toʻgʻri JSON emas. - The request body is not valid JSON: …
RU: Тело запроса не является корректным JSON: …
UZ: Soʻrov tanasi toʻgʻri JSON emas: … - Unknown field: …
RU: Неизвестное поле: …
UZ: Nomaʼlum maydon: …
Example response
Response
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8
X-Request-Id: req_4f2a9c1e0b7d3a55
{
"error": {
"code": "bad_json",
"message": "A field has the wrong type.",
"request_id": "req_4f2a9c1e0b7d3a55",
"docs_url": "https://developers.kweko.uz/errors/bad_json",
"fields": {
"amount": "must be int64"
}
}
}