Bird
0
0

Given this JSON payload sent to a webhook registration endpoint:

medium📝 Predict Output Q13 of 15
Rest API - Webhooks and Events

Given this JSON payload sent to a webhook registration endpoint:
{"callback_url": "https://example.com/hook", "event": "order_created"}
What should the server respond if the registration is successful?

A{"status": "success", "message": "Webhook registered"}
B{"error": "Invalid URL"}
C{"status": "failed", "message": "Missing event type"}
D{"status": "success", "message": "Webhook deleted"}
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the input payload

    The payload contains a valid callback URL and an event type, so it should be accepted.
  2. Step 2: Determine expected success response

    On success, the server confirms registration with a success status and message.
  3. Final Answer:

    {"status": "success", "message": "Webhook registered"} -> Option A
  4. Quick Check:

    Valid input = success confirmation [OK]
Quick Trick: Success means status success and confirmation message [OK]
Common Mistakes:
MISTAKES
  • Confusing error messages as success
  • Ignoring missing fields
  • Mixing registration and deletion messages

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes