I'd like to use both the post_analytics_conversations_details_query
and the post_analytics_conversations_details_job
endpoints to retrieve conversation data, but I would like to restrict the output to conversations and segments, which both contain a conversation_end
. Here's a snippet of the code I'm playing around with, but it appears to still return conversations without a conversation_end date.
I would be very grateful for some guidance on how best to accomplish this or if it's possible.
In addition, is it possible to leverage NumericRange
to filter conversations by conversationEnd
and how would that be done? I tried inputting a float datetime value for "value"
, but it didn't appear to filter anything.
Thank you!
import PureCloudPlatformClientV2 as PureCloud
conversation_filters = PureCloud.ConversationDetailQueryFilter()
conversation_filters_predicates = PureCloud.ConversationDetailQueryPredicate()
conversation_filters_clause = PureCloud.ConversationDetailQueryClause()
segment_filters = PureCloud.SegmentDetailQueryFilter()
segment_filters_predicates = PureCloud.SegmentDetailQueryPredicate()
segment_filters_clause = PureCloud.SegmentDetailQueryClause()
conversation_filters_predicates.dimension = 'conversationEnd'
conversation_filters_predicates.operator = 'exists'
segment_filters_predicates.dimension = 'segmentEnd'
segment_filters_predicates.operator = 'exists'
conversation_filters_clause.type = 'and'
segment_filters_clause.type = 'and'
conversation_filters.type = 'and'
segment_filters.type = 'and'
conversation_filters.predicates = conversation_filters_predicates
conversation_filters.clauses = conversation_filters_clause
segment_filters.predicates = segment_filters_predicates
segment_filters.clauses = segment_filters_clause
body=dict(interval='2019-12-11T21:38:57.037419+00:00/2019-12-11T22:38:57.037419+00:00')
body['conversation_filters'] = conversation_filters
body['segment_filters'] = segment_filters
# ignore this method below
api = set_api_instance(PureCloud.AnalyticsApi())
job_resp = api.post_analytics_conversations_details_query(body=body)