Hi Kayal,
This error usually indicates that the token request is invalid. Common reasons for this issue:
The refresh token is expired, revoked, or invalid
Client ID or Secret mismatch
Issues in the token endpoint or headers (like missing Content-Type
)
The token endpoint not supporting refresh with the same auth code
You can try the following:
Double-check your Client ID, Client Secret, Redirect URI, and Scope values to ensure they're consistent.
Enable REST logging and check the response body of the 400 error, it often contains useful details (e.g., if the token is expired or invalid).
Make sure you're using the latest version of the Email Connector module from the Mendix Marketplace.
To avoid high memory usage:
Avoid calling token refresh in a tight loop.
Use a Scheduled Event to refresh the token every 30–45 minutes instead of refreshing during peak usage.
Thanks
Guna