For a deeper look into our World Check One API, look into:
Hi,
I have been trying to create a sample API integration project using Python. I have tried to follow the steps as in Postman and as in the Java Sample World Check Application from the Downloads section.
When I run the code, I keep getting the 401 Unauthenticated Error. I believe it is due to the incorrect generation of the hmac. When trying with the same date variable in Postman and Python, the signatures don't match.
Could you please provide a sample code which would help me generate the proper signature so that I can get a groupId as the response? (The response is 200 when doing the same from POSTMAN)
P.S. I have tried using one of the sample code for provided for Python from one of the solutions posted here. That does not seem to work. I tried different methods for generating a similar hmac as CryptoJS does, but it did not work out for me.
Thanks,
Aman
Request Headers:
{'User-Agent': 'python-requests/2.24.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Authorization': 'Signature keyId="8908a09e-5118-4087-8413-25e20c3867b3",algorithm="hmac-sha256",headers="(request-target) host date",signature="rGGF4v6LRG5h6Cucl7cgzEYpW4OC97xwYueDP3KjYtk="', 'Date': 'Mon, 21 Sep 2020 01:25:40 GMT'}
Response Headers:
{'Strict-Transport-Security': 'max-age=15552000, includeSubdomains', 'Authorization': 'WWW-Authenticate: Signature realm="World-Check One API",algorithm="hmac-sha256",headers="(request-target) host date content-type content-length"', 'Date': 'Mon, 21 Sep 2020 01:25:41 GMT', 'Server': '""', 'Content-Length': '0', 'Age': '430', 'Via': 'HTTPS/1.1 BFAMPHKGWCG01'}
gatewayurl = "/v1/" gatewayhost = "rms-world-check-one-api-pilot.thomsonreuters.com"
dataformat = ("%a, %d %b %Y %H:%M:%S GMT") datenow = time.gmtime() date = time.strftime(dataformat, datenow)
I have dropped you an email so we may investigate further on this.