Lohitha
 · Lohitha

Hashing Error: Please provide sha256 hash of appId and app secret Can someone suggest me am i correctly generating sha 256? from hashlib import sha256 import http.client import json api_id = 'QXXXY5PTC3-100' app_secret = '2MXXX7J1I4' appId_secret = api_id+app_secret h = sha256(appId_secret.encode("utf-8")) appIdHash = h.hexdigest() conn = http.client.HTTPSConnection("api.fyers.in") payload = json.dumps({ "grant_type": "authorization_code", "appIdHash": appIdHash, "code": auth_code }) headers = { 'Content-Type': 'application/json' } conn.request("POST", "/api/v2/validate-authcode", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) {"s": "error", "code": -371, "message": "Please provide sha256 hash of appId and app secret"}

8 replies