Web API access with SHA-512 authentication

tacticaltrading

New Member
Joined
Feb 25, 2010
Messages
25
My goal is to access Cryptsy.com and pull lots of data into excel....

I have the simple public API working, (Thank you: jSon - Excel Liberation and excelent resource)
However, I am unable to perform and authenticate a secure http Post.

I need to perform the following PHP code using VBA

// generate the POST data string
$post_data = http_build_query($req, '', '&');
$sign = hash_hmac("sha512", $post_data, $secret);

Building $post_data is accomplished with a simple loop.
I need help generating the

$sign = hash_hmac("sha512", post_data, Key)
'/sha512 is the encryption, post_data is what is to be encryped, and key is the secret

Does anyone know how to make this happen in VBA?




the following is from https://www.cryptsy.com/pages/api
Authenticated Methods

Authenticated methods require the use of an api key and can only be accessed via the POST method.
URL - The URL you will be posting to is: https://www.cryptsy.com/api (notice it does NOT have the '.php' at the end)
Authorization is performed by sending the following variables into the request header:
Key — Public API key. An example API key: 5a8808b25e3f59d8818d3fbc0ce993fbb82dcf90
Sign — ALL POST data (param=val&param1=val1) signed by a secret key according to HMAC-SHA512 method. Your secret key and public keys can be generated from your account settings page.
An additional security element must be passed into the post:
nonce - All requests must also include a special nonce POST parameter with incrementing integer. The integer must always be greater than the previous requests nonce value.


Other Variables
method - The method from the list below which you are accessing.
General Return Values
success - Either a 1 or a 0. 1 Represents sucessful call, 0 Represents unsuccessful
error - If unsuccessful, this will be the error message
return - If successful, this will be the data returned
Method List
Method: getinfo
Inputs: n/a
Outputs: .....:= JSON formated object (which is another story)


Thanks in advance for any help or guidance

 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Haven't tried with sha512, but here's how to use System.Security.Cryptography.HMACSHA1 in VBA. HMACSHA512 should be similar.

Encoding client keys for Maps - Excel Liberation

Bruce



My goal is to access Cryptsy.com and pull lots of data into excel....

I have the simple public API working, (Thank you: jSon - Excel Liberation and excelent resource)
However, I am unable to perform and authenticate a secure http Post.

I need to perform the following PHP code using VBA

// generate the POST data string
$post_data = http_build_query($req, '', '&');
$sign = hash_hmac("sha512", $post_data, $secret);

Building $post_data is accomplished with a simple loop.
I need help generating the

$sign = hash_hmac("sha512", post_data, Key)
'/sha512 is the encryption, post_data is what is to be encryped, and key is the secret

Does anyone know how to make this happen in VBA?




the following is from https://www.cryptsy.com/pages/api
Authenticated Methods

Authenticated methods require the use of an api key and can only be accessed via the POST method.
URL - The URL you will be posting to is: https://www.cryptsy.com/api (notice it does NOT have the '.php' at the end)
Authorization is performed by sending the following variables into the request header:
Key — Public API key. An example API key: 5a8808b25e3f59d8818d3fbc0ce993fbb82dcf90
Sign — ALL POST data (param=val&param1=val1) signed by a secret key according to HMAC-SHA512 method. Your secret key and public keys can be generated from your account settings page.
An additional security element must be passed into the post:
nonce - All requests must also include a special nonce POST parameter with incrementing integer. The integer must always be greater than the previous requests nonce value.


Other Variables
method - The method from the list below which you are accessing.
General Return Values
success - Either a 1 or a 0. 1 Represents sucessful call, 0 Represents unsuccessful
error - If unsuccessful, this will be the error message
return - If successful, this will be the data returned
Method List
Method: getinfo
Inputs: n/a
Outputs: .....:= JSON formated object (which is another story)


Thanks in advance for any help or guidance

 
Upvote 0

Forum statistics

Threads
1,215,833
Messages
6,127,156
Members
449,367
Latest member
w88mp

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top