athombv / homey-web-api-issues

This issue tracker is for Homey Developers using the Web API.
4 stars 1 forks source link

429 (Too Many Requests) #52

Closed markusv closed 6 months ago

markusv commented 8 months ago

I am getting a 429 Too many requests response to https://api.athom.com/user/me. What is the actual rate limit here? How many requests are we allowed to make?

This is on the newest version of the homey api: 3.4.19. Strangely the homey web app on the same device does still work though

This is my code:


const loggedIn = await cloudApi.isLoggedIn();
if (!loggedIn) {
  if (cloudApi.hasAuthorizationCode()) {
    const token = await  cloudApi.authenticateWithAuthorizationCode();
  } else {
    window.location.href =  cloudApi.getLoginUrl();
    return;
  }
}
const user = await cloudApi.getAuthenticatedUser();
const homey = await user.getFirstHomey();
const homeyApi = await homey.authenticate();
Skjermbilde 2024-01-28 kl  19 23 11
jeroenwienk commented 6 months ago

I am getting a 429 Too many requests response to https://api.athom.com/user/me. What is the actual rate limit here? How many requests are we allowed to make?

This is on the newest version of the homey api: 3.4.19. Strangely the homey web app on the same device does still work though

This is my code:

const loggedIn = await cloudApi.isLoggedIn();
if (!loggedIn) {
  if (cloudApi.hasAuthorizationCode()) {
    const token = await  cloudApi.authenticateWithAuthorizationCode();
  } else {
    window.location.href =  cloudApi.getLoginUrl();
    return;
  }
}
const user = await cloudApi.getAuthenticatedUser();
const homey = await user.getFirstHomey();
const homeyApi = await homey.authenticate();
Skjermbilde 2024-01-28 kl 19 23 11

Rate limits are also based on a cloud-api client id. We are not going to communicate the current limits for this since they might change.

markusv commented 6 months ago

Thanks for the response. I am now using one of the new api keys. No rate limit with that it seems, so my problem is solved