Issue with Access Token Generation

Hi!

I am writing to request assistance with an issue I'm facing while trying to generate an Access Token for my Fyers app in JavaScript.

Despite following the Fyers API documentation and verifying my code multiple times, I consistently encounter the following error when making a POST request to the /access-token endpoint:

"Exception: Request failed for https://api.fyers.in returned code 500. Truncated server response: {'s': 'error', 'code': 500, 'message': 'Invalid Request, please provide valid method'} (use muteHttpExceptions option to examine full response)"

I have ensured that the request method is correctly set to POST, and that all the required parameters (grant_type, code, client_id, secret_key, redirect_uri) are included in the request body with the correct values.

The relevant code snippet is in the attached Txt file.

I have tried regenerating the Auth Code and using different variations of the code, but the error persists.

Could anyone please investigate this issue and provide any guidance or suggestions for resolving it?

Thank you for your time and assistance.



4 replies