Consider a REST API endpoint that accepts a JSON array of user objects for bulk import. The server responds with a summary JSON object showing how many users were successfully imported and how many failed.
Given the following server response after sending 5 user objects, what is the output?
{
"imported": 4,
"failed": 1,
"errors": [
{"index": 3, "message": "Email already exists"}
]
}Look carefully at the numbers and error details in the JSON response.
The server response shows 4 users imported successfully and 1 failed with an error at index 3. This matches option A exactly.
You want to design a REST API endpoint that allows clients to export large amounts of data in bulk. Which HTTP method should you use?
Think about which method is used to retrieve data without changing server state.
GET is the standard HTTP method to retrieve data. For bulk export, clients request data without modifying it, so GET is appropriate.
Here is a JSON payload sent to a bulk import API:
[{"id":1,"name":"Alice"},{"id":2,"name":"Bob"}, {"id":3,"name":null}]The server responds with HTTP 400 Bad Request. What is the most likely cause?
Check the data values carefully for required fields.
The 'name' field is likely required and cannot be null. This causes the server to reject the request with 400.
You want to request a bulk export with filters on user status and creation date. Which JSON payload is syntactically correct?
Remember JSON requires double quotes around keys and string values, and uses colons, not arrows.
Option D uses correct JSON syntax with double quotes and colons. Options A, B, and C have syntax errors.
An API accepts a bulk import POST request with this JSON payload:
[{"id":1,"email":"a@example.com"},{"id":2,"email":"b@example.com"},{"id":3,"email":"a@example.com"},{"id":4,"email":"d@example.com"}]The API rejects duplicates by email and skips them silently. How many user records will be created?
Count unique emails only, duplicates are skipped.
Emails are: a@example.com (twice), b@example.com, d@example.com. The duplicate 'a@example.com' is skipped once, so 3 unique users are created.