Hey all i have the following json response that i am trying to find:
My code is this:
I have even tried:
And finally just doing this:
What am i missing?
Code:
{
"threaded_extended": {
"3570956071": [
{
"id": [edited],
"network_id": [edited],
"sender_type": "user",
"url": "[edited]",
"sender_id": [edited],
"privacy": "public",
"body": {
"rich": "[edited]",
"parsed": "[edited]",
"plain": "[edited]"
},
"liked_by": {
"count": 0,
"names": []
},
"thread_id": [edited],I am trying to find 3570956071 but i cant seem to find it using JSON.net.
Code:
Dim url As String = "https://www.[edited].json?access_token=" & yAPI.userToken & "&threaded=extended"
Dim request As HttpWebRequest = DirectCast(WebRequest.Create(url), HttpWebRequest)
Dim response As HttpWebResponse = DirectCast(request.GetResponse(), HttpWebResponse)
Dim reader As StreamReader = New StreamReader(response.GetResponseStream())
Dim o As JObject = JObject.Parse(reader.ReadToEnd)
For Each msg3 As JObject In o("threaded_extended")("3570956071")
'etc etc....And i get the error: Object reference not set to an instance of an object.
Code:
For Each msg3 As JObject In o("threaded_extended")
'etc etc....And get the error: Unable to cast object of type 'Newtonsoft.Json.Linq.JProperty' to type 'Newtonsoft.Json.Linq.JObject'.
Code:
For Each msg3 As JObject In o("3570956071")
'etc etc....gives me the error: Object reference not set to an instance of an object.