ApiCall Class and Enums
DEFINITIONS ON URL
LolApiName
- URL: https;//euw1.api.riotgames.com/lol/ static-data /v3/champions/45?locale=en_US&tags=all
var rit = new ApiCall()
.SelectApi<ChampionListDto>(LolApiName.StaticData)//<==
LolApiMethodName
- URL: https;//euw1.api.riotgames.com/lol/static-data/v3/ champions /45?locale=en_US&tags=all
var rit = new ApiCall()
.SelectApi<ChampionListDto>(LolApiName.StaticData)
.For(LolApiMethodName.Champions)//<==
ApiParameter
- URL: https;//euw1.api.riotgames.com/lol/static-data/v3/champions/ 45 ?locale=en_US&tags=all
var rit = new ApiCall()
.SelectApi<ChampionDto>(LolApiName.StaticData)
.For(LolApiMethodName.Champions)
.AddParameter(new ApiParameter(LolApiPath.OnlyId, (long)45))//<==
LolApiPath (PATH PARAMETERS)
ORDER IS IMPORTANT
this is key of ApiParameter. for example:
- BySummoner : is equal to
by-name/{summonerName}
on url - OnlySummonerId: is equal to
{summonerId}
on url - ByAccount : is equal to
by-account/{accountId}
on url - OnlyId: is equal to
{Id}
on url
HELP
more information about Riot Games url request structure in here
https://developer.riotgames.com/api-methods/#summoner-v3
var rit = new ApiCall()
.SelectApi<ChampionDto>(LolApiName.StaticData)
.For(LolApiMethodName.Champions)
.AddParameter(new ApiParameter(LolApiPath.OnlyId, (long)45))//<==order is important
//to create a url path
ServicePlatform & PhysicalRegion
- URL: https;// euw1 .api.riotgames.com/lol/static-data/v3/champions/45?locale=en_US&tags=all
- PhysicalRegion : for the tournament api
- ServicePlatform : for the all other api types (default)
var rit = new ApiCall()
.SelectApi<ChampionDto>(LolApiName.StaticData)
.For(LolApiMethodName.Champions)
.AddParameter(new ApiParameter(LolApiPath.OnlyId, ChampionId))
.Build(ServicePlatform.EUW1)//<==
.UseCache(false)
Optional Parameters (QUERY PARAMETERS)
- URL: https;//euw1.api.riotgames.com/lol/static-data/v3/champions/45?locale=en_US&tags=all
- optional parameters only for static-api requests and tournament-api requests
- QueryParameter : VALUE OF OPTIONAL PARAMETER
var rit = new ApiCall()
.SelectApi<ChampionListDto>(LolApiName.StaticData)
.For(LolApiMethodName.Champions)
.AddParameter(new ApiParameter(LolApiPath.OnlyId, ChampionId))
.Build(ServicePlatform.EUW1)
.UseCache(false)
.Get(new QueryParameter("locale", "en_US"));//<==
ItemTag
- URL: https;//euw1.api.riotgames.com/lol/static-data/v3/champions/45?locale=en_US&tags=all
- value of tags
var rit = new ApiCall()
.SelectApi<ChampionListDto>(LolApiName.StaticData)
.For(LolApiMethodName.Champions)
.AddParameter(new ApiParameter(LolApiPath.OnlyId, ChampionId))
.Build(ServicePlatform.EUW1)
.UseCache(false)
.Get(new QueryParameter("locale", "en_US"),//<==
new QueryParameter("tags", ItemTag.all));//<== tags can be used multiple
Updated about 7 years ago