This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Working with Event Monitoring
Overview
The following operations allow you to work with event monitoring in Salesforce. Click an operation name to see details on how to use it.
For a sample proxy service that illustrates how to work with event monitoring, see Sample configuration.Â
Operation | Description |
---|---|
describeEventMonitoring | Retrieves all metadata for an object, including information about fields, URLs, and child relationships. |
queryEventMonitoringData | Retrieves field values from a record. |
Operation details
This section provides further details on the operations related to event monitoring.
Retrieving the event monitoring log description
To retrieve the description of the event monitoring log, use salesforcerest.describeEventMonitoring
.
<salesforcerest.describeEventMonitoring/>
Sample request
Following is a sample REST request that can be handled by the describeEventMonitoring
operation.
{ "accessToken":"00D280000017q6q!AQoAQOeXcp7zKo3gUdy6r064_LsJ5bYYrUn_qAZG9TtKFLPfUMRxiato.E162_2XAtCTZLFQTbNk2Rz6Zm_juSakFE_aaBPp", "apiUrl":"https://ap2.salesforce.com", Â "clientId": "3MVG9ZL0ppGP5UrBztM9gSLYyUe7VwAVhD9.yQnZX2mmCu_48Uwc._doxrBTgY4jqmOSDhxRAiUBf8gCr2mk7", "refreshToken": "5Aep861TSESvWeug_ztpnAk6BGQxRdovMLhHso81iyYKO6hTm45JVxz3FLewCKgI4BbUp19OzGfqG2TdCfqa2ZU", "clientSecret": "1187341468789253319", "hostName": "https://login.salesforce.com", "apiVersion": "v34.0", "intervalTime" : "100000", Â "registryPath": "connectors/SalesforceRest" Â }
Related Salesforce REST documentationÂ
Retrieving field values from a record
To retrieve the field values from a record, use salesforcerest.queryEventMonitoringData
and specify the following properties.
<salesforcerest.queryEventMonitoringData> <queryStringForEventMonitoringData>{$ctx:queryStringForEventMonitoringData}</queryStringForEventMonitoringData> </salesforcerest.queryEventMonitoringData>
Properties
queryStringForEventMonitoringData
: The query string to use to get the field values from the log.
Sample request
Following is a sample REST request that can be handled by the queryEventMonitoringData
 operation.
{ "accessToken":"00D280000017q6q!AQoAQOeXcp7zKo3gUdy6r064_LsJ5bYYrUn_qAZG9TtKFLPfUMRxiato.E162_2XAtCTZLFQTbNk2Rz6Zm_juSakFE_aaBPp", "apiUrl":"https://ap2.salesforce.com", Â "clientId": "3MVG9ZL0ppGP5UrBztM9gSLYyUe7VwAVhD9.yQnZX2mmCu_48Uwc._doxrBTgY4jqmOSDhxRAiUBf8gCr2mk7", "refreshToken": "5Aep861TSESvWeug_ztpnAk6BGQxRdovMLhHso81iyYKO6hTm45JVxz3FLewCKgI4BbUp19OzGfqG2TdCfqa2ZU", "clientSecret": "1187341468789253319", "hostName": "https://login.salesforce.com", "apiVersion": "v34.0", "intervalTime" : "100000", Â "queryStringForEventMonitoringData": "SELECT+Id+,+EventType+,+LogFile+,+LogDate+,+LogFileLength+FROM+EventLogFile+WHERE+LogDate+>+Yesterday+AND+EventType+=+'API'", "registryPath": "connectors/SalesforceRest" Â }
Related Salesforce REST documentationÂ
Sample configuration
Following is a sample proxy service that illustrates how to connect to Salesforce with the init
operation and use the queryEventMonitoringData
 operation. The sample request for this proxy can be found in the queryEventMonitoringData
 sample request.
<proxy xmlns="http://ws.apache.org/ns/synapse" name="queryEventMonitoringData" statistics="disable" trace="disable" transports="https http"> <target> <inSequence> <property name="accessToken" expression="json-eval($.accessToken)"/> <property name="apiUrl" expression="json-eval($.apiUrl)"/> <property name="queryStringForEventMonitoringData" expression="json-eval($.queryStringForEventMonitoringData)"/> <property name="clientId" expression="json-eval($.clientId)"/> <property name="refreshToken" expression="json-eval($.refreshToken)"/> <property name="clientSecret" expression="json-eval($.clientSecret)"/> <property name="hostName" expression="json-eval($.hostName)"/> <property name="apiVersion" expression="json-eval($.apiVersion)"/> <property name="registryPath" expression="json-eval($.registryPath)"/> <property name="intervalTime" expression="json-eval($.intervalTime)"/> <salesforcerest.init> <accessToken>{$ctx:accessToken}</accessToken> <apiUrl>{$ctx:apiUrl}</apiUrl> <apiVersion>{$ctx:apiVersion}</apiVersion> <hostName>{$ctx:hostName}</hostName> <clientSecret>{$ctx:clientSecret}</clientSecret> <clientId>{$ctx:clientId}</clientId> <refreshToken>{$ctx:refreshToken}</refreshToken> <registryPath>{$ctx:registryPath}</registryPath> <intervalTime>{$ctx:intervalTime}</intervalTime> </salesforcerest.init> <log category="INFO" level="full" separator=","/> <salesforcerest.queryEventMonitoringData> <queryStringForEventMonitoringData>{$ctx:queryStringForEventMonitoringData} </queryStringForEventMonitoringData> </salesforcerest.queryEventMonitoringData> <send/> </inSequence> </target> </proxy>