Step 1: Create ManagedEventSubscription with Tooling API
Step 2: Start the Managed Subscription
Step 3: Publish Events and Verify the Managed Subscription
Code Examples
Create a managed subscription configuration for Order_Event__e.
Prerequisites
Order_Event__e platform event by following the steps in Step 1: Define a Platform Event in the main Java quick start.Send a POST request to this REST endpoint: /services/data/v61.0/tooling/sobjects/ManagedEventSubscription
If you’re using Postman, in the Salesforce Platform APIs collection, expand Event Platform and Managed Event Subscriptions, and then click Create managed event subscription. If you don’t find the Managed Event Subscriptions folder, refresh the collection. Click View more actions (…) next to the collection name, click Pull changes, and in the new tab, click Pull Changes.
Use this request body.
1{
2 "FullName": "My_Managed_Subscription",
3 "Metadata":
4 {
5 "label" : "My Managed Subscription",
6 "topicName" : "/event/Order_Event__e",
7 "defaultReplay": "LATEST",
8 "state" : "RUN",
9 "errorRecoveryReplay" : "LATEST"
10 }
11}1{
2 "id": "18xKj000000000BIAQ",
3 "success": true,
4 "errors": [],
5 "warnings": [],
6 "infos": []
7}