Firstly, you are dealing with an object at the top level. After parsing the object, you need to look at the content
array:
var obj = JObject.Parse(json); foreach (JObject element in obj["content"]) { Console.WriteLine(element["id"]); }
Here's an example : https://dotnetfiddle.net/DhVZFf
Also (and it could just be a typo), your JSON is incorrect. In particular, the comma-separating elements in the content
array are in the wrong place:
{ "organizationId": "Org123", "id": "333", "label": "comp1", // <--- } { "organizationId": "Org123", "id": "444", "label": "comp2", }
These commas should be between the elements of the array:
{ "organizationId": "Org123", "id": "333", "label": "comp1" }, // <--- { "organizationId": "Org123", "id": "444", "label": "comp2" }
source share