Hi,
I’m switching from using polling based integrations to REST hook ones. However there’s a few things the documentation for `zapier-platform-core` doesn’t make clear to me.
With polling I can process the response data from my application before returning it to a Zap to reshape it, I’m wondering how best to do this with instant triggers?
My application has a single set of endpoints for managing subscriptions, where hook can subscribe to one or more events, and will receive all events of those types within the user’s scope, the actual event payload is wrapped to aid processing multiple types:
{
"timestamp": "2021-11-16T16:29:00Z", // Event Timestamp
"event": "resource.action", // The Event Type
"organization": { //
"id": "someid", // "Organization" represents the scope in which
"name": "Some Name" // the event happened
},
"payload": { /* object */ } // The "payload" object
// contains the resource to which the event
// happened. It's type depends on the value of 'event'
}
For Zapier I’ve created a helper which will create a subscription, with a Zapier trigger mapping to a single event type in my application.
How should I best pass these payloads back to the user such that they can access the payload data without needing to wrap all/most fields with `payload` explicitly?