Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  Need to know numbers of callers contact with agent

    Posted 10 days ago

    Hi 

    I need to know how often a caller (ani) has been in contact with agents during a given time interval while the caller still is in the Inbound flow. 

    For that I plan to use the API /api/v2/analytics/conversations/details/query endpoint – to extract the numbers. 

    But I'm not sure that is the right way to do it because of the numbers of calls to the endpoint we have to make which might have an impact on other API request.

    Does anyone have any experience retrieving that kind of data and if so, what was your approach.

    Looking forward to hearing from you

    /Torben 


    #PlatformAPI

    ------------------------------
    Torben Hedemann B. Eriksen
    NA
    ------------------------------


  • 2.  RE: Need to know numbers of callers contact with agent

    Posted 10 days ago

    Hi,

    Depends on the timeframe, but you can also search for external contacts by ani, and then search for all Journey sessions for that contact.

    Even if you don't save external contacts it will temporarily save contacts for 60 days for Customer Journey.



    ------------------------------
    Jan Heinonen
    Contact Center Specialist
    GlobalConnect AB
    ------------------------------



  • 3.  RE: Need to know numbers of callers contact with agent

    Posted 10 days ago

    Hi Jan, 

    I hadn't thought of that approach.

    So you're saying that even if the caller isn't being created as an external contact, the ANI and the journey are temporarily stored in Genesys? I tried searching for my "temporary external contact number" using /api/v2/externalcontacts/contacts?q=%2B4599999999, but didn't get any results. Is that the right endpoint I'm calling?

    Regards, 
    Torben 



    ------------------------------
    Torben Hedemann B. Eriksen
    NA
    ------------------------------



  • 4.  RE: Need to know numbers of callers contact with agent

    Posted 10 days ago

    Hi Torben,

    I looked at what I did, and since I already know the externalContactId of the current call I can use

    GET /api/v2/externalcontacts/contacts/{contactId}/journey/sessions?includeMerged=true

    which will return a list previous sessions.

    Depends on the exact use case but /api/v2/analytics/conversations/details/query that you mentioned first would also work.

    Getting sessions will give you the number of session you specify, but you can't select timeframe, where the Analytics Query would give all results in a timeframe but it can't be longer than 32 days per request.



    ------------------------------
    Jan Heinonen
    Contact Center Specialist
    GlobalConnect AB
    ------------------------------



  • 5.  RE: Need to know numbers of callers contact with agent

    Posted 10 days ago

    Hi Torben,
    I am using the same API for the same usecase. I never ran into problems, but we are no big company. Ther is a API-calls-per-token-limit of 300 API calls per minute for the same authentication token.
    If you have a high volume of calls that you worry about interfering with the rest of the API usage, create a new oAuth token just for that API-call. As long as you do not expect around 300 calls per minute you should be fine.

    Best
    Christoph



    ------------------------------
    Christoph Domaschke
    Produktmanager Kunden-Dialog-Center
    ------------------------------



  • 6.  RE: Need to know numbers of callers contact with agent

    Posted 3 days ago

    Thanks for all the answers – I've made progress with the task, but I'm now facing another issue related to the API Explorer and building the request body for /api/v2/analytics/conversations/details/query.
    How can I test whether tTalk under the agent session → metrics is present and populated with a value? I've tried pretty much everything but haven't been able to get that part working.

    My Request Body look like this - hope some one can tell how to add the metrics filter :-)

    {
      "interval": "${input.interval}",
      "order": "asc",
      "orderBy": "conversationStart",
      "paging": {
        "pageNumber": 999,
        "pageSize": 100
      },
      "segmentFilters": [
        {
          "type": "or",
          "clauses": [
            {
              "type": "and",
              "predicates": [
                {
                  "type": "dimension",
                  "dimension": "mediaType",
                  "value": "callback"
                },
                {
                  "type": "dimension",
                  "dimension": "remote",
                  "value": "${input.ANI}"
                }
              ]
            },
            {
              "type": "and",
              "predicates": [
                {
                  "type": "dimension",
                  "dimension": "ani",
                  "operator": "matches",
                  "value": "${input.ANI}"
                },
                {
                  "type": "dimension",
                  "dimension": "dnis",
                  "operator": "matches",
                  "value": "${input.DNIS}"
                },
                {
                  "type": "dimension",
                  "dimension": "purpose",
                  "operator": "matches",
                  "value": "agent"
                }
              ]
            }
          ]
        }
      ]
    }

    Thanks in advance.

    /Torben



    ------------------------------
    Torben Hedemann B. Eriksen
    NA
    ------------------------------



  • 7.  RE: Need to know numbers of callers contact with agent

    Posted 3 days ago

    Hi Torben,

    for me the following code works. But maybe I forgot something to think about.

    {
      "interval": "${input.startdate}/${input.enddate}",
      "order": "asc",
      "orderBy": "conversationStart",
      "paging": {
        "pageSize": 100,
        "pageNumber": 1
      },
      "segmentFilters": [
        {
          "predicates": [
            {
              "type": "dimension",
              "dimension": "mediaType",
              "operator": "matches",
              "value": "voice"
            },
            {
              "type": "dimension",
              "dimension": "ani",
              "operator": "matches",
              "value": "${input.customerANI}"
            }
          ],
          "type": "and"
        }
      ],
      "conversationFilters": [
        {
          "type": "and",
          "clauses": [
            {
              "predicates": [
                {
                  "type": "metric",
                  "metric": "tTalk",
                  "operator": "exists"
                },
                {
                  "type": "metric",
                  "metric": "tVoicemail",
                  "operator": "notExists"
                }
              ],
              "type": "and"
            }
          ]
        }
      ]
    }



    ------------------------------
    Christoph Domaschke
    Produktmanager Kunden-Dialog-Center
    ------------------------------



  • 8.  RE: Need to know numbers of callers contact with agent

    Posted 2 days ago

    Hi Christoph,

    I think I owe you a big draft beer :)  - your conversationFilters was exactly what I needed.

    I really appreciate your help.

    Regards,

    Torben 



    ------------------------------
    Torben Hedemann B. Eriksen
    NA
    ------------------------------



  • 9.  RE: Need to know numbers of callers contact with agent

    Posted 2 days ago

    It was a pleasure - even without your offered beer. :-)



    ------------------------------
    Christoph Domaschke
    Produktmanager Kunden-Dialog-Center
    ------------------------------