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

Publié presque 2 ans il y a par  Angélique Bernardo

Publier un sujet
  • Sujet épinglé
A
Angélique Bernardo Administrateur

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"
  ],
  "name": "Watcher name",
  "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"
}


0 Votes


0 Commentaires

Connexion ou S'inscrire pour poster un commentaire