using Newtonsoft.Json.Linq;
public static void Main()
string json1 = @"{ ""requestId"": 1, ""errors"": """" }";
DeserializeAndDump(json1);
string json2 = @"{ ""requestId"": 2, ""errors"": ""Something went wrong"" }";
DeserializeAndDump(json2);
string json3 = @"{ ""requestId"": 3, ""errors"": { ""invalid_player_ids"" : [""5fdc92b2-3b2a-11e5-ac13-8fdccfe4d986"", ""00cb73f8-5815-11e5-ba69-f75522da5528""] } }";
DeserializeAndDump(json3);
string json4 = @"{ ""requestId"": 4, ""errors"": [ ""Notification content must not be null for any languages."" ] }";
DeserializeAndDump(json4);
string json5 = @"{ ""requestId"": 5, ""errors"": null }";
DeserializeAndDump(json5);
private static void DeserializeAndDump(string json)
Response resp = JsonConvert.DeserializeObject<Response>(json);
Console.WriteLine("RequestId: " + resp.RequestId.ToString());
Console.WriteLine("Errors: " + resp.Errors.ToString());
public int RequestId { get; set; }
public JToken Errors { get; set; }