Bird
0
0

You have this response envelope:

medium📝 Debug Q14 of 15
Rest API - Request and Response Format
You have this response envelope:
{"status": "success", "data": {"id": 5}}

What is wrong with this response?
AMissing closing brace for JSON object
BMissing 'message' field in the envelope
CData should be an array, not an object
DStatus should be 'ok' instead of 'success'
Step-by-Step Solution
Solution:
  1. Step 1: Check JSON syntax

    The JSON string ends after "id": 5 without closing the outer object with a brace.
  2. Step 2: Validate required fields

    While 'message' is optional and 'data' can be an object, the missing brace is a syntax error.
  3. Final Answer:

    Missing closing brace for JSON object -> Option A
  4. Quick Check:

    JSON must have matching braces [OK]
Quick Trick: Always check JSON braces for completeness [OK]
Common Mistakes:
  • Assuming 'message' is mandatory
  • Thinking 'data' must be an array
  • Confusing status values

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes