Key takeaways

  • A JSON formatter and validator indents a raw payload and tells you whether it parses, in one pass.
  • Truncated bodies, unquoted keys, trailing commas and unescaped characters cause most failures.
  • The free AyeTab JSON Formatter checks payloads in the browser, so alert bodies are not uploaded anywhere.

When a webhook fires or an API call returns something odd, the fastest check is a JSON formatter and validator: paste the payload, see it indented, and learn at once whether it parses. AyeTab's free JSON Formatter does both jobs in the browser, so the payload stays on your machine.

Why monitoring work produces so much raw JSON

Anyone who watches services, pages or feeds ends up reading JSON. Alert webhooks post it to your endpoint. Status APIs return it. Exported results come as JSON files. Most of it arrives minified, as one long line, because that is cheaper to send. It is fine for machines and close to unreadable for people.

Two questions usually follow. Is this valid JSON at all, or did something upstream truncate or mangle it? And if it is valid, where is the field I care about? A formatter answers the second by indenting the structure. A validator answers the first by parsing it and flagging the error. Good tools do both in one pass.

A five-minute routine for a suspicious payload

  1. Copy the raw body. Take it from your request log, the webhook inspector or the response pane of your HTTP client. Copy the body only, without headers.
  2. Paste it into the AyeTab JSON Formatter. The page formats and checks it as you paste. If it parses, you get indented JSON. If not, you get an error to look at.
  3. Read the error before you edit. Errors cluster around a few causes, listed in the table below.
  4. Find the field. With the structure indented, nested objects and arrays line up, so you can follow the path to the value your alert or parser expects.
  5. Minify before you send it back. If you need to replay the payload with curl or paste it into a test fixture, the Minify button turns it back into one line.

Common reasons a payload fails

Symptom Likely cause
Error near the very end The body was cut off, often by a size limit or a log truncation
Error at a key name Single quotes or no quotes around the key
Error after the last item A trailing comma, which JSON does not allow
Error at an odd character An unescaped quote or control character inside a string
Parses, but the field is missing The structure changed upstream; compare against an older sample

The last row is the one that bites monitoring setups. The JSON is valid, so nothing errors, but a field moved or was renamed and your rule quietly stops matching. Formatting an old and a new sample side by side makes the change obvious. AyeTab also has a diff checker for comparing the two.

Keep alert payloads off third-party servers

Alert and webhook bodies often carry account IDs, email addresses or tokens. Pasting them into a random formatting site can send that text to the site's server. The AyeTab tool parses everything in your browser tab. Input is not uploaded, there is no account, and the page keeps working offline once it has loaded.

If you check payloads often, the AyeTab extension for Chrome puts the formatter on every new tab and in a side panel, so you can keep it open next to the dashboard you are debugging. Smart paste recognizes a pasted JSON blob and points you to the formatter.

When to use something else

For JSON that lives in a file in your repo, your editor's format command is quicker. For large payloads you want to fold and explore as a tree, a site with a tree view, such as jsonformatter.org, may suit you better. For a pasted body you need to read and check right now, a local browser tool is the shortest path.

Frequently asked questions

Why does my webhook payload say invalid JSON?

The usual causes are a body cut off by a size or log limit, keys in single quotes, a trailing comma or an unescaped character inside a string. A validator shows where parsing stopped.

Can valid JSON still break my alert rule?

Yes. If a field moved or was renamed upstream, the JSON still parses but your rule no longer matches. Format an old and a new sample and compare them.

Is it safe to paste webhook payloads into an online formatter?

Only if the tool runs locally. The AyeTab JSON Formatter parses input in your browser and does not upload it.

Sources

  1. JSON FormatterAyeTab
  2. AyeTabAyeTab
  3. AyeTab developer toolsAyeTab
  4. JSON Formatter and JSON Validatorjsonformatter.org