0
0
Rest APIprogramming~10 mins

Webhook payload design in Rest API - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define a webhook payload with an event type.

Rest API
{
  "event": "[1]"
}
Drag options to blanks, or click blank then click option'
Auser.created
Buser_deleted
CupdateUser
Dcreate-user
Attempts:
3 left
💡 Hint
Common Mistakes
Using underscores or camelCase instead of dot notation.
Using vague or unclear event names.
2fill in blank
medium

Complete the code to include a timestamp in ISO 8601 format in the webhook payload.

Rest API
{
  "timestamp": "[1]"
}
Drag options to blanks, or click blank then click option'
A2023-04-01T12:00:00Z
B04/01/2023 12:00
C2023.04.01 12:00:00
D12:00:00 01-04-2023
Attempts:
3 left
💡 Hint
Common Mistakes
Using local date formats instead of ISO 8601.
Omitting the 'T' or 'Z' characters.
3fill in blank
hard

Fix the error in the webhook payload by completing the missing key for user data.

Rest API
{
  "user": [1]
}
Drag options to blanks, or click blank then click option'
A["id", "name"]
B123, "Alice"
C"id:123, name:Alice"
D{"id": 123, "name": "Alice"}
Attempts:
3 left
💡 Hint
Common Mistakes
Using a list instead of an object for user data.
Using a string instead of an object.
4fill in blank
hard

Fill both blanks to add a nested address object with city and zip code.

Rest API
{
  "address": {
    "city": "[1]",
    "zip": "[2]"
  }
}
Drag options to blanks, or click blank then click option'
ANew York
B10001
CLos Angeles
D90001
Attempts:
3 left
💡 Hint
Common Mistakes
Using numbers without quotes for zip code.
Mixing city and zip code values.
5fill in blank
hard

Fill all three blanks to create a payload with event, user id, and active status.

Rest API
{
  "event": "[1]",
  "user": {
    "id": [2],
    "active": [3]
  }
}
Drag options to blanks, or click blank then click option'
Auser.updated
B42
Ctrue
D"user.created"
Attempts:
3 left
💡 Hint
Common Mistakes
Putting quotes inside the blank for event string.
Using string 'true' instead of boolean true.