Create a Custom Channel and Add Real-Time Event Monitoring Events with Tooling API
Create a channel for Real-Time Event Monitoring events named Event_Monitoring_Channel__chn by using the eventType field in PlatformEventChannel. Also, add two Real-Time Event Monitoring events as members: ApiAnomalyEvent and FileEvent.
Before You Begin
User Permissions Needed
To create or update PlatformEventChannel and PlatformEventChannelMember objects:
Customize Application
To use REST API:
API Enabled
To use Real-Time Event Monitoring events:
Salesforce Shield or Event Monitoring add-on subscription and the View Real-Time Event Monitoring Data user permission.
You can use your preferred REST API tool to perform these steps. We recommend using Postman with the Salesforce Platform APIs collection, which contains handy templates for Salesforce API calls. To set up Postman, see Quick Start: Connect Postman to Salesforce in Trailhead.
Create the channel using PlatformEventChannel, set the channelType field to event and the eventType field to monitoring. Send a POST request to this URI.
Add the Order_NorthAmer__e platform event to the channel using PlatformEventChannelMember. The channel member references the channel it’s part of (Order_Channel__chn) through the eventChannel field. Specify the platform event in the selectedEntity field. Send a POST request to this URI.
To subscribe to the channel, see Subscribe to the Channel and use /event/Event_Monitoring_Channel__chn for the TOPIC parameter. After you start the subscription, perform some actions in the Salesforce org to cause some events to be generated. For example, to receive FileEvent events on the channel, download a document.