I have been beating my head against the wall trying to figure out how to parse the data I need from this json response I receive from an api call. Here is the beginning of the response:
{
"response": {
"results": [
[
1002,
"Brent's Test Product o Fun",
"TEST001",
"1234567-",
"100000000281",
"12345678",
"",
"",
true,
"Brightpearl",
"2020-06-18T13:38:01.000-05:00",
"2021-04-27T07:45:24.000-05:00",
439,
null,
74,
1,
"LIVE",
null
],
[
1003,
"Brent's Test Product 2",
"TEST002",
"",
"",
"",
"",
"",
true,
"Brightpearl",
"2020-08-31T00:53:26.000-05:00",
"2021-04-27T07:45:24.000-05:00",
439,
null,
74,
1,
"LIVE",
null
],
[
1004,
"Brent's Test Product 3",
"TEST003",
"",
"",
"",
"",
"",
true,
"Brightpearl",
"2020-09-16T00:30:55.000-05:00",
"2021-04-27T07:45:24.000-05:00",
439,
null,
74,
1,
"LIVE",
null
],
What I need to be able to do is loop through the nodes that are nested in "results". These are actually product skus that I need to work with. There is a bunch of metadata returned at the end of the response that I haven't included here.
I have created this class to handle the results.
public class SkuSearchResults
{
public int productId { get; set; }
public string productName { get; set; }
public string SKU { get; set; }
public string barcode { get; set; }
public string EAN { get; set; }
public string UPC { get; set; }
public string ISBN { get; set; }
public string MPN { get; set; }
public bool stockTracked { get; set; }
public string salesChannelName { get; set; }
public string createdOn { get; set; }
public string updatedOn { get; set; }
public int brightpearlCategoryCode { get; set; }
public int productGroupId { get; set; }
public int brandId { get; set; }
public int productTypeId { get; set; }
public string productStatus { get; set; }
public int primarySupplierId { get; set; }
}