Page 1 of 1

Invalid grant error

Posted: Mon Feb 22, 2021 11:55 pm
by rish
Hi ,

I am using simpro's OAuth api (/oauth2/token) to fetch a new refresh token , however, sometimes I get an Invalid grant error.
The invalid grant errors are totally random.
The simpro docs specify that a refresh token is valid for 14 days. So technically I should never get the invalid_grant error within that 14 day period.
Is there a cap on number of requests ?
What could be the reason of the refresh token expiring randomly?

Please advise.

Re: Invalid grant error

Posted: Tue Feb 23, 2021 12:55 am
by Muqeet
Hello Rish,

We actually need to update our documentation about refresh token expiry. Refresh token does not expire until it is used to fetch new set of tokens. There are no limits for now on number of requests.

Re: Invalid grant error

Posted: Tue Feb 23, 2021 1:06 am
by rish
Hey Muqeet,

That means we should never get invalid_ grant error as long as we've not issued a new refresh token , so what could be the reason of getting an invalid_grant response within the valid period? is it because there are too many request within a short time period ? Also it is totally random so I'm not sure what is causing that.

Re: Invalid grant error

Posted: Tue Feb 23, 2021 1:15 am
by Muqeet
If your integration is sending multiple request in short span of time, may be check if you are updating the new refresh token replacing it with the old one correctly every time. But then again as long as it stays random for you it wouldn't be easy to debug this.