TL;DR - Available time does not reset to zero after wrapping up the call. Would like to know the available time starting from the end of the last call.
Problem:
In Genesys Engage, we had Ready, Not Ready. After agent wraps up the call and transitions from ACW to Ready, the ready time for the agent would reset to zero. In Genesys Cloud, wrapping up the call and going back to ready restarts the Available timer from the value prior to receiving the call.
What we use:
/api/v2/users/{userId}/presences/purecloud
Response:
"result": {
"source": "PURECLOUD",
"presenceDefinition": {
"id": "6a3af8XX-YYYY-YYYY-JJJJ-123456789Z",
"systemPresence": "Available",
"selfUri": "/api/v2/presencedefinitions/6a3af8XX-YYYY-YYYY-JJJJJ-123456789Z"
},
"message": "",
"modifiedDate": "2024-04-23T06:33:30.764Z",
"selfUri": "/api/v2/users/AAAAAAAA-BBBB-CCC-DDDD-JJJJJJJJJ/presences"
}
So, the modified date would contain the total time the agent was available since the login.
I would parse it as:
public static getSecondsFromDate(date) {
let milliseconds = Date.parse(new Date().toISOString()) - Date.parse(date);
return (milliseconds / 1000).toFixed(0);
}
Is there a way to get this since switching back to Available?
And, no, we cannot do it locally, since it is running in a browser, and refreshing it would reset the timer to 0.