Platform Events Apex Handler (Object Type)
Considering you've already gone through Platform Events section of the documentation, this article will walk you through how to write a trigger on the cldfs__CloudFilesEvent__c object and handle custom logic based on the event type.
Note: Salesforce does not allow callouts from the trigger context. Therefore, please make the callout in an asynchronous context. In the example below, we used a future method to make the callout. Salesforce Article Link
Trigger Example:
Trigger Handler Example:
Line #35 in the example above displays outputs from the DocumentProcessed event type(i.e. type number 14 in the list below). Depending on your use case, Here are the avilable platform event types and their custom Apex types that you may use to access relevant information: