Configure onAgentActivityCreate

Marketplace Platform v2.3 deprecation:We’re continuing to improve the Marketplace Platform to deliver stronger security, better performance, and new capabilities. As part of this evolution, Marketplace Platform v2.3 will be deprecated. To learn the dates and next steps, see Migration guide.

Agent activity is a metric that helps supervisors to assess how agents spend their business hours when they are unavailable in the Freshchat system. Your app can respond to changes in the availability of agents through the onAgentActivityCreate event.

The event is triggered and the registered callback method is executed, when:

  • In the Freshchat system, the general availability of an agent changes (from online to offline and vice versa).
  • The agent's Intelliassign status changes.

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

manifest.json
"events": {
  "onAgentActivityCreate": {
    "handler": "onAgentActivityCreateCallback"
  }
}

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

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

Attributes of the data object

  • actorobject

    Information pertaining to the entity who triggered the onAgentActivityCreate event in the Freshchat system.

  • agent_activityobject

    Information pertaining to the agent’s activity.