Hi Team,
Background - Our objective is to extract the Conversation detail data using the Python SDK by calling the PureCloudPlatformClientV2.ConversationsApi() package. We are successful in extracting the data in the JSON format however while converting the data from JSON to CSV, we are facing the challenge.
Error : TypeError: argument of type 'AnalyticsConversationWithoutAttributes' is not iterable
Code Snippet:
query_result = api_instance.post_analytics_conversations_details_query(query)
a=query_result.conversations
i=[]
for z in range(len(a)):
i.append(a[z])
if 'conversation_end' in a[z]:
print(i[z].conversation_end)
else:
print('na')
The data type of the whole conversation is LIST however when we check he datatype of a single conversation by passing the index value, it displays "<class 'PureCloudPlatformClientV2.models.analytics_conversation_without_attributes.AnalyticsConversationWithoutAttributes'>" instead of LIST.
We suspect as the data type of individual indices are not LIST, the iteration is failing and throwing the above error.
Any inputs to resolve this issue will be very much helpful.
Please let me know if you need any further details. I'll be happy to share.
Thanks & Regards,
Vinay