Poloniex api 403 error

1k views Asked by At

I am using this code to write a bottrader,in python3 (converted 2to3) https://pastebin.com/fbkheaRb

except that i have change secret string and post_data string to byte

sign = hmac.new(self.Secret.encode("ASCII"), post_data.encode("ASCII"), hashlib.sha512).hexdigest()

but getting below error

urllib.error.HTTPError: HTTP Error 403: Forbidden

have checked key and secret key multiple time and it is correct Also deleted the existing key and created new Also relaxed all IP

then also got the same problem, please help

1

There are 1 answers

3
A. STEFANI On

You don't need to encode to ASCII, so you may try:

sign = hmac.new(self.Secret, post_data, hashlib.sha512).hexdigest()