Error , request failed with status code 401

Please don’t post secrets in the thread. Deleting images that had the secrets.

@Yadu_Tyagi, Please share the curl request. Ensure that all secrets in the code are masked when you share it.

API is not login error is 401 please solve this issue reaply please mo no:- 9574253129. Client ID 736099

{ “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.brightextech.com/node/node_modules/axios/lib/core/createError.js:16:15)\n at settle (/var/www/software.brightextech.com/node/node_modules/axios/lib/core/settle.js:17:12)\n at IncomingMessage.handleStreamEnd (/var/www/software.brightextech.com/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=7B5Llr&client_id=109dd9f7-fdba-4817-9648-ff14aab79f75&client_secret=********&redirect_uri=https%3A%2F%2Fsoftware.brightextech.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”:190},“transformRequest”:[null],“transformResponse”:[null],“timeout”:0,“xsrfCookieName”:“XSRF-TOKEN”,“xsrfHeaderName”:“X-XSRF-TOKEN”,“maxContentLength”:-1,“maxBodyLength”:-1,“transitional”:{“silentJSONParsing”:true,“forcedJSONParsing”:true,"clarifyTimeoutError”:false}}}}

Please reply i am waiting your answer

Dear [API And Developer UPSTOX TEAM],

I hope this message finds you well.

I am writing to express my grave concern regarding the significant delays in the project deliverables. As of now, I have incurred considerable losses due to the lack of timely updates and progress on your part. Despite my repeated follow-ups over the past five days, there has been no substantial communication or resolution of the issues at hand.

This delay is causing severe disruptions and financial setbacks. I urge you to provide a clear timeline and expedite the resolution of these problems immediately. Your prompt attention to this matter is crucial to mitigate further losses.

If the situation is not addressed promptly, I will be compelled to explore alternative solutions, including registering a formal complaint with SEBI.

Thank you for your immediate attention and cooperation.

Sincerely,
Milanbhai Natrajbhai Parmar

@Milanp,

Apologies for the delayed response.

We’ll need more information to identify the issue. The error object you shared isn’t from Upstox. Please share the response you received from the API for further investigation.

Typically, the error message should be self-explanatory. For more information on possible error scenarios for this API, please refer to our documentation.

Thanks!

This error in my api connection basically
401 is a unauthorise error on (broker AC) admin means your side
So please this error solve
In this this image clearly mentioned see this attachment

Milanbhai Natrajbhai parmar
9574253129

(attachments)

@Milanp,

The issue with your request is that the redirect_uri you are passing does not match the one you registered. Please check and try again.

Additionally, the response from the API provided a more descriptive error message:

{
  "error_code": "UDAPI100070",
  "message": "The 'redirect_uri' provided is invalid. Please enter the valid URI and try again."
}

It would be helpful to log the error code and message sent by the API and share them in the future if you encounter issues.

Thanks!