0
        WebClient client = new WebClient();
        string json_response = client.DownloadString("https://tr.api.pvp.net/api/lol/tr/v1.4/summoner/by-name/SUMMONERNAME?api_key=KEY");
        dynamic deserialized_response = JsonConvert.DeserializeObject<dynamic>(json_response);
        string Summonerid = deserialized_response.id;

Hi there i am trying to call only id but im failing it. i also tried to do this with viewmodel but still i have failed. And i also want to make a variable SUMMONERNAME how can i have a textbox input to SUMMONERNAME. this is the api's reference link "https://developer.riotgames.com/api/methods#!/1079/3722"

        string json_response = client.DownloadString("https://tr.api.pvp.net/api/lol/tr/v1.4/summoner/by-name/SUMMONERNAME?api_key=KEY");
        RiotApiViewModel deserialized_response = JsonConvert.DeserializeObject<RiotApiViewModel>(json_response);
        long id = deserialized_response.id;

1 Answers1

0

var foundSummoner = JsonConvert.DeserializeObject>(json_response); this is fixed my error