Please provide us the raw JSON that you're using to build up your communication information so we can better understand the rules you are using. Redact the sensitive information first. Then provide us the general rules you're going to use to determine that field 1 represents X, field 2 represents Y, etc.
In terms of your code, you appear to be using the older syntax for Azure SDK calls. I notice you're getting the typed results as graphResults
. Then you are converting to JSON and then deserializing it again to get to the call records. This is unnecessary because the GetAsync
call has already done all this work for you. If for some reason you wanted to serialize the data again then there is a Serialize
method for that, but you shoudln't need to do that here.
I don't use Graph for communications but I believe this is the equivalent code you want.
var graphResult = await graphServiceClient.Communications.CallRecords["123"]
.GetAsync(config => {
config.QueryParameters.Expand = ["sessions($expand=semgents)"];
});
//Returned data is already represented as a CallRecord
if (graphResult != null)
{
//Enumerate the sessions, could be null
foreach (var session in graphResult.Sessions)
{
//Enumerate the segments of the session, could be null
foreach (var segment in session.Segments)
{
//Do your work here
};
};
};