onAgentCreate
When an agent is created in the Freshworks system, the onAgentCreate event is triggered and the registered callback method is executed.
Subscribe to the onAgentCreate event and register the callback by using the following sample manifest.json content.
"events": {
"onAgentCreate": {
"handler": "onAgentCreateCallback"
}
}
Define the corresponding callback by using the following sample server.js content:
exports = {
onAgentCreateCallback: function(payload) {
console.log("Logging arguments from onAgentCreate event: " + JSON.stringify(payload));
}
}
Attributes of the data object
- actorobject
Information pertaining to the entity who triggered the onAgentCreate event in the Freshdesk system.
- agentobject
Information pertaining to an agent in the Freshdesk system.
- associationsobject
All associated objects of the agent object, that specify additional information pertaining to the agent.
onAgentUpdate
The onAgentUpdate event is triggered and the registered callback method is executed, when:
- The following fields of the agent details are modified:
- Agent type
- Name
- Time zone
- Language
- Signature
- Scope (ticket_permissions)
- Role (privileges)
- An agent’s status is modified.
- An agent logs into or logs off from the Freshdesk system; the general availability of the agent changes (from online to offline and vice versa).
Subscribe to the onAgentUpdate event and register the callback by using the following sample manifest.json content.
"events": {
"onAgentUpdate": {
"handler": "onAgentUpdateCallback"
}
}
Define the corresponding callback by using the following sample server.js content:
exports = {
onAgentUpdateCallback: function(payload) {
console.log("Logging arguments from onAgentUpdate event: " + JSON.stringify(payload));
}
}
Attributes of the data object
- actorobject
Information pertaining to the entity who triggered the onAgentUpdate event in the Freshdesk system.
- agentobject
Information pertaining to an agent whose details are modified in the Freshdesk system.
- associationsobject
All associated objects of the agent object, that specify additional information pertaining to the agent.
- changesobject
Changes that triggered the onAgentUpdate event, specified as a JSON object of the following format:
{ "model_changes": { //For non-array attributes "<agent.attribute that changed>": ["Old value", "New value"] }, "system_changes": {}, "misc_changes": {} }
Example
{ "model_changes": { "signature_html": ["<div>agent signature</div>", "<div> updated agent signature</div>"] }, "system_changes": {}, "misc_changes": {} }
onAgentDelete
When an agent record is deleted from the Freshworks system, the onAgentDelete event is triggered.
Subscribe to the onAgentDelete event and register the callback by using the following sample manifest.json content.
"events": {
"onAgentDelete": {
"handler": "onAgentDeleteCallback"
}
}
Define the corresponding callback by using the following sample server.js content:
exports = {
onAgentDeleteCallback: function(payload) {
console.log("Logging arguments from onAgentDelete event: " + JSON.stringify(payload));
}
}
Attributes of the data object
- actorobject
Information pertaining to the entity who triggered the onAgentDelete event in the Freshdesk system.
- agentobject
Information pertaining to an agent whose details are deleted in the Freshdesk system.
- associationsobject
All associated objects of the agent object, that specify additional information pertaining to the agent.