Api login issues

I am unable to login with API IT SHOWS ERROR MESSAGE AFTER ADDING PIN
![IMG_3772|231x500]

Below given message shows

(upload://2VbVkz307ThDL8dl4EP1fdWP0Ft.png)
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.brightenvision.in/node/node_modules/axios/lib/core/createError.js:16:15)\n at settle (/var/www/software.brightenvision.in/node/node_modules/axios/lib/core/settle.js:17:12)\n at IncomingMessage.handleStreamEnd (/var/www/software.brightenvision.in/node/node_modules/axios/lib/adapters/http.js:269:11)\n at IncomingMessage.emit (events.js:412:35)\n at endReadableNT (internal/streams/readable.js:1333:12)\n at processTicksAndRejections (internal/process/task_queues.js:82:21)”,“config”:{“url”:“https://api-v2.upstox.com/login/authorization/token",“method”:“post”,“data”:“code=QCURot&client_id=c4dd6fb0-5991-4e66-98ea-5f5d3a83a4cf&client_secret=******&redirect_uri=https%3A%2F%2Fsoftware.brightenvision.in%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}}}}

The error code 401 indicates that the authorization process has failed.

Please ensure that all parameters in the URL are correctly passed.

  1. code → The code is a unique parameter included in the URL upon a successful Authorize API authentication.
  2. client id → The API key obtained during the app generation process.
  3. client secret → The API secret obtained during the app generation process.
  4. redirect url → The URL provided during app generation.
  5. grant_type → This value must always be authorization_code .