error while validating refresh token

hi, trying to save the refresh token and revalidate it for further use but it gives error of

{'code': -16, 'message': 'Could not authenticate the user', 's': 'error'}

here is my code

url = 'https://api-t1.fyers.in/api/v3/validate-refresh-token'
data = {"grant_type":"refresh_token",
                    "appIdHash":appidhash,
                    "refresh_token":refresh_token,
                    "pin":pin}
response = requests.post(url, json = data)
try:
                access_token=response["access_token"]
                return access_token
except:
                print(response)

created appidhash buy converting “app_id:secret_key” into sha256.

Is this the correct way? is there built-in method to do this validation instead without using requests?

Not an issue with appIdHash

Generate new access and refresh tokens using new auth code. Check if the issue persists with new ones as well.

Hi @112434405953140702962

Thats the correct way of appidhash generation , can you please check by creating fresh authcode once