onCallCreate
When a call originates from a Freshworks number or is being received to a Freshworks number, the onCallCreate event is triggered.
Subscribe to the onCallCreate event and register the callback by using the following sample manifest.json content.
"events": {
"onCallCreate": {
"handler": "onCallCreateCallback"
}
}
Define the corresponding callback by using the following sample server.js content:
exports = {
onCallCreateCallback: function(payload) {
console.log("Logging arguments from onCallCreate event: " + JSON.stringify(payload));
}
}
Attributes of the data object
- actorobject
Information pertaining to the entity that created the call object.
- associationsobject
All objects related to the call object.
For onCallCreate, this value is an empty object.
- callobject
Details pertaining to the call that triggered the onCallCreate event.
onCallUpdate
When a call connection is established or lost, when a call’s status changes (transferred to an agent, an agent barges into a call, the call becomes a conference call, and so on), and when additional information such as call recording information, bill duration, call cost, call notes is associated with a call, the onCallUpdate event is triggered.
Subscribe to the onCallUpdate event and register the callback by using the following sample manifest.json content.
"events": {
"onCallUpdate": {
"handler": "onCallUpdateCallback"
}
}
Define the corresponding callback by using the following sample server.js content:
exports = {
onCallUpdateCallback: function(payload) {
console.log("Logging arguments from onCallUpdate event: " + JSON.stringify(payload));
}
}
Attributes of the data object
- actorobject
Information pertaining to the entity that created the call object.
- associationsobject
All objects related to the call object.
For onCallCreate, this value is an empty object.
- callobject
Details pertaining to the call that triggered the onCallCreate event.
- changesobject
Changes that triggered the onCallUpdate event, specified as a JSON object of the following format:
{ “<call.attribute that changed>”: [“New value”, “Old value”] }
For onCallUpdate, this value is an empty object.