Getting error UDAPI10000 - This request is not supported by Upstox API

Hi Folks,

I was trying to access the token by calling

https://api-v2.upstox.com/login/authorization/token.

{
    "status": "error",
    "errors": [
        {
            "errorCode": "UDAPI10000",
            "message": "This request is not supported by Upstox API",
            "propertyPath": null,
            "invalidValue": null,
            "error_code": "UDAPI10000",
            "property_path": null,
            "invalid_value": null
        }
    ]
}

Unfortunately, I am getting a bad request error from Postman. Could someone please guide me on what’s wrong with my request.

The Content-Type used for this request is wrong. Please set the content type to application/x-www-form-urlencoded and try again.

Thanks!!

Worked like a charm. Thank you very much

1 Like

const tokenUrl = ‘https://api-v2.upstox.com/login/authorization/token’;

const tokenData = {
code,
client_id: apiKey,
client_secret: secretKey,
redirect_uri: redirectUri,
grant_type: ‘authorization_code’
};

const tokenConfig = {
headers: {
‘Content-Type’: ‘application/x-www-form-urlencoded’,
‘Api-Version’: ‘2.0’,
‘accept’: ‘application/json’
}
};

axios.post(tokenUrl, querystring.stringify(tokenData), tokenConfig)
.then(response => {
const json_response = response.data;
console.log(JSON.stringify(json_response));
})
.catch(error => {
console.error(error.response.data);
});
shri@shri-HP-EliteBook-840-G3:~/Downloads/upstox$ node login.js
{
status: ‘error’,
errors: [
{
errorCode: ‘UDAPI100057’,
message: ‘Invalid Auth code’,
propertyPath: null,
invalidValue: null,
error_code: ‘UDAPI100057’,
property_path: null,
invalid_value: null
}
]

@mi_unknown

Thank you for reaching out to us.

The error ‘UDAPI100057’ usually occurs when the authentication code provided to the token API is invalid. This can happen either because the code itself is incorrect or it has been used more than once, as it is intended for a single use only.

For more immediate assistance with errors, you may consult the API’s 4XX response section, where you’ll find details on error codes specific to this API.

For general error code information, please visit: Error codes | Upstox Developer API.

We have compiled comprehensive documentation to empower our users to resolve issues independently, without needing extensive support. I highly recommend reviewing each API’s documentation thoroughly before implementation.

However, please remember that we are always here to assist you with any issues you may encounter.

Thank you!

Hi,
I’m getting a similar error on trying to call the token API.
I have reviewed the API a few times now and still getting the same error.

I have set Content-Type and Accepts header values as well. I was trying this in Java just to see if I’m not making a mistake but getting similar issue on Postman.

@natarajmb

Thank you for writing to us.

Could you please share the cURL command for this request so that we can assist you better?

Thank you!

This is the CURL extract from the Postman

curl --location 'https://api-v2.upstox.com/login/authorization/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Accept: application/json' \
--header 'Cookie: _cfuvid=Y_Box549krmZ3hHIzGFTkg.RMOAYyjlyBBld8aDpGsk-1705592436713-0-604800000' \
--data-urlencode 'code=0xxx' \
--data-urlencode 'client_id=5c5ea3xx-xxx-xxxx-xxxx-xxxxxxxxx' \
--data-urlencode 'client_secret=9xxxxxxxx' \
--data-urlencode 'redirect_url=https://remote.cloudnative.dev/redirect' \
--data-urlencode 'grant_type=authorization_code'

I have tried with a new endpoint as well and get the same error.

It seems there is a typo in the code related to redirect_uri. Currently, it is written as redirect_url. Could you correct it and try again?

I have confirmed and tested the above code by changing the value from redirect_url to redirect_uri.

duh… apologies I should have checked it before. It works.
I thought I copied it from a sample.

Thanks for confirming. Please migrate your URL from https://api-v2.upstox.com/ to https://api.upstox.com/v2.