Bitcoin Forum

Bitcoin => Project Development => Topic started by: Veggy Toe on January 26, 2014, 04:32:19 PM



Title: Cryptsy API authentication error
Post by: Veggy Toe on January 26, 2014, 04:32:19 PM
So I'm having a problem authenticating on the cryptsy api (with python) here's my code:

            req['method'] = method # in this case, method is getinfo
            req['nonce'] = int(time.time())
            post_data = urllib.urlencode(req)
            sign = hmac.new(self.Secret, post_data, hashlib.sha512).hexdigest()
            headers = {
                'Sign': sign,
                'Key': self.APIKey
            }

            try:
                ret = urllib2.urlopen(urllib2.Request('https://www.cryptsy.com/api', post_data, headers))
                jsonRet = json.loads(ret.read())
                return self.post_process(jsonRet)
            except:
                print "server unresponsive"

and it's returning as unsuccessful.  Thank you in advance  :)