Conversation Detail Queries

Hi all

Total noob to the API using .Net SDK.

Customer requires CDR records effectively to be periodically exported so their BI team can run some wallboard statistics. (Host of other things also needed which I have managed to get out of the system)

Looking at the Conversation Query and am not seeing any granular statistics, just the standard fare of initiated and disconnected timestamps and some high level participant data
The Conversation Aggregate query on the other hand seems to have all the granular detail available, but grouped together and not per conversation.

Is there a simple way to get granular (CIC Calldetail like) metrics per conversation with the aim of writing CDR's per call?
E.g. talk time, hold time, was it abandoned, time to answer etc.

Thank you in advance for any and all help :slight_smile:

Kind regards,
Jannie

You may be interested in this open source project to export historical data: https://github.com/MyPureCloud/open-data-exporter

The conversation detail endpoints only return detail data and the conversation aggregate endpoints only return aggregate data. However, if you were to perform an aggregate query with a filter for a single conversation ID, you would get statistics for only that one conversation.

Hi Tim

Thank you for the speedy reply. Let me try the suggestion and see what it looks like.

Kind regards,

Hi Tim

Got outline for how I will be doing this and looking good thus far. Picking up a funny when creating the Aggregation query. I am leaving all values null and just creating a filter for the ConversationID.
I used the Query builder tool in Developer tools to make sure what I want to do should work and it does there.
On the AnalyticsQueryFilter you have 3 potential values being Type, Predicate and Clause. I set the Type to or, Predicate is a list of AnalysticsQueryPredicate under which I added my conversationID details and seem to look fine. I am not setting a clause at all just like my query in Developer tools.

However when debugging, I keep getting an exception saying Type for AnalyticsQueryFilter cannot be null. Even though it is set to Or: "Type = AnalyticsQueryFilter.TypeEnum.Or". Tried putting it in front of and behind the predicate statement to no avail.

Am I missing something obvious here perhaps? I see a third option on "AnalyticsQueryFilter.TypeEnum" which is OutdatedSDKVersion, sitting below the and, or options. But suspect this is always there as I am on the latest stable SDK version which is 16.0.0

Thank you in advance for your assistance.

Kind regards,
Jannie

Could you share the block of your code where you're building the request?

Hi Tim

Sure, the Query looks as follows:

PureCloudPlatform.Client.V2.Model.AggregationQuery a1 = 
	new PureCloudPlatform.Client.V2.Model.AggregationQuery(
	null, 
	null, 
	null, 
	null, 
	new AnalyticsQueryFilter { 
		Type  = AnalyticsQueryFilter.TypeEnum.Or, 
		Predicates = new List<AnalyticsQueryPredicate> { 
			new AnalyticsQueryPredicate { 
				Type = AnalyticsQueryPredicate.TypeEnum.Dimension, 
				Dimension = AnalyticsQueryPredicate.DimensionEnum.Conversationid, 
				_Operator = AnalyticsQueryPredicate.OperatorEnum.Matches, 
				Value = convo.ConversationId 
			} 
		} 
	},
	null,
	null,
	null);

Where convo.ConversationId is the conversation ID being used in the search.

Let me know if anything additional is required. It fails on the above constructor and I am creating the filter in there and not separately so should be everything needed.

Kind regards,

I think the error may have to do with using an initializer instead of the constructor. Try using the constructor for AnalyticsQueryFilter instead and see if that makes a difference. I'll dig into this to test it once my windows VM finishes applying updates (which doesn't look like it will be soon, unfortunately).

Hi Tim

Thank you, will try shortly and revert.

Kind regards,

Hi Tim

If I create the Predicate List separately, and then the Filter separately with the predicate List variable and then construct the query with that variable, it works!

So the issue is definitely with the initializer. Might be worthwhile to have a look into this either way, will definitely make the code shorter in certain instances, but mine is working now so thank you very much for the help :slight_smile:

Kind regards,

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