Ir al contenido principal
OmneTools
  1. Inicio
  2. /
  3. Blog
  4. /
  5. Herramientas para desarrolladores
  6. /
  7. Cómo depurar una respuesta JSON de una API
Herramientas para desarrolladores

Cómo depurar una respuesta JSON de una API

Distingue errores de transporte y de datos, compara con el contrato de la API y depura sin filtrar secretos.

Cómo depurar una respuesta JSON de una API

Resumen traducido El título, el resumen y la navegación se muestran en tu idioma. La guía completa está disponible actualmente en inglés.

An API response can contain valid JSON and still be wrong for your application. Check the HTTP status, parse the body, validate required fields and remove secrets before sharing a debugging example.

Check the HTTP status

Look at the response status and headers before interpreting the body. A 2xx response usually indicates a successful HTTP request; 4xx and 5xx responses indicate errors. Some APIs return JSON error objects with a non-2xx status, so valid JSON is not proof of success.

Format the body

Format a safe sample to inspect nested objects and arrays. If parsing fails, check quotes, commas, braces and brackets near the reported location. JSON requires double-quoted strings and property names and does not permit comments or trailing commas.

Validate expected fields

A syntactically valid response may omit a required field, return null instead of a string or use a different data type. Compare it with the API schema and handle missing values explicitly. Syntax validation and business-rule validation are separate tasks.

Use safe examples

Remove credentials and private records before sharing a sample in a bug report. Never publish bearer tokens, API keys, session cookies or customer data. Base64 decoding and JWT payload decoding do not prove authenticity or provide encryption.

Make the fix durable

Test the normal response and the failure case that caused the issue. Log enough context to diagnose errors without recording secrets. If an API is versioned, use its documented schema and monitor changes rather than relying on one successful sample.

A short checklist using OmneTools

  1. Copy the response body (with secrets removed) into the JSON Validator. If it fails, the error position tells you where to look.
  2. Format it with the JSON Formatter to see the nesting clearly.
  3. If the response contains a token, paste it into the JWT Decoder to check its expiry time. Expired tokens are one of the most common reasons an API suddenly returns 401.
  4. If a field holds an odd-looking string ending in =, try the Base64 Decoder.
  5. Convert any Unix timestamps with the Timestamp Converter to make sure dates are what you expect.

Última actualización: 21 nov 2026

Prueba la herramienta relacionada

Aplica los pasos anteriores con la herramienta correspondiente. Revisa sus supuestos y límites antes de confiar en el resultado.

Abrir la herramienta

Preguntas frecuentes

What should you know about check the HTTP status?
Look at the response status and headers before interpreting the body. A 2xx response usually indicates a successful HTTP request; 4xx and 5xx responses indicate errors. Some APIs return JSON error objects with a non-2xx status, so valid JSON is not proof of success.
What should you know about format the body?
Format a safe sample to inspect nested objects and arrays. If parsing fails, check quotes, commas, braces and brackets near the reported location. JSON requires double-quoted strings and property names and does not permit comments or trailing commas.
What should you know about validate expected fields?
A syntactically valid response may omit a required field, return null instead of a string or use a different data type. Compare it with the API schema and handle missing values explicitly. Syntax validation and business-rule validation are separate tasks.
What should you know about use safe examples?
Remove credentials and private records before sharing a sample in a bug report. Never publish bearer tokens, API keys, session cookies or customer data. Base64 decoding and JWT payload decoding do not prove authenticity or provide encryption.

Guías relacionadas

← Volver a todas las guías
  1. Inicio
  2. /
  3. Blog
  4. /
  5. Herramientas para desarrolladores
  6. /
  7. Cómo depurar una respuesta JSON de una API
Herramientas para desarrolladores

Cómo depurar una respuesta JSON de una API

Distingue errores de transporte y de datos, compara con el contrato de la API y depura sin filtrar secretos.

Cómo depurar una respuesta JSON de una API

Resumen traducido El título, el resumen y la navegación se muestran en tu idioma. La guía completa está disponible actualmente en inglés.

An API response can contain valid JSON and still be wrong for your application. Check the HTTP status, parse the body, validate required fields and remove secrets before sharing a debugging example.

Check the HTTP status

Look at the response status and headers before interpreting the body. A 2xx response usually indicates a successful HTTP request; 4xx and 5xx responses indicate errors. Some APIs return JSON error objects with a non-2xx status, so valid JSON is not proof of success.

Format the body

Format a safe sample to inspect nested objects and arrays. If parsing fails, check quotes, commas, braces and brackets near the reported location. JSON requires double-quoted strings and property names and does not permit comments or trailing commas.

Validate expected fields

A syntactically valid response may omit a required field, return null instead of a string or use a different data type. Compare it with the API schema and handle missing values explicitly. Syntax validation and business-rule validation are separate tasks.

Use safe examples

Remove credentials and private records before sharing a sample in a bug report. Never publish bearer tokens, API keys, session cookies or customer data. Base64 decoding and JWT payload decoding do not prove authenticity or provide encryption.

Make the fix durable

Test the normal response and the failure case that caused the issue. Log enough context to diagnose errors without recording secrets. If an API is versioned, use its documented schema and monitor changes rather than relying on one successful sample.

A short checklist using OmneTools

  1. Copy the response body (with secrets removed) into the JSON Validator. If it fails, the error position tells you where to look.
  2. Format it with the JSON Formatter to see the nesting clearly.
  3. If the response contains a token, paste it into the JWT Decoder to check its expiry time. Expired tokens are one of the most common reasons an API suddenly returns 401.
  4. If a field holds an odd-looking string ending in =, try the Base64 Decoder.
  5. Convert any Unix timestamps with the Timestamp Converter to make sure dates are what you expect.

Última actualización: 21 nov 2026

Prueba la herramienta relacionada

Aplica los pasos anteriores con la herramienta correspondiente. Revisa sus supuestos y límites antes de confiar en el resultado.

Abrir la herramienta

Preguntas frecuentes

What should you know about check the HTTP status?
Look at the response status and headers before interpreting the body. A 2xx response usually indicates a successful HTTP request; 4xx and 5xx responses indicate errors. Some APIs return JSON error objects with a non-2xx status, so valid JSON is not proof of success.
What should you know about format the body?
Format a safe sample to inspect nested objects and arrays. If parsing fails, check quotes, commas, braces and brackets near the reported location. JSON requires double-quoted strings and property names and does not permit comments or trailing commas.
What should you know about validate expected fields?
A syntactically valid response may omit a required field, return null instead of a string or use a different data type. Compare it with the API schema and handle missing values explicitly. Syntax validation and business-rule validation are separate tasks.
What should you know about use safe examples?
Remove credentials and private records before sharing a sample in a bug report. Never publish bearer tokens, API keys, session cookies or customer data. Base64 decoding and JWT payload decoding do not prove authenticity or provide encryption.

Guías relacionadas

← Volver a todas las guías