in reply to Re^2: POST API in Perl using LWP::UserAgent with authentication providing errors
in thread POST API in Perl using LWP::UserAgent with authentication providing errors
When I run the node.JS code below I get a header value of
amx PUBLIC KEY:leFWRGAm2eH6rm9t8hoHifpMpWPV5xMZcXtuhrQbUP0=:1516453770998Try the same values for keys and nonce in your code and compare
pojvar nonce = 1516453770998; var API_KEY = 'PUBLIC KEY' var API_SECRET = 'PRIVATE KEY'; var md5 = crypto.createHash('md5').update( JSON.stringify( {'Currency' +:"PAC"} ) ).digest(); var requestContentBase64String = md5.toString('base64'); var signature = API_KEY + "POST" + encodeURIComponent( 'https://www.cr +yptopia.co.nz/api/GetBalance' ).toLowerCase() + nonce + requestConten +tBase64String; var hmacsignature = crypto.createHmac('sha256', new Buffer( API_SECRET +, "base64" ) ).update( signature ).digest().toString('base64'); var header_value = "amx " + API_KEY + ":" + hmacsignature + ":" + nonc +e;
|
|---|