Accessingwebhook payload within a flow
-
Hi, I’m new to WP webhooks and trying to use it for my first automation flow. Scenario is that I’d like to listen for an incoming webhook (via received_http_request trigger), then run some custom PHP code (via custom_action). So, a simple 2-step flow seems to be the answer.
The incoming webhook gets intercepted OK, but I can’t figure out how to access the JSON payload within my custom PHP function. I can see that payload data as being available within the Action settings for the custom_action step (see screenshot below) but when I try to access it within the PHP function, the $response_body array doesn’t have anything to do with the webhook data
Here’s what I see when I dump down the $response_body array
So, instead of seeing my incoming webhook payload in the [content] section, it seems I’m getting some internal WP Webhooks data in there instead. What am I missing?
Also, I see references to some helper functions in the example provided (eg. WPWHPRO()->helpers->validate_request_value) but I can’t find anywhere that documents this. Any pointers, please?
I’ve got around this issue temporarily by passing the ID field I’m looking for into the php function using the $identifier parameter for the function (as per the initial screenshot), but I’d really like to know how to access the entire webhook payload within the PHP function itself.
Thanks
Julian
You must be logged in to reply to this topic.