-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API Request is malformed #106
Comments
Hello @wafebreaker! All IDs you receive through the Riot API are encrypted with your API key (not directly, but a key tied too the api key). If you retrieve an ID using one API key (e.g., the development key) and later switch to a different key (e.g., your project's production key) while still using the old ID, you will receive this error. Your issue is probably linked to that. I hope this helps! |
Thanks for your reply! Im definetly only using one key for all requests. So this should not be my issue |
Yesterday, for example, I didn't even have the error. Today, it's been giving this error continuously for 10 minutes. And the requests today are exactly the same as yesterday (same key, same PUUID). Could this have something to do with Riot's server availability? |
i have been thinking of forcing types on the endpoint parameters to avoid this, but its far back on the list of things i have to do unfortunately. Feel free to post your code where the error happens, and maybe people can help you find the error |
As I said, both reasons are not possible for me. There are days when the error doesn't appear and days when it appears every minute. And currently only about 20 accounts are retrieved. The only thing I could imagine is the following: I have a thread running that calls a function every minute. In this function, all accounts are retrieved from the Riot API. Is it possible that if the requests are duplicated or overlap due to the longer response time from RIOT, then the ID is malformed? A short excerpt from the code: task that is executed every minute
Parts from the called function private static void checkMatchHistory() throws Exception {
(Code function doesn't work somehow) |
Is it possible that you store the wrong ID in the database? |
No, that shouldn't be possible. I retrieve the PUUID with the same key using name + tag. After that, the PUUID is stored in the DB and is no longer changed. |
These errors only occur with the SpecatorAPI. In the same code 2 lines below I retrieve matches with the same PUUID and that works without errors.: https://euw1.api.riotgames.com/lol/spectator/v5/active-games/by-summoner/********************** (i hided the number, dont know if its necessary) |
If you have the name/tag of a summoner that is failing, can you go to The endpoints are The puuid in the first request should be the same as the one that shows in the error message. If not, you have somehow ended up with an invalid id |
No, I think you misunderstood me. I pull the PUUID over the name + tag of a summoner. I then save this PUUID in the database. I use the same PUUID to query both the Spectator API and the MATCH API. However, I only get this error with the Spectator API, not the Match API. Even though it is the same PUUID. And the one in the error looks completely different (I assume it's because it's decrypted?) Example: The error message says something like this: |
Pastebin of the function: https://pastebin.com/NJqd5S1j the Line 15 (SpectatorGameInfo spectatorGameInfo = summoner.getCurrentGame();) throws the error. But the Function continues and pulles the matches with the same PUUID (Sorry for multiple posts) |
That seems very odd..
If the ID in the response and the request dont match, theres something changing your puuids somehow 🤔 |
Yeah i have logs enabled but the responsedata is missing? But i checked the last 2 hours of logs (in this time the error happens multiple times) and all i see are lines like this: 2024-11-12 10:40:35 [pool-2-thread-1] INFO n.s.a.r.b.calling.DataCallBuilder - Trying url: https://euw1.api.riotgames.com/lol/summoner/v4/summoners/by-puuid/S0MHH1ir28Jl4fPyQw0W0ls0NoiJaBjJY8ceD_xF63QcSr5ppEoRo4UEZhFPGHVHq_01g378lQNovA and this "group of three" of queries is always with the same puuid |
Your earlier message seems to imply they are different: #106 (comment) But if they are the same in all cases, that would be an issue with the RiotAPI. For the response you would need to set the log level to DEBUG by doing something like
|
That's what surprises me. The error from #106 is the one that is output in the console with " printStackTrace();" And the ID that is specified in the URL is definitely different (numbers separated by hyphens). But in the log itself the IDs are all identical But then it really seems to be an error from RIOT that the unencrypted data is being sent back |
I keep getting APIResponseExceptions with "Your API request is malformed". The URL for the call (/active-games/by-summoner/[puuid]) is strange because the PUUID specified consists of letters and numbers and is sometimes separated by hyphens. What also surprises me is that the error only occurs sporadically, sometimes not at all for days and then several times in a row. The exact response of the call is "Exception decrypting [...]"
The text was updated successfully, but these errors were encountered: