Genesys Cloud (formerly PureCloud)

Discussion Thread View
Expand all | Collapse all

API - Estimated Wait Time

  • 1.  API - Estimated Wait Time

    Posted 11-13-2018 16:00
    Hello,

    We use the predefined Action "Get Estimated Wait Time", to show the estimated wait time in scripts.
    The action was working fine (has been published long time ago), but suddenly it stopped working.
    I verified the Action with the PureCloud's Development Tools API Explorer, and I see that the JSON response sent back contains different variables then before, variables which do not show an Estimated Wait Time.
    Is there anyone who came across the same problem ? Can this be solved by us ?

    For information, the INPUT
    {
    "requestUrlTemplate": "/api/v2/routing/queues/${input.QUEUE_ID}/mediatypes/${input.MEDIA_TYPE}/estimatedwaittime",
    "requestType": "GET",
    "headers": {
    "UserAgent": "PureCloudIntegrations/1.0",
    "Content-Type": "application/x-www-form-urlencoded"
    },
    "requestTemplate": "${input.rawRequest}"
    }

    The expected response
    {
    "translationMap": {
    "estimated_wait_time": "$.results[0].estimatedWaitTimeSeconds"
    },
    "translationMapDefaults": {},
    "successTemplate": "{\n \"estimated_wait_time\": ${estimated_wait_time}\n}"
    }

    And the current response (NOT OK):
    {
    "results": [
    {
    "formula": "BEST"
    }
    ]
    }

    Thx in advance
    #ArchitectureandDesign
    #Routing(ACD/IVR)

    ------------------------------
    Steven Deferme
    Quant ICT
    ------------------------------


  • 2.  RE: API - Estimated Wait Time

    GENESYS
    Posted 11-13-2018 17:43
    You would be best off posting API questions on the developer forum at https://developer.mypurecloud.com

    That said, the API documentation says the expected response is:


    {
        "results": [
            {
                "intent": "",
                "formula": "",
                "estimatedWaitTimeSeconds": 0
            }
        ]
    }

    The expected response you posted has a translation map, so you are going to need to look at your translation map configuration to see if it still lines up with the documented response (I don't know if that changed recently--I wouldn't expect so).

    ------------------------------
    George Ganahl CCXP, GCA
    Principal Program Manager
    Genesys
    ------------------------------



  • 3.  RE: API - Estimated Wait Time

    Posted 11-14-2018 02:21

    Hello,

    I will post my question in de dev forum.
    Nothing has changed in the API specification, nor in the webservice configuratio itself.
    estimatedWaitTimeSeconds is missing from the json response. It should be there according to the API resource documentation:

    EstimatedWaitTimePredictions
    results
    (array PredictionResults): Returned upon a successful estimated wait time request.
    PredictionResults
    intent
    (string): Indicates the media type scope of this estimated wait time Valid Values: ALL, CALL, CALLBACK, CHAT, EMAIL, MESSAGE, SOCIALEXPRESSION, VIDEOCOMM
    formula
    (string): Indicates the estimated wait time Formula Valid Values: ABANDON, BEST, PATIENCE_ABANDON, SIMPLE
    estimatedWaitTimeSeconds
    (integer): Estimated wait time in seconds



    ------------------------------
    Steven Deferme
    Quant ICT
    ------------------------------



  • 4.  RE: API - Estimated Wait Time

    Posted 08-04-2020 12:31
    Did you ever get an answer on the dev forum? The default action is still broken.

    ------------------------------
    Travis Fritz
    Virtual Hold Technology, LLC (VHT)
    ------------------------------



  • 5.  RE: API - Estimated Wait Time

    Posted 08-04-2020 13:06
    The reason it is missing sometimes is because there is no wait time. If there is no wait time the value is not returned in the payload. If you require a value be returned, you can set a default of 0 or whatever you desire. When the is a wait time then estimatedWaitTimeSeconds is returned in the JSON response.

    I set it to 121 in this example response JSON. when there is no EWT i get 121 returned. When there is an EWT i get the actual EWT returned.

    {
    "translationMap": {
    "estimated_wait_time": "$.results[0].estimatedWaitTimeSeconds"
    },
    "translationMapDefaults": {
    "estimated_wait_time": "121"
    },
    "successTemplate": "{\n \"estimated_wait_time\": ${estimated_wait_time}\n}"
    }

    ------------------------------
    Travis Fritz
    Virtual Hold Technology, LLC (VHT)
    ------------------------------