Genesys Cloud - Developer Community

 View Only

Discussion Thread View
  • 1.  How to get the current time during ACW in the script

    Posted 04-25-2025 05:05
    Edited by Yurie Ikura 05-11-2025 22:14

    Currently, we are using a script to retrieve call information and construct a system that integrates it with external applications.
    To confirm the accuracy of the information and enhance security, it is important for the external application side to verify that the "current time recognized by the external application" receiving the call information matches the "current time recognized by the script" provided by the script.

     

    Based on the information from the Developer Community below, we have retrieved the current time by adding "Scripter.Agent Call Duration" to "Scripter.Agent Call Start Time."

    https://developer.dev-genesys.cloud/forum/t/how-to-get-current-date-time-in-the-script-solution/20804

    However, the addition of "Scripter.Agent Call Duration" ceases when the call is disconnected.
    Therefore, the current time cannot be retrieved during ACW after the call is disconnected.
    The agent wants to input information during ACW and integrate it with the external application via the script, so it's necessary to integrate the current time while in ACW.

     

    For example, the requirement could be met if the following variables were available:
    - A method to directly retrieve the current time in the script
    - A method to obtain elapsed interaction time that continues to increase even during ACW in the script

    Is there a way to get these?


    #Scripts

    ------------------------------
    Yurie Ikura
    NA
    ------------------------------



  • 2.  RE: How to get the current time during ACW in the script

    Posted 05-11-2025 22:17

    Is there anyone who has information about this?
    Is there no way to obtain the current time in the script even during ACW?



    ------------------------------
    Yurie Ikura
    NA
    ------------------------------



  • 3.  RE: How to get the current time during ACW in the script
    Best Answer

    Posted 13 days ago
    This issue has been resolved!
    For those who are facing the same problem, I would like to share the solution here.
     
    There is an undocumented API that allows you to obtain the server time: GET /api/v2/date.
     
    This topic is discussed in the Developer Community below:
    https://community.genesys.com/discussion/is-there-a-way-to-get-the-server-time
    When executed, you can obtain the result in Greenwich Mean Time as shown below.
     
    Response:
     
    {
      "currentDate": "2025-05-15T01:53:00.515Z"
    }


    ------------------------------
    Yurie Ikura
    NA
    ------------------------------



Need Help finding something?

Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources