How to get values from this json?
The returned json from an API is like:
{
"id": 191671,
"callTrackingProfiles": {
"1": {
"destinationPhoneNumber": "8449000218",
"phones": [
{
"phoneType": 3,
"phoneNumber": "8443876176",
"destinationWhisper": true,
"callerWhisper": false,
"isLocal": false,
"recordCalls": false,
"countryCode": "USA"
},
{
"phoneType": 7,
"phoneNumber": "8442692468",
"destinationWhisper": true,
"callerWhisper": false,
"isLocal": false,
"recordCalls": false,
"countryCode": "USA"
},
{
"phoneType": 10,
"phoneNumber": "9493931848",
"destinationWhisper": true,
"callerWhisper": false,
"isLocal": true,
"recordCalls": false,
"countryCode": "USA"
}
]
},
"2": {
"destinationPhoneNumber": "8449000218",
"phones": [
{
"phoneType": 3,
"phoneNumber": "9495283517",
"destinationWhisper": true,
"callerWhisper": false,
"isLocal": true,
"recordCalls": false,
"countryCode": "USA"
},
{
"phoneType": 7,
"phoneNumber": "8443500663",
"destinationWhisper": true,
"callerWhisper": false,
"isLocal": false,
"recordCalls": false,
"countryCode": "USA"
}
]
}
}
Now, I deserialized it:
dynamic jsonResults = JsonConvert.DeserializeObject<dynamic>(response);
var profiles = jsonResults.callTrackingProfiles;
and I can use foreach to loop it.
But how can I get the values of destinationPhoneNumber and phoneNumber?
foreach (var p in profiles)
{
...
p.destinationPhoneNumber
...
}
This does not work, and p.1 has error:
error CS1061: 'object' does not contain a definition for 'destinationPhoneNumber' and no accessible extension method 'destinationPhoneNumber' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?)
Thanks

dynamic?