In attempting to build out some custom tools with the WFM APIs, I'm looking for some ideas, best practices, etc., on how to format the offeredPerInterval and averageHandleTimeSecondsPerInterval and match them up with the actual datetime values to which they are referring. When building out my API calls, I'll receive the return resembling the example below.
Both come in as an array. And the referenceStartDate is the start datetime of the forecast. So the first value in the array matches up to the forecasted offered interactions for 2021-05-16 04:00:00, the 2nd value is the offered value for 2021-05-16 04:15:00, so on an so forth.
I'm sure there is a better way to get my ask across. But what is the best way to match up the offered and AHT metrics from the forecast details return, to their actual datetime parameters from the forecast?
Hi thanks for reaching out.
If you're looking to match up all of the values to their associated date time then a loop through the array would work.
If you're looking for the date time for a specific entry in the array, most date time libraries have a mechanism for adding an arbitrary number of minutes to a date time. The number of minutes for a given item in the array will be equal to the array index (the first index being 0) times 15.
So (in pseudocode) it would be something like referenceStartDate.addMinutes(arrayIndexOfValue * 15)
Thanks Brian - that helps. My issue is working with the API in such a way to make my solution scalable, but also easy to follow for those who aren't super knowledgeable on WFM data as a whole. So.... look out comment tags!
I'm not super concerned about the UTC time, as I'll be handling the time conversions in the Power BI reports.
But this gives me something to go on. Thanks for the nudge in the right direction.