Product: PowerShell Universal
Version: 3.7.3
I have a API error trigger configured and im trying to get that data from the response and the request but i am struggling. Anyone have any ideas?
in my APIError.ps1 script that the trigger calls I have the param block
param (
$Data
)
$Data
adam
January 20, 2023, 12:55pm
2
I think you should be able to just access those properties on data.
$Data.Request
Is that not working?
That did not work for me. I tried all the things but no luck.
adam
January 20, 2023, 1:15pm
4
Something that is weird is that 1 in the pipeline output. I can give this a shot myself in a bit but maybe it’s passing some other object in there?
$Data[1].Request
adam
January 20, 2023, 1:38pm
5
The PSSerializer is currently only serializing the metadata for triggers to 1 depth. Because of this, you can’t access the request\response properties. We’ll get this fixed in 3.7.7.
Thanks for looking into it. This will be a helpful feature for us as we are using them to send alerts to webhooks.
As much data as we can get from the api call that failed the better imo.
1 Like