Configure onAppointmentCreate and onAppointmentUpdate

onAppointmentCreate

When an appointment is created, the onAppointmentCreate event is invoked and the registered callback method is executed.

Subscribe to the onAppointmentCreate event and register the callback by using the following sample manifest.json content.

manifest.json
"events": {
  "onAppointmentCreate": {
    "handler": "onAppointmentCreateCallback"
  }
}

Define the corresponding callback by using the following sample server.js content:

server.js
exports = {
  onAppointmentCreateCallback: function(payload) {
    console.log("Logging arguments from onAppointmentCreate event: " + JSON.stringify(payload));
    }
}

Attributes of the data object

  • actorobject

    Details of the entity that triggered the onAppointmentCreate event.

  • appointmentobject

    Details of the appointment object created when the onAppointmentCreate event is triggered.

  • associationsobject

    Associated objects related to the appointment object.

onAppointmentUpdate

When an appointment is updated, the onAppointmentUpdate event is invoked and the registered callback method is executed.

Subscribe to the onAppointmentUpdate event and register the callback by using the following sample manifest.json content.

manifest.json
"events": {
  "onAppointmentUpdate": {
    "handler": "onAppointmentUpdateCallback"
  }
}

Define the corresponding callback by using the following sample server.js content:

server.js
exports = {
  onAppointmentUpdateCallback: function(payload) {
    console.log("Logging arguments from onAppointmentUpdate event: " + JSON.stringify(payload));
    }
}

Attributes of the data object

  • actorobject

    Details of the entity that triggered the onAppointmentCreate event.

  • appointmentobject

    Details of the appointment object created when the onAppointmentCreate event is triggered.

  • associationsobject

    Associated objects related to the appointment object.

  • changesobject

    Changes that triggered the onAppointmentUpdate specified as a JSON object of the following format:

    {
      "model_changes": {
        "<appointment.attribute that changed>": ["Old value", "New value"]
      }
    }

    Example

    {
      "misc_changes": {},
      "model_changes": {
        "title": [
          "Sample Appointment",
          "Updated Appointment"
        ],
        "updater_id": [
          39897,
          null
        ]
      },
      "system_changes": {}
    }