Comments (8)
That should never happen... Could you post a full example of the code used? with the entire error?
from r4j.
The odd thing is the same code works just fine in other projects...
The line where the error occurs is the case 403 in DataCallBuilder but with the odd responseData
The entire error is:
Exception in thread "main" no.stelar7.api.l4j8.basic.exceptions.APIResponseException: The API denied your request!
Your API key might be invalid
You may be trying to call a endpoint you dont have access to
or if you just regenerated it; wait a few seconds, then try again
<?xml version="1.0" encoding="UTF-8"?><Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>3A4EE40855A16893</RequestId><HostId>jGVmiuWohnyxTMKUtfgXoFhkczK0osH3epw66kDeVU1ktImfUhScOnpdIQdm+9VCsLk9Kn+HMMA=</HostId></Error>
at no.stelar7.api.l4j8.basic.calling.DataCallBuilder.build(DataCallBuilder.java:89)
at no.stelar7.api.l4j8.impl.raw.MatchAPI.getMatchList(MatchAPI.java:105)
at mining.apis.riotapi.Requests.getListOfRecentGames(Requests.java:22)
The code is very straight forward:
public static List<MatchReference> getListOfRecentGames(long accountId) {
Set<GameQueueType> queueTypes = new HashSet<>();
queueTypes.add(GameQueueType.TEAM_BUILDER_RANKED_SOLO);
return l4j8.getMatchAPI().getMatchList(region, accountId, null, null, null, null, queueTypes, null, null);
}
static APICredentials credentials = new APICredentials(apiKey);
static L4J8 l4j8 = new L4J8(credentials);
static Platform region = Platform.EUW1;
Also this is only one method where the error occures, if i make a okhttp request (which works) other methods also throw this odd error.
It's so weird that it works in other similar projects. I reimported the whole maven dependency list automatically and manually several times.
I hope you can help but don't worry if you can't :)
from r4j.
I am unable to reproduce your error.. 🤔
Try adding DataCall.setLogLevel(LogLevel.DEBUG);
at the start of your method, then post that output.
(like this)
from r4j.
Cool that's a nice feature. I got a lot of information:
DEBUG: RateLimit{permits=20, delayInMs=1000}: current call count: 1
DEBUG: RateLimit{permits=100, delayInMs=120000}: current call count: 6
DEBUG: Loaded ratelimit for V3_MATCHLIST
DEBUG: RateLimit{permits=1000, delayInMs=10000}: current call count: 1
INFO: Trying url: http://ddragon.leagueoflegends.com/lolmatchv3matchlists/by-account/34933969?queue=420
EXTENDED_INFO: URL : http://ddragon.leagueoflegends.com/lolmatchv3matchlists/by-account/34933969?queue=420
Request Method : GET
POST :
Request Headers :
Accept-Charset : [ISO-8859-1,utf-8]
X-Riot-Token : [RGAPI-50c90dd7-6841-4e30-a005-07be8acbed49]
Cache-Control : [no-store,max-age=0,no-cache]
User-Agent : [L4J8]
Pragma : [no-cache]
Expires : [0]
Accept-Language : [en-US]
Content-Type : [application/json]
EXTENDED_INFO: Response Headers :
EXTENDED_INFO: Transfer-Encoding : [chunked]
EXTENDED_INFO: null : [HTTP/1.1 403 Forbidden]
EXTENDED_INFO: X-Cache : [Error from cloudfront]
EXTENDED_INFO: Server : [AmazonS3]
EXTENDED_INFO: Access-Control-Allow-Origin: [*]
EXTENDED_INFO: Access-Control-Allow-Methods: [GET, HEAD]
EXTENDED_INFO: Connection : [keep-alive]
EXTENDED_INFO: X-Amz-Cf-Id : [pGpA2Qt8lMk2F_-efsLmV496gOf852ZOlM8lcFGQQesl6Cba3Q_0GA==]
EXTENDED_INFO: Access-Control-Max-Age : [3000]
EXTENDED_INFO: Date : [Tue, 31 Jul 2018 17:52:43 GMT]
EXTENDED_INFO: Via : [1.1 c205f1b841011a5b4b893843ca879e5a.cloudfront.net (CloudFront)]
EXTENDED_INFO: Content-Type : [application/xml]
DEBUG: Header 'X-App-Rate-Limit' missing from call: http://ddragon.leagueoflegends.com/lolmatchv3matchlists/by-account/34933969?queue=420
DEBUG: Header 'X-Method-Rate-Limit' missing from call: http://ddragon.leagueoflegends.com/lolmatchv3matchlists/by-account/34933969?queue=420
EXTENDED_INFO: DataCallResponse
{
responseCode=403
responseData=
<?xml version="1.0" encoding="UTF-8"?><Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>930356C14B487244</RequestId><HostId>GyLW52x+whUeRPnpkVRZ7GPWpa5Wk84cuvqsSdwl/6jcZIyr2XOGT3nG9N67sRZzWHZR3Yhx0vg=</HostId></Error>
}
Exception in thread "main" no.stelar7.api.l4j8.basic.exceptions.APIResponseException: The API denied your request!
Your API key might be invalid
You may be trying to call a endpoint you dont have access to
or if you just regenerated it; wait a few seconds, then try again
<?xml version="1.0" encoding="UTF-8"?><Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>930356C14B487244</RequestId><HostId>GyLW52x+whUeRPnpkVRZ7GPWpa5Wk84cuvqsSdwl/6jcZIyr2XOGT3nG9N67sRZzWHZR3Yhx0vg=</HostId></Error>
at no.stelar7.api.l4j8.basic.calling.DataCallBuilder.build(DataCallBuilder.java:89)
at no.stelar7.api.l4j8.impl.raw.MatchAPI.getMatchList(MatchAPI.java:105)
at mining.apis.riotapi.Requests.getListOfRecentGames(Requests.java:24)
at mining.DataMinerController.getUserGames(DataMinerController.java:53)
at mining.DataMinerController.addNewGames(DataMinerController.java:47)
at mining.DataMinerController.run(DataMinerController.java:137)
at Main.main(Main.java:17)
I'm not sure but the URL looks odd to me 😄
from r4j.
oh.. that.. hmm.. Do you use the DDragon api somewhere in your code?
from r4j.
Yap to get the versions. Is that the problem?
from r4j.
Yeah, that seems to be it. I've fixed it in V1.5.6 (5f85ed2)
from r4j.
Thanks
from r4j.
Related Issues (20)
- Cant get tests to run/ Forbidden code HOT 2
- Cannot resolve method 'getSummonerName' in 'MatchParticipant' HOT 1
- Fixing ImageAPI.getSplashArt() methods
- Add Emerald tier type for League HOT 3
- Support for CDragon
- Support Spectators on the Tournament Codes. HOT 2
- The ENUM GameQueueType is missing Team Deathmatch HOT 1
- GameModeType "CHERRY" does not exist HOT 2
- Type: RealmSpesificEnum -> RealmSpecificEnum HOT 1
- README should mention this project's features
- Interested in refactoring or rewriting the cache?
- Support the v5 Tournament API HOT 1
- Support for queue type 490 HOT 4
- GameQueueType is missing the type 1710.0 HOT 2
- getMatchList passes an invalid count to Riot's API HOT 2
- Choosing what to cache HOT 1
- SpectatorAPI not working as exptected (gets old game) HOT 1
- Support for account-v1
- Cache issue with Account-V1 API
- Rate limit tracking while using threads HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from r4j.