Web API time frame

I’m hoping someone can help me with this.

I’m new to web API, but I have managed to get some data out to display from our cisco esa appliance,

The issue is that the request demands start time and end time in iso format, and that the time can only have hours set. Mm:ss must be 00

This example works

But if you replace the static start and end time with {{timeframe.isoStart}} and {{timeframe.isoEnd}}
You get 2024-06-28T01:52:36.538Z and that’s not accepted as an input.

Any idea how I can make this dynamic time to work ?

Hi Christer

Does something like this work?

reporting/mail_incoming_traffic_summary?startDate={{new Date(new Date(timeframe.isoStart).setMinutes(0,0,0)).toISOString()}}

1 Like

Thank you Masokisi !
That solved my my problem.

This one works and I can now change timeframe

reporting/mail_incoming_traffic_summary?startDate={{new Date(new Date(timeframe.isoStart).setMinutes(0,0,0)).toISOString()}}&endDate={{new Date(new Date(timeframe.isoEnd).setMinutes(0,0,0)).toISOString()}}&device_type=esa

1 Like