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. 

OperationDescription
describeEventMonitoringRetrieves all metadata for an object, including information about fields, URLs, and child relationships.
queryEventMonitoringDataRetrieves 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.

describeEventMonitoring
<salesforcerest.describeEventMonitoring/>
Sample request

Following is a sample REST request that can be handled by the describeEventMonitoring operation.

Sample Request to describeEventMonitoring
{
  "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 

https://developer.salesforce.com/docs/atlas.en-us.198.0.api_rest.meta/api_rest/dome_event_log_file_describe.htm

Retrieving field values from a record

To retrieve the field values from a record, use salesforcerest.queryEventMonitoringData and specify the following properties.

queryEventMonitoringData
<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.

Sample Request to queryEventMonitoringData
{
  "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 

https://developer.salesforce.com/docs/atlas.en-us.198.0.api_rest.meta/api_rest/dome_event_log_file_query.htm

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.

Sample Proxy
<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>