Bird
0
0

Which of the following is the correct JSON structure to represent partial success in a REST API response?

easy📝 Syntax Q3 of 15
Rest API - Batch and Bulk Operations
Which of the following is the correct JSON structure to represent partial success in a REST API response?
A{"status": "success", "data": []}
B{"results": [{"id": 1, "status": "success"}, {"id": 2, "status": "error"}]}
C{"error": "Partial failure occurred"}
D{"message": "All operations completed"}
Step-by-Step Solution
Solution:
  1. Step 1: Identify JSON format for partial success

    Partial success requires detailed status per item, so an array with individual statuses is needed.
  2. Step 2: Compare options

    {"results": [{"id": 1, "status": "success"}, {"id": 2, "status": "error"}]} shows a list with success and error statuses per item, matching partial success representation.
  3. Final Answer:

    {"results": [{"id": 1, "status": "success"}, {"id": 2, "status": "error"}]} -> Option B
  4. Quick Check:

    Partial success needs per-item status in JSON [OK]
Quick Trick: Use array with status per item for partial success [OK]
Common Mistakes:
MISTAKES
  • Returning only overall success without details
  • Using error message without item info
  • Not using JSON array for multiple results

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes