Accessed JArray values with invalid key value: “fields”. Array position index expected
==========================================================
{
"response":{
"status":"ok",
"userTier":"approved",
"total":1,
"startIndex":1,
"pageSize":10,
"currentPage":1,
"pages":1,
"orderBy":"newest",
"results":[{
"id":"sustainable-business/sustainable-finance-where-next-open-thread",
"sectionId":"sustainable-business",
"sectionName":"Guardian Sustainable Business",
"webPublicationDate":"2014-02-13T13:27:00Z",
"webTitle":"Where next for sustainable finance? - open thread",
"webUrl":"http://www.theguardian.com/sustainable-business/sustainable-finance-where-next-open-thread",
"apiUrl":"http://content.guardianapis.com/sustainable-business/sustainable-finance-where-next-open-thread",
"fields":{
"body":"<img src=\"http://hits.theguardian.com/b/ss/guardiangu-api/1/H.20.3/98867?ns=guardian&pageName=Where+next+for+sustainable+finance%3F+-+open+thread+Article+2043222&ch=Guardian+Sustainable+Business&c2=461773&c4=MIC%3A+Finance+%28GSB%29%2CMIC%3A+Guardian+Sustainable+Business%2CPRO%3A+Sustainability+%28Guardian+Professional%29&c3=theguardian.com&c6=Laura+Paddison&c7=14-Feb-13&c8=2043222&c9=Article\" width=\"1\" height=\"1\" />..."
}
}]
}
}
==========================================================
// Convert Json String to JSON Format in C#
dynamic responseData = Newtonsoft.Json.Linq.JObject.Parse(_responseData);
// access fields's Body using below technique
string story = (string)ja["response"]["results"][0]["fields"]["body"];
Comments
Post a Comment