E
E
Evgeny Ivanov2018-01-30 07:57:46
PHP
Evgeny Ivanov, 2018-01-30 07:57:46

How and what headers to transfer to the exchange (exchange api)?

Site liqui
API https://goo.gl/bpm1Gu
Public api implemented without problems. I'm trying to implement a trading.
Using the API of the exchange, I want to get information about my balance.
There is no experience - what they want to say and how to do it is not very clear to me yet.
API key created (maximum rights).
There is a secret key.
The nonce parameter will always be greater than the previous one (wrote the function).
Already worked with json response in public api.
Exchange instruction
Authentication
Authentication is performed by sending HTTP headers.
Key - your API key.
Signature - POST parameters (?nonce=1¶m0=val0) signed with a private key using HMAC-SHA512. For successful authentication, you must send a nonce value greater than the previous one.
Get information
Returns information about the user's balance, API key privileges, number of open orders, time on the server. To use this method, you need the info privilege on your key.

original in english
Authentication
Authentication is made by sending the following HTTP headers:
Key — API key. API key examples: 46G9R9D6-WJ77XOIP-XH9HH5VQ-A3XN3YOZ-8T1R8I8T. API keys are created in the Profile in the API keys section.
Sign — Signature. POST-parameters (?nonce=1&param0=val0), signed with a Secret key using HMAC-SHA512. For successful authentication you need to send a POST-parameter nonce with incremental numeric value for each request.
Method getInfo
Returns information about the user’s current balance, API-key privileges, the number of open orders and Server Time. To use this method you need a privilege of the key info.

As I understand it - first I have to pass the headers. How to do it, where to send it and how it should be?
I'm guessing something like this...
header('Location:https://api.liqui.io/api/3/getInfo');

But there you also need to pass the nonce=1¶m0=val0 parameters.
nonce - clear, always more than 1
param0=val0 - what, where and why are zeros...
And all this is signed with HMAC-SHA512 (hash_hmac). How to sign a string clearly, but what data to sign?
nonce=1¶m0=val0? Incremental nonce and null param0=val0? And where then to attach this line?
In general, nothing is clear. Can you help me figure it out?
How and what headers to transfer to the exchange (exchange api)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Boris Korobkov, 2018-01-30
@BorisKorobkov

As I understand it - first I have to pass the headers. How to do it, where to send it and how it should be?

php.net/manual/en/book.curl.php
It's just any parameter and any value. Which ones - read the documentation for a specific API.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question