The access token has a 30 days duration, so it must be renewed when it expires.
You can find all the information you need here.
Notice that our client libraries already take into account our authentication process. We strongly recommend to use one of them and open a pull request if it is missing anything, we will be reactive to any of your PR.
I just tried to renew my access token by following the given instructions, but I’m still getting an error. When I send a post request to https://api.sandbox.stuart.com/oauth/token, with all the required info in the body i.e client_id, client_secret, grant_type and api; I get this error:
{
"error": "invalid_client",
"error_description": "Client authentication failed due to unknown client, no client authentication included, or unsupported authentication method."
}
If it is still not working, can you please give me the email address you are using?
Could you also give me an example of the request you are sending (without the client_id and client_secret) ?
Hello @Harold !
I’m using the Integrations Middleware https://middleware-docs.stuart.com
Sandbox : **https://integrations.sandbox.stuart-apps.solutions/api**
Production : **https://integrations.stuart-apps.solutions/api**
Unfortenatually i’m facing the mentioned error :
{
"error": "INVALID_GRANT",
"message": "The access token was revoked"
}
while when i use **(https://api.sandbox.stuart.com/oauth/token)** for the sandbox or **https://api.stuart.com/oauth/token** for the production for example it works correctly
Alternatively, please make sure you are using the production client ID and secret found here Stuart, while pointing to the Integration middleware production environment https://integrations.stuart-apps.solutions/api
Please let me know once you have retested and can confirm the correct credentials is in use and is pointing to the correct environment or if you have any further issues.
The Integrations middleware is a proxy of Stuart’s API which mirrors (proxies) its endpoints but intercepts certain endpoints to apply custom logic.
I would recommend using just the Stuart API, as you have the same capabilities required for your integration.
May I also ask why initially you wanted to use the middleware as this may help my recommendation?
Feel free to continue this discussion and provide details via direct messaging.