Refresh Token not working

Trying to refresh the token using the below as per documentation but it returns the error
Status: 400
Response: {“errorType”:“Input_Exception”,“errorCode”:“DH-905”,“errorMessage”:“Missing required fields, bad values for parameters etc.”}

Code
headers = {
“access-token”: access_token,
“client-id”: client_id # use client-id (same as profile)
}

resp = requests.post(url, headers=headers)
print(“Status:”, resp.status_code)
print(“Response:”, resp.text)

Hey @HJS_DVK ,

We are unable to clearly understand the exact nature of your query with the given information.

However, if you are trying to generate an access token using the API key and TOTP process, please refer to the following link:

If this isn’t your exact query, we request you to please share more detailed information at help@dhan.co so we can assist you better

I’m also facing same error while trying to renew token as per documentation
Response Code 400.
Response Text {“errorType”:“Input_Exception”,“errorCode”:“DH-905”,“errorMessage”:“Missing required fields, bad values for parameters etc.”}

Trying as per doc
Endpoint - ‘https://api.dhan.co/v2/RenewToken
–header ‘access-token: {Valid JWT Token}’
–header ‘dhanClientId: {Client ID}’

Was this resolved for you ?

As you can see in the image, the token is active and returns the order list with status as success but the renewtoken when used as mentioned in your api docs, it gives the missing required field issue

Hey @SumanKJana @HJS_DVK

Can you share your cURL requests?

@HJS_DVK from your earlier shared python snippet, it appears that you are using POST method instead of GET for this.

@Hardik, thanks for your reply…currently the issue is resolved for me…I was using POST instead of GET. You may update the API doc.

1 Like

Hey @SumanKJana

The documentation already mentions this as a simple cURL request - GET. Great to know it is working for you now.