Start a new topic

API | How to create an API watcher and define its schema to meet your requirements

You can apply a specific template to the JSON format of your API watcher to map the data to the JSON properties of your endpoint. You can even use jsonpath expressions to map data to the target schema (checkout the example provided along our Appointments watcher).


Here is an example of a template applied to an Appointments event watcher (creation or update): 


{
  "address": "https://webhook.site/xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
  "events": [
    "updated", "created"
  ],
  "schema": {
    "id": "${$.id}",
    "staff": "${$.staff.firstName} ${$.staff.lastName}",
    "firstName": "${$.client.firstName}",
    "lastName": "${$.client.lastName}",
    "email": "${$.client.email}",
    "phone": "${$.client.phone}",
    "datetime": {
      "start": "${$.start.dateTime}",
      "end": "${$.end.dateTime}"
    },
    "appointment": "${$.service.name}"
  },
  "addPreviousData": "false"
}


Login or Signup to post a comment