{“msg”:“error”,“data”:{“message”:“Request failed with status code 401”,“name”:“Error”,“stack”:“Error: Request failed with status code 401\n at createError (/var/www/software.goproinfotech.com/node/node_modules/axios/lib/core/createError.js:16:15)\n at settle (/var/www/software.goproinfotech.com/node/node_modules/axios/lib/core/settle.js:17:12)\n at IncomingMessage.handleStreamEnd (/var/www/software.goproinfotech.com/node/node_modules/axios/lib/adapters/http.js:269:11)\n at IncomingMessage.emit (node:events:525:35)\n at endReadableNT (node:internal/streams/readable:1358:12)\n at processTicksAndRejections (node:internal/process/task_queues:83:21)”,“config”:{“url”:“https://api-v2.upstox.com/login/authorization/token",“method”:“post”,“data”:“code=********&client_id=*******&client_secret=************&redirect_uri=https%3A%2F%2Fsoftware.goproinfotech.com%2Fupstox%2Faccess_token&grant_type=authorization_code”,“headers”:{“Accept”:“application/json”,“Content-Type”:“application/x-www-form-urlencoded”,“Api-Version”:“2.0”,“User-Agent”:“axios/0.21.4”,“Content-Length”:191},“transformRequest”:[null],“transformResponse”:[null],“timeout”:0,“xsrfCookieName”:“XSRF-TOKEN”,“xsrfHeaderName”:“X-XSRF-TOKEN”,“maxContentLength”:-1,“maxBodyLength”:-1,“transitional”:{“silentJSONParsing”:true,“forcedJSONParsing”:true,"clarifyTimeoutError”:false}}}}
Refer to the example code provided here for obtaining the access token: Get Token | Upstox Developer API.
If you’re still encountering issues, please request assistance with a curl command for deeper analysis.
Remember to avoid revealing any sensitive details, such as secret keys, on public forums.