using System.Collections.Generic;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Serialization;
public static void Main()
""awb"": ""2205900120010"",
""oras destinatar"": """",
""nume confirmare"": """",
""data confirmare"": """",
""ora confirmare"": """",
""status"": ""AWB-ul nu a fost predat catre FAN Courier"",
""awb"": ""5345899260009"",
""oras destinatar"": ""Tamaseu"",
""continut"": ""COMANDA 16201"",
""nume confirmare"": ""Szilagyi Ileana"",
""data confirmare"": ""13.12.2018"",
""ora confirmare"": ""17:16"",
""status"": ""Expeditie in livrare"",
""data"": ""12.12.2018"",
""traseu"": ""Expeditia a fost preluata de catre FAN Courier in data 12.12.2018 14:46.""
""status"": ""Expeditie in livrare"",
""data"": ""12.12.2018"",
""traseu"": ""Expeditia a plecat din hub-ul FAN Courier Lugoj spre hub-ul de destinatie in data 12.12.2018 19:35.""
""data"": ""13.12.2018"",
""traseu"": ""Expeditia a fost preluata spre livrare de catre curierul din orasul Oradea in data 13.12.2018 10:46.""
""data"": ""13.12.2018"",
""traseu"": ""Ultimul status al expeditiei: livrat in data 13.12.2018 17:16.""
var list = JsonConvert.DeserializeObject<List<AwbTrackingResponse>>(json);
foreach (var atr in list)
Console.WriteLine("Awb: " + atr.Awb);
Console.WriteLine("Destination City: " + atr.DestinationCity);
Console.WriteLine("Content: " + atr.Content);
Console.WriteLine("Confirmed Name: " + atr.ConfirmedName);
Console.WriteLine("Confirmed Date: " + atr.ConfirmedDate);
Console.WriteLine("Confirmed Hour: " + atr.ConfirmedHour);
Console.WriteLine("Awb Return: " + atr.AwbReturn);
Console.WriteLine("Events:");
foreach (var kvp in atr.Events)
Console.WriteLine(" Id: " + evt.Id);
Console.WriteLine(" Status: " + evt.Status);
Console.WriteLine(" Date: " + evt.Date);
Console.WriteLine(" Time: " + evt.Time);
Console.WriteLine(" City: " + evt.City);
Console.WriteLine(" Route: " + evt.Route);
public class AwbTrackingResponse
public string Awb { get; set; }
[JsonProperty("oras destinatar")]
public string DestinationCity { get; set; }
[JsonProperty("continut")]
public string Content { get; set; }
[JsonProperty("nume confirmare")]
public string ConfirmedName { get; set; }
[JsonProperty("data confirmare")]
public string ConfirmedDate { get; set; }
[JsonProperty("ora confirmare")]
public string ConfirmedHour { get; set; }
[JsonProperty("awb retur")]
public string AwbReturn { get; set; }
private Dictionary<string, JToken> EventData { get; set; }
public Dictionary<int, AwbTrackingEvent> Events
return EventData != null ? EventData.ToDictionary(kvp => Convert.ToInt32(kvp.Key), kvp => kvp.Value.ToObject<AwbTrackingEvent>()) : null;
EventData = value != null ? value.ToDictionary(kvp => kvp.Key.ToString(), kvp => JToken.FromObject(kvp.Value)) : null;
public class AwbTrackingEvent
public int Id { get; set; }
public string Status { get; set; }
public string Date { get; set; }
public string Time { get; set; }
public string City { get; set; }
public string Route { get; set; }