Static Data champion, GetByKey returns RiotSharpException: 403, ForbiddenSee original GitHub issue
I’ve been checking that it wasn’t me, testing with different keys. (The same happened to me with the
GetSummonerBySummonerIdAsync methods, I just ignored it and continue working with the
GetSummonerByNameAsync method). These two first methods returned a RiotSharpException: 403, Forbidden
However, I tried
.Champions.GetByKeyAsync right now and it also returns the same exception.
This is the exact code.
var test = api.StaticData.Champions.GetByKeyAsync(championId.ToString(), version).Result.Image.Full;
- Created 2 years ago
- Comments:9 (4 by maintainers)
Top GitHub Comments
Weird, it might be something relate to my code. Tried this
var api = RiotSharp.RiotApi.GetDevelopmentInstance("hbiahbdiahbd"); var skarnerTask = api.DataDragon.Champions.GetByIdAsync(72, "11.12.1"); var skarnerResult = skarnerTask.Result;
with my ApiKey of course, and get the same result. However, I got all champions with
GetAllAsync method, so I’m working with that.
PS; My mind is a mess and the whole time I was thinking 72 was nida despite I knew it was 76, haha, however, thanks for your help, was really useful!
Have a good day.
Following code works for me without any issue, besides the champ behind 72 being Skarner 😉 https://pastebin.com/VD3ZqHAj
var ddragon = new RiotSharp.Endpoints.StaticDataEndpoint.StaticEndpointProvider(new RiotSharp.Http.Requester(), new RiotSharp.Caching.PassThroughCache()); var dragon = new RiotSharp.Endpoints.StaticDataEndpoint.DataDragonEndpoints(ddragon); var nidaTask = dragon.Champions.GetByIdAsync(72, "11.12.1"); var nidaResult = nidaTask.Result; Console.WriteLine(nidaResult.Image.Full); // Prints "Skarner.png" var api = RiotSharp.RiotApi.GetDevelopmentInstance("hbiahbdiahbd"); var skarnerTask = api.DataDragon.Champions.GetByIdAsync(72, "11.12.1"); var skarnerResult = skarnerTask.Result; Console.WriteLine(skarnerResult.Image.Full); // Prints "Skarner.png"