Dev workflow · 4 checked steps

Debug a JSON API response methodically

Isolate malformed JSON, locate syntax errors, inspect token claims safely, and turn nested response data into a reviewable CSV.

Time neededAbout 10 minutes
Useful forDevelopers, QA engineers, analysts, and anyone inspecting API output
0 of 4 steps completeSaved only on this device
Open each tool in a new tab, then mark the step done when the output is checked.

A blank screen or generic parsing error does not tell you whether the API returned invalid JSON, an unexpected schema, or an authentication problem. Separate those possibilities instead of changing application code at random.

Copy a minimal failing response and remove secrets before sharing it. These checks run locally, but redaction is still important when you later attach examples to tickets or issue trackers.

Validate the payload before reading values

Paste the raw response body exactly as received. If validation fails, fix transport issues such as an HTML error page or truncated body before investigating your data model.

  • Do not paste surrounding log timestamps
  • Check for HTML returned by a proxy or login page
Validate response JSON using JSON Validator (opens in a new tab)
Tool: JSON Validator · Validate your JSON syntax and highlight errors.

Format it to reveal structure

Indent the valid payload and inspect nesting, null values, and arrays with unexpected lengths. Compare the actual keys with the names your application reads, including capitalization.

  • Look for strings where numbers are expected
  • Check whether the payload is wrapped in a data property
Format the payload using JSON Formatter (opens in a new tab)
Tool: JSON Formatter · Format and beautify ugly JSON strings.

Inspect JWT claims when authentication is involved

If the API uses a bearer token, decode it locally to inspect issuer, audience, and expiry claims. Decoding is not signature verification; a readable token is not automatically trustworthy.

  • Compare exp with the current time
  • Never treat client-side decoding as authorization
Inspect token claims using JWT Decoder (opens in a new tab)
Tool: JWT Decoder · Decode JWT header and payload claims, check expiry and verify HS256 signatures.

Export records for comparison

When the issue affects many records, convert a suitable JSON array to CSV. Sort or filter the export in your spreadsheet to spot missing fields and inconsistent values across the response set.

  • Use a representative record set
  • Flattening nested objects may require a simpler input projection
Convert records to CSV using JSON to CSV Converter (opens in a new tab)
Tool: JSON to CSV Converter · Convert JSON data to CSV format.

Mistakes to avoid

Formatting before checking the response type

A formatted HTML error page is still not JSON. Confirm status, content type, and raw body first.

Trusting decoded JWT content

JWT payloads are encoded, not encrypted. Signature validation belongs in the relying service with the correct key and algorithm restrictions.

Posting production secrets publicly

Local processing reduces exposure but does not redact access tokens, personal data, or session identifiers in screenshots and bug reports.

Frequently asked questions

Why does valid JSON still break my application?

Syntax validity and schema compatibility are different. The payload can be valid while containing different keys, types, nesting, or nullability than your code expects.

Can these tools tell me why an API returned 401?

They can help inspect the body and token claims, but the server decides authorization. Also check the request headers, token audience, scopes, clock skew, and environment configuration.

Is it safe to paste tokens into this workflow?

The decoder runs locally, but the safest debugging practice is still to use short-lived test tokens and revoke production credentials that were exposed anywhere.