Parameters
NameTypeDescription
eventobject

Contains information of the event. It has the following structure:

{
  "type": "PLUGIN",
  "date": 1486673333420,
  "plugin": "sample",
  "event": "event1",
  "callback": "callback1",
  "data": {
    "originalMessage": {
      "companyId": "ABC"
    },
    "callbackData": {
      "number": 1234,
      "text": "hello"
    }
  }
}

date is the timestamp when the event was sent.

plugin is the name of the plugin.

event is the name of the event.

callback is the name of the callback.

data is data sent by the callback request.

Samples
 
//logs the data sent by the plugin
sys.logs.info('*** PLUGIN: '+event.plugin);
sys.logs.info('*** DATA: '+event.data);