question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Static Data champion, GetByKey returns RiotSharpException: 403, Forbidden

See original GitHub issue

I’ve been checking that it wasn’t me, testing with different keys. (The same happened to me with the GetSummonerByAccountIdAsync and 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[0]).Result.Image.Full;

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
SharkiCScommented, Jun 21, 2021

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.

0reactions
xXLaokoonXxcommented, Jun 21, 2021

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"
Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · BenFradet/RiotSharp
Looking for recommended approach to storing history data locally ... Static Data champion, GetByKey returns RiotSharpException: 403, Forbidden.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found