A webhook payload is the information sent from one app to another when something happens. Designing it well helps apps understand and use the data easily.
When you want to notify another app instantly about an event, like a new user signup.
When you need to send data updates from your app to a partner app automatically.
When you want to trigger actions in another system based on your app's events.
When building integrations that rely on real-time data exchange between services.
The payload ends without a closing brace '}' for the outermost JSON object, making it invalid JSON.
Step 2: Verify other parts
Timestamp format is ISO 8601 and correct. Event name is correctly outside data. Payment ID can be number or string depending on design.
Final Answer:
Missing closing brace for the JSON object -> Option D
Quick Check:
JSON must have matching braces [OK]
Hint: Always check for matching braces in JSON payloads [OK]
Common Mistakes:
Ignoring missing braces
Assuming timestamp format is wrong
Thinking event must be inside data
5. You want to design a webhook payload for a "user_deleted" event that includes the user ID and deletion reason. Which JSON payload design is best for clarity and easy parsing?
hard
A. { "event": "user_deleted", "timestamp": "2024-06-01T17:00:00Z", "data": { "user_id": 456, "reason": "requested by user" } }
B. { "user_deleted": true, "user": 456, "reason": "requested by user" }
C. { "event": "user_deleted", "user_id": 456, "reason": "requested by user" }
D. { "event": "user_deleted", "timestamp": "2024-06-01T17:00:00Z", "user": { "id": 456, "reason": "requested by user" } }
Solution
Step 1: Check for standard webhook fields
{ "event": "user_deleted", "timestamp": "2024-06-01T17:00:00Z", "data": { "user_id": 456, "reason": "requested by user" } } includes event name, timestamp, and a nested data object holding user_id and reason, which is clear and standard.
Step 2: Compare other options for clarity and parsing
{ "user_deleted": true, "user": 456, "reason": "requested by user" } lacks event and timestamp keys properly named. { "event": "user_deleted", "user_id": 456, "reason": "requested by user" } mixes data fields at root level, less organized. { "event": "user_deleted", "timestamp": "2024-06-01T17:00:00Z", "user": { "id": 456, "reason": "requested by user" } } nests reason inside user object, which is less intuitive.
Final Answer:
{ "event": "user_deleted", "timestamp": "2024-06-01T17:00:00Z", "data": { "user_id": 456, "reason": "requested by user" } } -> Option A
Quick Check:
Standard event + timestamp + data object = { "event": "user_deleted", "timestamp": "2024-06-01T17:00:00Z", "data": { "user_id": 456, "reason": "requested by user" } } [OK]
Hint: Use event, timestamp, and data object for clear payloads [OK]
Common Mistakes:
Omitting timestamp
Mixing data fields at root level
Nesting unrelated fields inside user
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.