ErrorsGeneral
HTTP 400General
INVALID_JSON
The request body is not valid JSON.
Typical cause
The body was built by string concatenation, or a shell quoted it wrongly (-d with double quotes around JSON that holds double quotes).
Fix
Send Content-Type: application/json and a well-formed body.
Where it comes from
Any operation can answer it (HTTP 400).
Related
400The envelope
{
"error": {
"code": "INVALID_JSON",
"message": "…",
"request_id": "req_01JB4Z0K3Q7V8W9X0Y1Z2A3B4C",
"doc_url": "https://developers.tracken.ee/errors/INVALID_JSON"
}
}Switch on
code, never on message, which is developer-facing English and may change. Field problems are in details, each with a JSON Pointer; the figures for your own text are in context. Quote request_id when you contact support.Handle it
tracken contacts list …
# exits 9 and prints the code, the message, each field problem and the request idimport { isApiError } from "@tracken/sdk";
try {
await tracken.contacts.list(…);
} catch (error) {
if (!isApiError(error, "INVALID_JSON")) throw error;
// Send Content-Type: application/json and a well-formed body.
}Install the SDK with npm i @tracken/sdk (0.2.0, MIT, beta), Node.js 22 or later.