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.
"events": {
"onAppointmentCreate": {
"handler": "onAppointmentCreateCallback"
}
}
Define the corresponding callback by using the following sample server.js content:
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.
"events": {
"onAppointmentUpdate": {
"handler": "onAppointmentUpdateCallback"
}
}
Define the corresponding callback by using the following sample server.js content:
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": {} }