Need help with Conversation Aggregate Query body

Hi all,

Looking at the Python documentation here

SDK Documentation Explorer (genesys.cloud)

Here is what I have tried..

today = datetime.datetime.now(pytz.timezone('Australia/Melbourne')).strftime('%Y-%m-%d')
query = {
'interval': f"{today}T00:00:00/{today}T23:59:59",
'granularity': "PT1H",
'time_zone': "Australia/Melbourne",
'group_by': ["conversationId","direction","userId","queueId","ani","dnis","wrapUpCode","disconnectType"],
'filter': {"type": "and", "predicates": [{ "dimension": "mediaType", "value": "voice" }, { "dimension": "userId", "operator": "exists" }]},
'metrics': ["nBlindTransferred","nConnected","nConsult","nConsultTransferred","nError","nOffered","nOutbound","nOutboundAbandoned","nOutboundAttempted","nOutboundConnected","nOverSla","nStateTransitionError","nTransferred","oExternalMediaCount","oMediaCount","oServiceLevel","oServiceTarget","tAbandon","tAcd","tAcw","tAgentResponseTime","tAlert","tAnswered","tContacting","tDialing","tFlowOut","tHandle","tHeld","tHeldComplete","tIvr","tMonitoring","tNotResponding","tShortAbandon","tTalk","tTalkComplete","tUserResponseTime","tVoicemail","tWait"]
}
body = PureCloudPlatformClientV2.ConversationAggregationQuery(query)

I am getting the an error
body = PureCloudPlatformClientV2.ConversationAggregationQuery(query)
TypeError: init() takes 1 positional argument but 2 were given

I am not sure how to pass my query to this function, any help is appreciated.

Thanks.

Hi Trystan,

I am currently looking into this issue. In the mean time, as a work around, you can pass your query object directly to the post_analytics_conversations_aggregates_query() method and this should work.

For example:

api_response = api_instance.post_analytics_conversations_aggregates_query({
  "interval": "2017-02-02T13:00:00.000Z/2017-02-03T13:00:00.000Z",
  "granularity": "PT12H",
  "groupBy": [
  	"queueId",
  	"userId"
  ],
  "metrics": [
  	"nOutboundConnected",
  	"tAnswered",
  	"tAbandon",
  	"tHandle"
  ],
  "filter": {
    "type": "and",
    "predicates": [
      {
        "dimension": "mediaType",
        "value": "voice"
      },
      {
        "dimension": "direction",
        "value": "outbound"
      }
    ]
  }
})

pprint(api_response)

Please let me know if this temporary solution works for you.

Thanks,

Mike

Hi Mike,

Yes, this approach works.

Thank you