How to load json structur data from ConversationAggregateDataContainer into python dataframe

Hi,

I use this aggregation function from genesys analytics:
try:
# Query for conversation aggregates
api_response = api_instance.post_analytics_conversations_aggregates_query(body)
#print(api_response)
except ApiException as e:
print("Exception when calling PostAnalyticsConversationsAggregatesQueryRequest->post_analytics_conversations_aggregates_query: %s\n" % e)

list = str(api_response.results)
print(list)

But I don't know how to load the result from the list object into a dataframe:

This is my result string:
{'results': [{'data': [{'interval': '2022-11-11T10:00:00.000Z/2022-11-11T10:30:00.000Z',
'metrics': [{'metric': 'nError',
'qualifier': None,
'stats': {'count': 4,
'count_negative': None,
'count_positive': None,
'current': None,
'denominator': None,
'max': None,
'min': None,
'numerator': None,
'ratio': None,
'sum': None,
'target': None}},
{'metric': 'nOffered',
'qualifier': None,
'stats': {'count': 113,
'count_negative': None,
'count_positive': None,
'current': None,
'denominator': None,
'max': None,
'min': None,
'numerator': None,
'ratio': None,
'sum': None,
'target': None}}],
'views': None}],
'group': {'mediaType': 'voice'}}]}

And i just need this dataframe:
Dataframe:
interval metric count
0 2022-11-11T10:00:00.000Z/2022-11-11T10:30:00.000Z nError 4
1 2022-11-11T10:00:00.000Z/2022-11-11T10:30:00.000Z nOffered 113

Any Idea how to get this result?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.