Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  Outbound - AM leave voicemail after n-th attempt

    Posted 6 hours ago

    Dear community,

    I am trying to create an outbound flow, that will leave a voicemail on the n-th attempt to contact the nr and going to voicemail again.

    We had this developed 6 years ago but it doesn't return the correct nr of calls we made to the same number from the campaign it always returns 1 as value even though we called the number 15 times from the campaign.

    The data action we have is this:

    POST /api/v2/analytics/conversations/details/query

    Request body Template:

    {
     "interval": "${input.Interval}",
     "order": "desc",
     "orderBy": "conversationStart",
     "segmentFilters": [
      {
       "type": "and",
       "predicates": [
        {
         "type": "dimension",
         "dimension": "outboundContactListId",
         "operator": "matches",
         "value": "${input.ContactListID}"
        },
        {
         "type": "dimension",
         "dimension": "outboundContactId",
         "operator": "matches",
         "value": "${input.ContactID}"
        },
        {
         "type": "dimension",
         "dimension": "dnis",
         "operator": "matches",
         "value": "tel:${input.PhoneNumber}"
        }
       ]
      }
     ]
    }

    Response:

    {
      "translationMap": {
        "_count": "$.conversations.length()"
      },
      "translationMapDefaults": {
        "count": "0"
      },
      "successTemplate": "{\"count\":${count}}"
    }
    We need to understand why it only returns 1 as value and preferably we would like to know how many times it hit voicemail out of the total attempts made that period.
    The interval period is from midnight till the time the call is made.

    If anyone can shed a light on this that would be great!

    Have all a great weekend

    #DataActions

    ------------------------------
    Ruud Reinold
    BNP Paribas Personal Finance UK
    ------------------------------


  • 2.  RE: Outbound - AM leave voicemail after n-th attempt

    Posted 26 minutes ago
    Edited by Phaneendra Avatapalli 21 minutes ago

    Hi Rudy,

    From what I see & understood the reason you are consistently getting 1 is likely because you are using the Conversation Details endpoint (/api/v2/analytics/conversations/details/query) and then counting $.conversations.length().

    That gives you the number of matching conversation records, not necessarily the number of outbound attempts. In outbound campaigns, multiple attempts for the same contact can exist within a single conversation record, which would explain why you are seeing 1 even if the number has been called many times.

    This thread explains that distinction well:
    https://community.genesys.com/discussion/outbound-count-versus-outbound-attempt-count

    It may be worth looking at the Aggregates analytics approach instead (/api/v2/analytics/conversations/aggregates/query), as that is better suited if your goal is to count actual attempts rather than conversation records.

    For the voicemail requirement specifically, you would also need a way to identify which of those attempts actually reached voicemail, so you can distinguish between total attempts and voicemail hits. A wrap-up code or similar outcome marker may help here, so you can trigger the "leave a message" logic only on the required voicemail hit.

    Hope this helps & someone might add more to this.



    ------------------------------
    Phaneendra
    Technical Solutions Consultant
    ------------------------------