Sansossio / twisted

Fetching riot games api data
125 stars 47 forks source link

Using start query param return Bad request - java.lang.NumberFormatException: For input string: \\"1704931200000\\" #103

Closed Cuhadari-Deniz closed 9 months ago

Cuhadari-Deniz commented 10 months ago

After I called :

lolApi.MatchV5.list(puuid, RegionGroups.EUROPE, {
      start: matchMinimumDateInEpoch,
      count: 100,
      type: "ranked",
    });

i got this response:

  body: {
    status: {
      message: 'Bad request - java.lang.NumberFormatException: For input string: \\"1704931200000\\"',
      status_code: 400
    }
  }

matchMinimumDateInEpoch: const matchMinimumDateInEpoch: number = env.MATCH_MINIMUM_DATE.getTime(); // results in the number 1704931200000

As far as I can tell the LolApi Client is sending the start param as a string (wrapping it in quotation marks) therefor riots java api fails because it expected a number and not a string.

rleaf commented 10 months ago

Do you mean to use the startTime param, not start? In case you are, that param takes inputs in seconds not ms, so you'll have to env.MATCH_MINIMUM_DATE.getTime() / 1000.