Poloniex API – Invalid API key\
Get via App Store Read this post in our app!
Poloniex API – Invalid API key\/secret pair [closed]
I can’t generate elementary private request.
After Four hour using Swift for it, I begin attempting to generate request in browser.
So I want to get all balances. instruction=returnBalances
Randome integer nonce=23455
That info together I have to convert to “HMAC-SHA512”. So I use online generator – quickhash.com, choose SHA-512(SHA2), choose “Use HMAC Method”, put inwards my API Key, and choose Base64 encoding.
After that, I have this – fu66g4WfjyJOrjfPtmWoaZGn1v6NK+YeiiKklD5EWfkvfXpBeCQE41Cg7jemh/Q/1yaLBvkxhoX2vpe2949IOA==
and then, I have to make link, for request. Okay:
Can somebody help? Where my mistake?
closed as off-topic by jww, Ronak Shah, Billal BEGUERADJ, Soren, Ken Herbert Jun 1 at Four:16
This question emerges to be off-topic. The users who voted to close gave this specific reason:
- ",Questions seeking debugging help (",why isn’t this code working?",) must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Accomplish, and Verifiable example.", &ndash, jww, Ronak Shah, Billal BEGUERADJ, Soren, Ken Herbert
If this question can be reworded to fit the rules in the help center, please edit the question.
You are doing a GET -request. You have to do a POST -request for private functions. From the documentation:
All calls to the trading API are sent via HTTP POST to https://poloniex.com/tradingApi and must contain the following headers:
Additionally, all queries must include a “nonce” POST parameter. The nonce parameter is an integer which must always be greater than the previous nonce used.
That means Key and Sign are sent inwards the HTTP-Headers. The rest ( directive , nonce ) are part of the bod.
- Let’s say your API-Key is 123 and your API-Secret is 456.
- The parameters for a request to returnBalances are directive=returnBalances&,nonce=1473087174 . Please note: The nonce -parameter must be enlargened with every request. It is recommended to use the current timestamp.
- You sign directive=returnBalances&,nonce=1473087174 using HMAC-SHA512 and your secret (456). The result will be put into the Sign -Header.
- You put your API-Key (123) into the Key -Header.
- You put the request parameters guideline=returnBalances&,nonce=1473087174 into the request-body.
- You send your request to https://poloniex.com/tradingApi using the POST -method and using SSL-encryption.
Doing this over your browser will not work unless you use third-party-software/plugins which permit you to modify the request-headers, etc.