Author

Topic: problem with nova api (Read 646 times)

member
Activity: 139
Merit: 10
October 01, 2017, 04:09:01 PM
#11
Hi gargouri20011

I think your problem lies in the way you create the signature.

Try changing
$signature = base64_encode(hash_hmac ( 'sha512' , $url , $api_secret ));

To :
$signature = base64_encode(hash_hmac('sha512', $url, $api_secret, true));

The last parameter of hash_mac needs to be true. If not specified, it's false by default and results in lowercase hexits instead of raw binary data.

Hope that helps Smiley
member
Activity: 71
Merit: 10
September 16, 2017, 01:05:44 PM
#10
thank for reply ,
i tried all:  empty header , header as content-type: application/x-www-form-urlencoded and header with key and secret key ($headers = array('Sign: '.$sign,'Key: '.$key,)Wink

Still same result

2) i am using php so i can see what is the output , that's all output i am getting .
3)no
3)according to header request is 200

4)would be g8
legendary
Activity: 1750
Merit: 1115
Providing AI/ChatGpt Services - PM!
September 15, 2017, 05:46:26 PM
#9
Hello
 $headers = array('content-type: application/x-www-form-urlencoded');
still same
block {"status": "error", "message": "Auth failed"}"  Embarrassed
1.Please edit your code in a nice code-block provided.
2.What do you see on the console ?
3.Have you used Post-Man for the analysis ?
4.Check if the error code is 405 in the response or your requests are going as options.
4.Headers might be needs to send along with the request to allow access.I can help you if you format the code nicely and figure out what exactly the problem is.
member
Activity: 71
Merit: 10
September 15, 2017, 05:37:42 PM
#8
Hello
 $headers = array('content-type: application/x-www-form-urlencoded');
still same
block {"status": "error", "message": "Auth failed"}"  Embarrassed
full member
Activity: 256
Merit: 102
September 14, 2017, 03:41:42 AM
#7
I was able find example on python https://novaexchange.com/remote/faq/
You need to add headers property maybe this helps.
member
Activity: 71
Merit: 10
September 12, 2017, 05:48:16 PM
#6
i don't understand this language that you are using but i have had the same issue with Novaexchange API too.
i see two things here:
1. i post to what you are calling "url" here not to "CURLOPT_URL"
2. your signature must be in base64!

#2 was my issue too. usually i convert the signature to hex or just the same bytes and post it, but with Nova you have to convert your HmacSha512 result into base64 and post that!

hello

i did :
$signature = base64_encode(basehash_hmac ( 'sha512' , $url , $api_secret )); //convert HmacSha512 to base64



Still same error {"status": "error", "message": "Auth failed"}
full member
Activity: 235
Merit: 250
September 12, 2017, 11:04:10 AM
#5
maybe their server have some problem. Many people complain about register and ticket system last week. Some hacker try to ddos them
legendary
Activity: 2114
Merit: 1293
There is trouble abrewing
September 12, 2017, 09:24:23 AM
#4
i don't understand this language that you are using but i have had the same issue with Novaexchange API too.
i see two things here:
1. i post to what you are calling "url" here not to "CURLOPT_URL"
2. your signature must be in base64!

#2 was my issue too. usually i convert the signature to hex or just the same bytes and post it, but with Nova you have to convert your HmacSha512 result into base64 and post that!
member
Activity: 71
Merit: 10
September 12, 2017, 06:18:14 AM
#3
Hello
{"status": "error", "message": "Auth failed"}
full member
Activity: 256
Merit: 102
September 12, 2017, 03:41:46 AM
#2
And what is result of the executing this script? It can be anything, please provide more description
member
Activity: 71
Merit: 10
September 11, 2017, 07:12:21 PM
#1
Hello
I am stuck in Auth failed when i try to use nova private API .
Here is the code :

/////////////////////////////////////////
$api_key = "xxxxxxxxxxxxxxxxxxxxxx" ;
$api_secret = "xxxxxxxxxxxxxxxxxxxxxx" ;

$t = time ();

$url = "https://novaexchange.com/remote/v2/private/" . "tradehistory" . "/?nonce=" . $t ;

$signature = hash_hmac ( 'sha512' , $url , $api_secret , true );


$ch = curl_init ();
$curlConfig = array(
CURLOPT_URL => "https://novaexchange.com/remote/v2/private/tradehistory" . "/?nonce=" . $t ,
CURLOPT_POST => true ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_SSL_VERIFYPEER => false ,
CURLOPT_POSTFIELDS => array(
'apikey' => $api_key ,
'signature' => $signature ,
)
);
curl_setopt_array ( $ch , $curlConfig );
$result = curl_exec ( $ch );


curl_close ( $ch );

echo $result ;
output === > {"status": "error", "message": "Auth failed"}
///////////////////////////////////////////

any idea what is wrong here ?
Jump to: