access_keycan be found in API Token page.
There are two kinds of API interfaces for developers:
|PUBLIC API||PRIVATE API|
|Verification||No Verification||Require Verification|
|Application Frequency||No Limitation||600 requests / 5 mins|
|Preparations||No Preparation Required||Use your API Token page to get access/secretkey|
Before applying for Private API signature, you should prepare your access/secret_key. These materails could be found in the API Token page after registration.
All Private API users need the following 3 parameters when doing identity verification:
The generation process of signature is simple. First, the application should be transfer into a character string. Then use this character string to do HMAC-SHA256 calculation:
payload is representing the applied character string, it could be fomulate by using HTTP method. The application address and parameter is listed below.
secret key is
yyy, then using HMAC-SHA256 algorithm to calculate the
payload mentioned above, the result is(use hex to illustrate).
Now, we could make application by using this signature(use curl for example):
If API call failed, the return will use HTTP status code. Also, the return include detail error information showing JSON data. For example:
All the errors have the same format according to the above sentence, the only differences are
message. Code is the custom error defined by Peatio, it illustrates the category of the error. Message is detail error information.
For complete API application, Peatio will return
200 for JSON data.
Cancel order and cancel all the orders are asynchronous operations, API return complete only means cancel application has been submitted, it doesn't mean your order has been canceled. If you have orders which haven't been processed or the cancel queue is busy, your cancel application will delay. API returns the canceled order, the return order may not be conceled. Your code should not rely on API retrun result. It should get the latest status by using "order inquiry interface".