Example
Format a JSON API Response for Debugging
A JSON formatting example for turning compact API output into readable structure while redacting sensitive fields.
The situation
A developer receives a compact API response in a support ticket. The response is valid JSON, but it is hard to read and includes an access token that should be removed before sharing.
Compact JSON input
{"status":"ok","user":{"id":42,"email":"[email protected]"},"token":"redact-this-before-sharing","events":[{"type":"login","ts":1784371200},{"type":"export","ts":1784374800}]}
Workflow
- Paste the full JSON value into JSON Formatter.
- Format it to reveal the nested user object and events array.
- Remove or replace sensitive values such as tokens, emails, and internal IDs before sharing.
- Use Timestamp Converter for Unix timestamp fields if the event timeline matters.
- Minify the redacted JSON only if the receiving system needs compact text.
Readable redacted JSON
{
"status": "ok",
"user": {
"id": 42,
"email": "[redacted]"
},
"token": "[redacted]",
"events": [
{
"type": "login",
"ts": 1784371200
},
{
"type": "export",
"ts": 1784374800
}
]
}
Review checks
- Formatting improves readability but does not prove business correctness.
- Redaction should happen before JSON is pasted into public tickets or chats.
- Timestamp fields need separate timezone review when building an incident timeline.