Error 401 when request Job pricing

Hi,

I’m integrating stuart api in my python develop in sandbox. I can obtain access_token, but when I request for job pricing I received an 401 error: {“error”:“INVALID_GRANT”,“message”:“The access token was revoked”}
Can anyone help me?

Thanks

Hi @emiceru,

Are you requesting a new access token before each request you make to our API such as the pricing request?

We usually find that this error is the result of replica lag on our side, and so if you cache the token until it expires this error usually goes away. Additionally to be on the safe side you can leave a small lag such as 10 seconds after receiving a new access token and the subsequent call you make to our API to safely avoid any replica lag related errors.

Hi,

No, I request for a new token once and store it. After when I received a 401 error I request for a new access token

I’ve testing adding a delay of 10 seconds between Ireceived first time access token and i sent the next request and I receive the same error

@emiceru,

Can you please send us a private message, including the whole API request of the token request, our response, and then the request with the 401 response?
We would especially like to see the headers that you are sending, and the headers our servers are returning.

Thank you.

I’ve just sent you an email

Thanks

I’ve resolve the issue.

It was my fault. I was sending Authorization header surrounded with ’ characters.

Thanks for support

2 Likes

An update on the advice mentioned in this topic to:

The known issue of replica delay which was causing some integrators to experience “token revoked” errors has now been resolved on our platform. Although adding a delay as mentioned above will certainly cause no harm, it is no longer a requirement as the replica sync issue has been resolved at it’s core. Our tips and best practices regarding authentication can now be found in our related oAuth authentication post.