Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

getDataChampion returning 403 #148

Open
AleTassi opened this issue Apr 5, 2019 · 2 comments
Open

getDataChampion returning 403 #148

AleTassi opened this issue Apr 5, 2019 · 2 comments

Comments

@AleTassi
Copy link

AleTassi commented Apr 5, 2019

Hi everyone
I'm trying to get the name of a champion from the id. Here's my code

public String getPlayedChampion(Summoner player) {
	
	try {
		CurrentGameInfo game = api.getActiveGameBySummoner(Platform.EUW, player.getId());
		
		CurrentGameParticipant participant = game.getParticipantByParticipantId(player.getId());
		
		Champion champ = api.getDataChampion(Platform.EUW, participant.getChampionId());
		
		return champ.getName();
	} catch (RiotApiException e) {
		log.warn("Error getPlayedChampion: {}", e.getMessage());
		return null;
	}
	
}

but the code always throw an error (403 - Forbidden).
I can't find the endPoint that the library try to call in the Riot Dev Site
How can i get the name of a champion?
Is there another java method/riot endpoint to get the name?
Thank you 😄

@KaluNight
Copy link

KaluNight commented Apr 12, 2019

This endpoint has been deprecated and is no more usable. Now you need to use ddragon (https://ddragon.leagueoflegends.com/cdn/dragontail-9.7.1.tgz). It contains all the assets of the game. You can load all the champions data you need with the JSON file named "champion.json" with a library like Gson (https://github.com/google/gson).

@Pankraz01
Copy link

Yes this means, your api key is invalid. I had this a moment ago, so I need to create a new key...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants