Bitcoin Forum
June 21, 2024, 08:50:35 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Cryptsy API help  (Read 515 times)
TYDIRocks (OP)
Full Member
***
Offline Offline

Activity: 213
Merit: 100


View Profile
August 04, 2015, 08:59:03 PM
 #1

Hey guys,

I'm trying to use the Cryptsy API and everything seems to be working except for the methods that require authentication...

Here is my current code: https://gist.github.com/anonymous/8c128bdab19b44eec2f7

Yet everytime I receive this response: {"success":false,"error":["Must be authenticated"]}

Can someone please help me, I cannot for the life of me figure out what I'm doing wrong.

Import new address/private keys with ease: https://bitcointalk.org/index.php?topic=101161
hexafraction
Sr. Member
****
Offline Offline

Activity: 392
Merit: 259

Tips welcomed: 1CF4GhXX1RhCaGzWztgE1YZZUcSpoqTbsJ


View Profile
August 04, 2015, 11:44:05 PM
 #2

Please also show the code of generateHMAC, with any private API keys removed/replaced with placeholders.

Edit: I dug up some old code. Here's how I've been doing it:

https://gist.github.com/hexafraction/83ffdf08ed7b44d004b9

In order to construct the parameter 'data', I've been creating a POST parameter string by way of String.format:

Code:
String params = String.format("foo=%s&bar=%s&number=%d", valOfFoo, valOfBar, System.currentTimeMillis());

This ensures that the parameters are in the same order as would be expected with HMAC.

I have recently become active again after a long period of inactivity. Cryptographic proof that my account has not been compromised is available.
TYDIRocks (OP)
Full Member
***
Offline Offline

Activity: 213
Merit: 100


View Profile
August 05, 2015, 02:20:14 AM
 #3

I'm not sure if that's correct. This is my hmac function: https://gist.github.com/anonymous/23f2597b19da01f36297

And, for example, this is what it returns: Br7UX6pke+gzxmEP8HUFXzNuIqPJlU+qfqMZiXeJ7N3oZ+fynQZ3g1D12nxNHFZDo0KWZZZ+Qxy4K7+OlUHBFw==

I don't think I need to change it into hexadecimal, I tried using your function and I get the same error.

Import new address/private keys with ease: https://bitcointalk.org/index.php?topic=101161
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!