Private API


TriphiusFire
Gender: Unknown
Country: Unknown
Threads: 1, Posts: 3
#25

using the SubmitTranfer query I get {"Success":false,"Error":"Bad Request","Data":null} however every time the transfer actually goes through!

can someone fix this?  it will be very hard to confirm commissions without a correct json return on a succeccsful or unsuccesful transfer.  

thanks!



Posted: 8/10/2017 8:18:20 AM
Al_z
Gender: Unknown
Country: Unknown
Threads: 2, Posts: 22
#26

What happened to the encoding in response to json?

Private api responds to me: ܛ�s�H����\�� b�QT~(r��0*�u��

NVShad: 7/16/2017 7:41:12 PM

Hey, I'm finally almost finished my first private example, took me two weeks to get the authentication right! lol.
I decode my HTTP response with UTF-8-SIG.  Luckily Python hinted at the encoding for me so I wasn't left with the garbage you printed :P

Al_z: 7/17/2017 6:43:04 PM

 Did you plan to post the python examples somewhere? (ie: github)

reiven: 7/30/2017 4:53:31 PM

 Sorry, didn't see this reply.


https://github.com/doubleelforbes

I only have those 2 examples up atm, but I'm working on an all singing all dancing C++ interface now, that'll go up there too.

Everything seems to play ball except for my "Hangups" on the private API which I've highlighted in another thread.



Posted: 8/10/2017 2:35:31 PM
HughMacd
Gender: Unknown
Country: Unknown
Threads: 0, Posts: 1
#27

Is there any way to find out what closed out an open order? I'd like to be able to differentiate between orders that were fulfilled and orders that were cancelled.

 

What would be great would be the OrderId to be available in the result of GetTradeHistory, so that trades can be matched up against orders.

 

Thanks



Posted: 8/13/2017 9:23:27 AM
Al_z
Gender: Unknown
Country: Unknown
Threads: 2, Posts: 22
#28

using the SubmitTranfer query I get {"Success":false,"Error":"Bad Request","Data":null} however every time the transfer actually goes through!

can someone fix this?  it will be very hard to confirm commissions without a correct json return on a succeccsful or unsuccesful transfer.  

thanks!

TriphiusFire: 8/10/2017 8:18:20 AM

 Didn't notice this one either.

This one is yuge!



Posted: 8/17/2017 2:10:59 PM
shovalyehiel
Gender: Unknown
Country: Unknown
Threads: 1, Posts: 2
#29

Hi. i went threw the private api and i have two questions:

1) when i submit a trade i get an array in the returned objet with attr FilledOrders. whats the purpose of that attr ? 

2) is there a way to submit a trade with the current top currency ? 

thanks !

shoval



Posted: 8/20/2017 10:30:27 AM
Al_z
Gender: Unknown
Country: Unknown
Threads: 2, Posts: 22
#30

Hi. i went threw the private api and i have two questions:

1) when i submit a trade i get an array in the returned objet with attr FilledOrders. whats the purpose of that attr ? 

2) is there a way to submit a trade with the current top currency ? 

thanks !

shoval

shovalyehiel: 8/20/2017 10:30:27 AM

 

1) If you submit a buy trade and there's a sell order already matching the price but only for half of what you posted.  It will return a set of filled tradeID's to represent the fact that some or all of the order was instantly bought.

If you're bidding for the best price, this array will usually be empty, because your order won't be filled until someone sells you some coin.  Best practice in your coding here is invoke GetOpenOrders always and in the event the

"filled" array is full, invoke GetTradeHistory.  After that you can do something with that data or simply update GUI / DB etc.

2) I'm really not sure what you're asking?  There's no requirement to put such a thing into an all purpose API.  If you switch to the Public API You simply pull the tradepairs and markets, iterate through the list and find the criteria

that signals a "top currency" to you, then submit your trade using the Private API.  I presume you'll want to pull Market MarketHistory and OpenOrders using Public API to decide price and volume of the order.



Posted: 8/22/2017 10:56:09 AM
qbprod1
Gender: Unknown
Country: Unknown
Threads: 0, Posts: 1
#31

Hello,

1) Why don't you add "OrderId" field into results of GetTradeHistory request?

2) Is there any possibility to get orderId in case immediate trades, look at my request/reply:

17:58:40.7447561 00004 [Debug] [Market.Cryptopia.CryptopiaMarketConnection #1] [Out] -> Request 'SubmitTrade'
{
"TradePairId": null,
"Market": "BSD/BTC",
"Type": 0,
"Rate": 0.00013,
"Amount": 100.0
}
17:58:41.4476829 00004 [Trace] [Market.Cryptopia.CryptopiaMarketConnection #1] [In] <- 'SubmitTrade' reply
{
"Success": true,
"Error": null,
"Data": {
    "OrderId": null,
     "FilledOrders": [ 15489578 ]
}
}

 

OrderId is null, but it is not possible to get this orderId from Trades history:

17:58:57.4012936 00004 [Trace] [Market.Cryptopia.CryptopiaMarketConnection #1] [In] <- 'GetTradeHistory' transaction 3134803629558349
{
"Success": true,
"Error": null,
"Data": [
{
"TradeId": 15489578,
"TradePairId": 1292,
"Market": "BSD/BTC",
"Type": "Buy",
"Rate": 0.000125,
"Amount": 100.0,
"Total": 0.0125,
"Fee": 2.5E-05,
"TimeStamp": "2017-08-24T14:58:36.1931453"
},


Posted: 8/24/2017 3:31:30 PM Edited: 8/24/2017 3:55:06 PM
priestc
Gender: Unknown
Country: Unknown
Threads: 0, Posts: 2
#32

What happened to the encoding in response to json?

Private api responds to me: ܛ�s�H����\�� b�QT~(r��0*�u��

NVShad: 7/16/2017 7:41:12 PM

Hey, I'm finally almost finished my first private example, took me two weeks to get the authentication right! lol.
I decode my HTTP response with UTF-8-SIG.  Luckily Python hinted at the encoding for me so I wasn't left with the garbage you printed :P

Al_z: 7/17/2017 6:43:04 PM

 Did you plan to post the python examples somewhere? (ie: github)

reiven: 7/30/2017 4:53:31 PM

 Sorry, didn't see this reply.


https://github.com/doubleelforbes

I only have those 2 examples up atm, but I'm working on an all singing all dancing C++ interface now, that'll go up there too.

Everything seems to play ball except for my "Hangups" on the private API which I've highlighted in another thread.

Al_z: 8/10/2017 2:35:31 PM

 

Which "another thread"? I'm trying to get your code to run and I'm getting an error that says: "Signature does not match request parameters."



Posted: 9/11/2017 12:49:19 AM
arn666
Gender: Other
Country: Afghanistan
Threads: 1, Posts: 8
#33

<blockquote><div><p>Hey guys,&nbsp;</p> <p>Do you have plans to allow users to have several API keys? That would allow for different permissions, and for running several scripts on the same account without risking nonce conflicts.&nbsp;</p></div><small><i>ArtPlay: 6/2/2017 2:00:37 AM</i></small></blockquote><p></p>


Posted: 9/23/2017 8:13:05 PM
arn666
Gender: Other
Country: Afghanistan
Threads: 1, Posts: 8
#34

<blockquote><div><h3>Private API</h3> <hr> <div><strong style="font-size: larger"><span style="font-size: large"><strong>Authentication:</strong></span></strong></div> <div><span style="font-size: 10pt">Authenticated methods require the use of an api key and can only be accessed via the POST method. </span></div> <div><span style="font-size: 10pt">Authorization is performed by sending the following variables into the request authentication header: </span></div> <div>&nbsp;</div> <div><span style="font-size: small"><strong><span style="font-size: large">Authentication Method:</span></strong></span></div> <div><span style="font-size: small">SCHEME: 'amx'</span></div> <div><span style="font-size: small">PARAMETER: 'API_KEY + ':' + REQUEST_SIGNATURE + ':' + NONCE' signed by secret key according to HMAC-SHA256 method.</span></div> <p>&nbsp;</p> <div><strong style="font-size: larger"><span style="font-size: large"><strong>Request Structure:</strong> </span></strong></div> <div><small><span style="font-size: small">REQUEST_SIGNATURE: API_KEY + "POST" + URI + NONCE + HASHED_POST_PARAMS </span></small></div> <div><span style="font-size: small">API_KEY: Your Cryptopia api key</span></div> <div><span style="font-size: small">URI: the request uri. e.g. <a href="/SubmitTrade"><u><span style="color: #0066cc">https://www.cryptopia.co.nz/Api/SubmitTrade</span></u></a></span></div> <div>HASHED_POST_PARAMS: Base64 encoded MD5 hash of the post parameters</div> <div>NONCE: unique indicator for each request.</div> <div>&nbsp;</div> <p>&nbsp;</p> <div><strong style="font-size: larger"><span style="font-size: large"><strong>Result Structure:</strong> </span></strong></div> <div><small><span style="font-size: small">Success - Either a "true" or "false". </span></small></div> <div><span style="font-size: small">Error - If unsuccessful, this will be the error message</span></div> <div><span style="font-size: small">Data - If successful, this will be the data returned e.g. </span></div> <pre>{ <br> "Success" : "true" <br> "Error" : null, <br> "Data" : "Sucessfull Request Data" <br>} </pre> <p>&nbsp;</p> <p><strong><span style="font-size: large">Request Methods:</span></strong></p> <hr> <p>&nbsp;</p> <div> <div><strong style="font-size: larger"><span style="font-size: large">GetBalance</span></strong></div> <div><small><span style="font-size: small">Returns all balances or a specific currency balance</span></small></div> <div><span style="font-size: small"><strong>URI</strong>:&nbsp;<a href="/api/GetCurrencies"><u><span style="color: #0066cc">https://www.cryptopia.co.nz/api/GetBalance</span></u></a></span></div> <div>&nbsp;</div> <div><span style="font-size: 12pt"><strong>Input</strong>:</span></div> <div><span style="font-size: small"><strong>Currency</strong>: (optional)&nbsp;The currency symbol of the balance to return e.g. 'DOT' <span style="font-size: 8pt"><em>(not required if 'CurrencyId' supplied)</em></span></span></div> <div><span style="font-size: small"><strong>CurrencyId:</strong> <span style="font-size: small">(optional)&nbsp;</span> The Cryptopia currency identifier of the balance to return e.g. '2' <span style="font-size: 8pt"><em>(not required if 'Currency' supplied)</em></span></span></div> <div>&nbsp;</div> <div><span style="font-size: small"><span style="font-size: 8pt"><span style="font-size: 12pt"><strong>Result Example</strong>:</span></span></span></div> <pre style="margin-top: 5px">{ "Success":true, "Error":null, "Data":[ { "CurrencyId":1, "Symbol":"BTC", "Total":"10300",<br> "Available":"6700.00000000",<br> "Unconfirmed":"2.00000000",<br> "HeldForTrades":"3400,00000000",<br> "PendingWithdraw":"200.00000000",<br> "Address":"4HMjBARzTNdUpXCYkZDTHq8vmJQkdxXyFg",<br> "BaseAddress": "ZDTHq8vmJQkdxXyFgZDTHq8vmJQkdxXyFgZDTHq8vmJQkdxXyFg",<br> "Status":"OK",<br> "StatusMessage":"" }, { ... } ] } </pre> </div> <p>&nbsp;</p> <div> <div><strong style="font-size: larger"><span style="font-size: large">GetDepositAddress</span></strong></div> <div><small><span style="font-size: small">Creates or returns a deposit address for the specified currency</span></small></div> <div><span style="font-size: small"><strong>URI</strong>:&nbsp;<a href="/api/GetDepositAddress"><u><span style="color: #0066cc">https://www.cryptopia.co.nz/api/GetDepositAddress</span></u></a></span></div> <div>&nbsp;</div> <div><span style="font-size: 12pt"><strong>Input</strong>:</span></div> <div><span style="font-size: small"><strong>Currency</strong>: The currency symbol of the address to return e.g. 'DOT' <span style="font-size: 8pt"><em>(not required if 'CurrencyId' supplied)</em></span></span></div> <div><span style="font-size: small"><strong>CurrencyId:</strong> The Cryptopia currency identifier of the address to return e.g. '2' <span style="font-size: 8pt"><em>(not required if 'Currency' supplied)</em></span></span></div> <div>&nbsp;</div> <div><span style="font-size: small"><span style="font-size: 8pt"><span style="font-size: 12pt"><strong>Result Example</strong>:</span></span></span></div> <pre style="margin-top: 5px">{ "Success":true, "Error":null, "Data":<br> { "Currency": "DOT", "Address":"4HMjBARzTNdUpXCYkZDTHq8vmJQkdxXyFg",<br> "BaseAddress": "ZDTHq8vmJQkdxXyFgZDTHq8vmJQkdxXyFgZDTHq8vmJQkdxXyFg" } } </pre> </div> <p>&nbsp;</p> <div> <div><strong style="font-size: larger"><span style="font-size: large">GetOpenOrders</span></strong></div> <div><small><span style="font-size: small">Returns a list of open orders for all tradepairs or specified tradepair</span></small></div> <div><span style="font-size: small"><strong>URI</strong>:&nbsp;<u><span style="color: #0066cc"><a href="/api/GetOpenOrders">https://www.cryptopia.co.nz/api/GetOpenOrders</a></span></u></span></div> <div>&nbsp;</div> <div><span style="font-size: 12pt"><strong>Input</strong>:</span></div> <div><span style="font-size: small"><strong>Market</strong>: The market symbol of the orders to return e.g. 'DOT/BTC' <span style="font-size: 8pt"><em>(not required if 'TradePairId' supplied)</em></span></span></div> <div><span style="font-size: small"><strong>TradePairId: </strong><span style="font-size: small">The Cryptopia tradepair identifier of the orders to return e.g. '100' </span><span style="font-size: 8pt"><em>(not required if 'Market' supplied)</em></span></span></div> <div><span style="font-size: small"><strong>Count:</strong> (optional) The maximum amount of orders to return e.g. '10' <span style="font-size: 8pt"><em>(default: 100)</em></span></span></div> <div>&nbsp;</div> <div><span style="font-size: small"><span style="font-size: 8pt"><span style="font-size: 12pt"><strong>Result Example</strong>:</span></span></span></div> <pre style="margin-top: 5px">{ "Success":true, "Error":null, "Data":[<br> { "OrderId": 23467,<br> "TradePairId": 100,<br> "Market": "DOT/BTC",<br> "Type": "Buy",<br> "Rate": 0.00000034,<br> "Amount": 145.98000000,<br> "Total": "0.00004963",<br> "Remaining": "23.98760000", "TimeStamp":"2014-12-07T20:04:05.3947572" },<br> {<br> ...........<br> }<br> ] } </pre> </div> <p>&nbsp;&nbsp;</p> <div> <div><strong style="font-size: larger"><span style="font-size: large">GetTradeHistory</span></strong></div> <div><small><span style="font-size: small">Returns a list of&nbsp;trade history&nbsp;for all tradepairs or specified tradepair</span></small></div> <div><span style="font-size: small"><strong>URI</strong>:&nbsp;<u><span style="color: #0066cc"><span style="color: #0066cc"><a href="/api/GetTradeHistory">https://www.cryptopia.co.nz/api/GetTradeHistory</a></span></span></u></span></div> <div>&nbsp;</div> <div><span style="font-size: 12pt"><strong>Input</strong>:</span></div> <div><span style="font-size: small"><strong>Market</strong>: The market symbol of the history to return e.g. 'DOT/BTC' <span style="font-size: 8pt"><em>(not required if 'TradePairId' supplied)</em></span></span></div> <div><span style="font-size: small"><strong>TradePairId: </strong>The Cryptopia tradepair identifier of the history to return e.g. '100' <span style="font-size: 8pt"><em>(not required if 'Market' supplied)</em></span></span></div> <div><span style="font-size: small"><strong>Count:</strong> (optional) The maximum amount of history to return e.g. '10' <span style="font-size: 8pt"><em>(default: 100)</em></span></span></div> <div>&nbsp;</div> <div><span style="font-size: small"><span style="font-size: 8pt"><span style="font-size: 12pt"><strong>Result Example</strong>:</span></span></span></div> <pre style="margin-top: 5px">{ "Success":true, "Error":null, "Data":[<br> { "TradeId": 23467,<br> "TradePairId": 100,<br> "Market": "DOT/BTC",<br> "Type": "Buy",<br> "Rate": 0.00000034,<br> "Amount": 145.98000000,<br> "Total": "0.00004963",<br> "Fee": "0.98760000", "TimeStamp":"2014-12-07T20:04:05.3947572" },<br> {<br> ...........<br> }<br> ] } </pre> </div> <p>&nbsp;</p> <div> <div><strong style="font-size: larger"><span style="font-size: large">GetTransactions</span></strong></div> <div><small><span style="font-size: small">Returns a list of&nbsp;transactions</span></small></div> <div><span style="font-size: small"><strong>URI</strong>:&nbsp;<u><span style="color: #0066cc"><a href="/api/GetTradeHistory"><span style="color: #0066cc">https://www.cryptopia.co.nz/api/GetTransactions</span></a></span></u></span></div> <div>&nbsp;</div> <div><span style="font-size: 12pt"><strong>Input</strong>:</span></div> <div><span style="font-size: small"><strong>Type</strong>: The type of transactions to return e.g. 'Deposit' or 'Withdraw'</span></div> <div><span style="font-size: small"><strong>Count:</strong> (optional) The maximum amount of transactions to return e.g. '10' <span style="font-size: 8pt"><em>(default: 100)</em></span></span></div> <div>&nbsp;</div> <div><span style="font-size: small"><span style="font-size: 8pt"><span style="font-size: 12pt"><strong>Result Example</strong>:</span></span></span></div> <pre style="margin-top: 5px">{ "Success":true, "Error":null, "Data":[<br> { "Id": 23467,<br> "Currency": "DOT",<br> "TxId": "6ddbaca454c97ba4e8a87a1cb49fa5ceace80b89eaced84b46a8f52c2b8c8ca3",<br> "Type": "Deposit",<br> "Amount": 145.98000000,<br> "Fee": "0.00000000",<br> "Status": "Confirmed",<br> "Confirmations": "20", "TimeStamp":"2014-12-07T20:04:05.3947572",<br> "Address": "" },<br> {<br> "Id": 23467,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "Currency": "DOT",<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "TxId": "9281eacaad58335b884adc24be884c00200a4fc17b2e05c72e255976223de187",<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "Type": "Withdraw",<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "Amount": 1000.00000000,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "Fee": "0.00004000",<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "Status": "Pending",<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "Confirmations": "20",<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "TimeStamp":"2014-12-07T20:04:05.3947572",<br> "Address": "15wPaAegfKai51KK2yemgLP5vEg5UWzSkC"<br> }<br> ] } </pre> </div> <p>&nbsp;</p> <div> <div><strong style="font-size: larger"><span style="font-size: large">SubmitTrade</span></strong></div> <div><small><span style="font-size: small">Submits a new trade order</span></small></div> <div><span style="font-size: small"><strong>URI</strong>:&nbsp;<u><span style="color: #0066cc"><a href="/api/GetTradeHistory">https://www.cryptopia.co.nz/api/SubmitTrade</a></span></u></span></div> <div>&nbsp;</div> <div><span style="font-size: 12pt"><strong>Input</strong>:</span></div> <div> <div><span style="font-size: small"><strong>Market</strong>: The market symbol of the&nbsp;trade e.g. 'DOT/BTC' <span style="font-size: 8pt"><em>(not required if 'TradePairId' supplied)</em></span></span></div> <div><span style="font-size: small"><strong>TradePairId: </strong>The Cryptopia tradepair identifier of&nbsp;trade e.g. '100' <span style="font-size: 8pt"><em>(not required if 'Market' supplied)</em></span></span></div> <div><span style="font-size: small"><strong>Type:</strong> the type of trade <span style="font-size: small">e.g.</span> 'Buy' or 'Sell'</span></div> <div><span style="font-size: small"><strong>Rate:</strong> the rate or price to pay for the coins e.g. 0.00000034</span></div> <div><span style="font-size: small"><strong>Amount:</strong> the amount of coins to buy e.g. 123.00000000</span></div> </div> <div>&nbsp;</div> <div><span style="font-size: small"><span style="font-size: 8pt"><span style="font-size: 12pt"><strong>Result Example</strong>:</span></span></span></div> <pre style="margin-top: 5px">{ "Success":true, "Error":null, "Data":<br> { "OrderId": 23467,<br> "FilledOrders": [44310,44311]<br> } } </pre> </div> <p>&nbsp;</p> <div> <div><strong style="font-size: larger"><span style="font-size: large">CancelTrade</span></strong></div> <div><small><span style="font-size: small">Cancels a single order, all orders for a tradepair or all open orders</span></small></div> <div><span style="font-size: small"><strong>URI</strong>:&nbsp;<u><span style="color: #0066cc"><a href="/api/GetTradeHistory"><span style="color: #0066cc">https://www.cryptopia.co.nz/api/CancelTrade</span></a></span></u></span></div> <div>&nbsp;</div> <div><span style="font-size: 12pt"><strong>Input</strong>:</span></div> <div> <div><span style="font-size: small"><strong>Type</strong>: The type of cancellation, Valid Types:&nbsp;'All',&nbsp;&nbsp;'Trade', 'TradePair'</span></div> <div><span style="font-size: small"><strong>OrderId: </strong>The order identifier of&nbsp;trade to cancel (<span style="font-size: 8pt"><em>required if type&nbsp;'Trade')</em></span></span></div> <div><span style="font-size: small"><strong>TradePairId: </strong>The Cryptopia tradepair identifier of&nbsp;trades to cancel e.g. '100' <span style="font-size: 8pt"><em>(required if type&nbsp;'TradePair')</em></span></span></div> <div>&nbsp;</div> </div> <div><span style="font-size: small"><span style="font-size: 8pt"><span style="font-size: 12pt"><strong>Result Example</strong>:</span></span></span></div> <pre style="margin-top: 5px">{ "Success":true, "Error":null, "Data": [44310,44311]<br>} </pre> </div> <p>&nbsp;</p> <div> <div><strong style="font-size: larger"><span style="font-size: large">SubmitTip</span></strong></div> <div><small><span style="font-size: small">Submits a tip to the Trollbox</span></small></div> <div><span style="font-size: small"><strong>URI</strong>:&nbsp;<u><span style="color: #0066cc"><a href="/api/GetTradeHistory"><span style="color: #0066cc">https://www.cryptopia.co.nz/api/SubmitTip</span></a></span></u></span></div> <div>&nbsp;</div> <div><span style="font-size: 12pt"><strong>Input</strong>:</span></div> <div> <div> <div><span style="font-size: small"><strong>Currency</strong>: The currency symbol of the coins to tip e.g. 'DOT' <span style="font-size: 8pt"><em>(not required if 'CurrencyId' supplied)</em></span></span></div> <div><span style="font-size: small"><strong>CurrencyId:</strong> The Cryptopia currency identifier of the coins to tip e.g. '2' <span style="font-size: 8pt"><em>(not required if 'Currency' supplied)</em></span></span></div> </div> <div><span style="font-size: small"><strong>ActiveUsers:</strong> The amount of last active users to tip (Min:&nbsp;2 Max: 100)</span></div> <div><span style="font-size: small"><strong>Amount:</strong> the amount of coins to buy e.g. 123.00000000 <span style="font-size: 8pt"><em>(Amount will be divided equally amongst the active users)</em></span></span></div> </div> <div>&nbsp;</div> <div><span style="font-size: small"><span style="font-size: 8pt"><span style="font-size: 12pt"><strong>Result Example</strong>:</span></span></span></div> <pre style="margin-top: 5px">{ "Success":true, "Error":null, "Data": "You tipped 45 users 0.00034500 DOT each." } </pre> </div> <p>&nbsp;</p> <div> <div><strong style="font-size: larger"><span style="font-size: large">SubmitWithdraw</span></strong></div> <div><small><span style="font-size: small">Submits a withdrawal&nbsp;request</span></small></div> <div><span style="font-size: small"><strong>URI</strong>:&nbsp;<u><span style="color: #0066cc"><a href="/api/GetTradeHistory"><span style="color: #0066cc">https://www.cryptopia.co.nz/api/SubmitWithdraw</span></a></span></u></span></div> <div>&nbsp;</div> <div><span style="font-size: 12pt"><strong>Input</strong>:</span></div> <div> <div> <div><span style="font-size: small"><strong>Currency</strong>: The currency symbol of the coins to withdraw e.g. 'DOT' <span style="font-size: 8pt"><em>(not required if 'CurrencyId' supplied)</em></span></span></div> <div><span style="font-size: small"><strong>CurrencyId:</strong> The Cryptopia currency identifier of the coins to withdraw e.g. '2' <span style="font-size: 8pt"><em>(not required if 'Currency' supplied)</em></span></span></div> </div> <div><span style="font-size: small"><strong>Address:</strong>&nbsp;The address to send the currency too. <span style="font-size: 8pt"><em>(Address must exist in you AddressBook, can be found in you Security settings page.)</em></span></span></div> <div><span style="font-size: small"><span style="font-size: 8pt"><span style="font-size: 10pt"><strong>PaymentId:</strong></span><em> The unique paimentid to identify the payment. (PaymentId for CryptoNote coins.)</em></span></span></div> <div><span style="font-size: small"><strong>Amount:</strong> the amount of coins to withdraw e.g. 123.00000000 </span></div> </div> <div>&nbsp;</div> <div><span style="font-size: small"><span style="font-size: 8pt"><span style="font-size: 12pt"><strong>Result Example</strong>:</span></span></span></div> <pre style="margin-top: 5px">{ "Success":true, "Error":null, "Data": 405667 } </pre> <p>&nbsp;</p> <div><strong style="font-size: larger"><span style="font-size: large">SubmitTransfer</span></strong></div> <div><small><span style="font-size: small">Submits a transfer&nbsp;request</span></small></div> <div><span style="font-size: small"><strong>URI</strong>:&nbsp;<u><span style="color: #0066cc"><span style="color: #0066cc"><a href="/api/GetTradeHistory">https://www.cryptopia.co.nz/api/SubmitT</a>ransfer</span></span></u></span></div> <div>&nbsp;</div> <div><span style="font-size: 12pt"><strong>Input</strong>:</span></div> <div> <div> <div><span style="font-size: small"><strong>Currency</strong>: The currency symbol of the coins to transfer&nbsp;e.g. 'DOT' <span style="font-size: 8pt"><em>(not required if 'CurrencyId' supplied)</em></span></span></div> <div><span style="font-size: small"><strong>CurrencyId:</strong> The Cryptopia currency identifier of the coins to transfer&nbsp;e.g. '2' <span style="font-size: 8pt"><em>(not required if 'Currency' supplied)</em></span></span></div> </div> <div><span style="font-size: small"><strong>Username:</strong>&nbsp;The Cryptopia username of the person to transfer the funds to.</span></div> <div><span style="font-size: small"><strong>Amount:</strong> the amount of coins to transfer&nbsp;e.g. 123.00000000</span></div> </div> <div>&nbsp;</div> <div><span style="font-size: small"><span style="font-size: 8pt"><span style="font-size: 12pt"><strong>Result Example</strong>:</span></span></span></div> <pre style="margin-top: 5px">{ "Success":true, "Error":null, "Data": "Successfully transfered 200 DOT to Hex." } </pre> </div></div><small><i>sa_ddam213: 9/7/2015 5:02:19 AM</i></small></blockquote><p></p>


Posted: 9/23/2017 8:13:06 PM
arn666
Gender: Other
Country: Afghanistan
Threads: 1, Posts: 8
#35

<blockquote><div><p>Hi there,</p> <p>I was trying to get my api key to use it on coinigy but it is not that intuitive to get it on Cryptopia, could you give my a hand, please?</p> <p>Thanks for your time!!</p> <p>T</p></div><small><i>PichiKan: 6/8/2017 8:04:03 PM</i></small></blockquote><p></p>


Posted: 9/23/2017 8:13:06 PM
arn666
Gender: Other
Country: Afghanistan
Threads: 1, Posts: 8
#36

3


Posted: 9/23/2017 8:13:57 PM
arn666
Gender: Other
Country: Afghanistan
Threads: 1, Posts: 8
#37

<blockquote><div><p>Hello,&nbsp;</p> <p>After successfully logging in, move your cursor over&nbsp;your username in the upper right corner, and click on "Settings" in the appearing menu.&nbsp;</p> <p>In the settings menu, click on the link "Security" on the left side of the screen.&nbsp;</p> <p>In section "Account security", you find the API settings. Check the box "Enable API" - et voilà.</p> <p>hth</p></div><small><i>thebner: 6/8/2017 9:39:54 PM</i></small></blockquote><p></p>


Posted: 9/23/2017 8:15:07 PM
arn666
Gender: Other
Country: Afghanistan
Threads: 1, Posts: 8
#38

Hey guys, 

Do you have plans to allow users to have several API keys? That would allow for different permissions, and for running several scripts on the same account without risking nonce conflicts. 

ArtPlay: 6/2/2017 2:00:37 AM



Posted: 9/23/2017 8:15:09 PM
arn666
Gender: Other
Country: Afghanistan
Threads: 1, Posts: 8
#39

<blockquote><div><blockquote> <div> <p>Hello,&nbsp;</p> <p>After successfully logging in, move your cursor over&nbsp;your username in the upper right corner, and click on "Settings" in the appearing menu.&nbsp;</p> <p>In the settings menu, click on the link "Security" on the left side of the screen.&nbsp;</p> <p>In section "Account security", you find the API settings. Check the box "Enable API" - et voilà.</p> <p>hth</p> </div> <small><em>thebner: 6/8/2017 9:39:54 PM</em></small></blockquote> <p>&nbsp;Hi All,</p> <p>&nbsp;</p> <p>Even I am facing the same issue, I've generated new API key and secret, enabled API but not able to get balances, it is showing message as bad request with status 401</p></div><small><i>diliptrident: 6/14/2017 1:29:20 PM</i></small></blockquote><p></p>


Posted: 9/23/2017 8:15:11 PM
pakage
Gender: Unknown
Country: Unknown
Threads: 1, Posts: 2
#40

I'm having issues trying to use the Private API.

The response I am getting: { "Success": false, "Error": "Signature does not match request parameters." }

So i'm either not forming the signature correctly or not sending the post data correctly, but i cant figure out for the life of me what im doing wrong. I'm using NodeJS and ive basically ported the example found here from PHP to Javascript:

https://github.com/fransyozef/cryptofyer/blob/master/cryptopia/cryptopia_api.class.php#L33

Here's a paste of the code ive got:

https://pastebin.com/TRs9Vkxy

and this is the output sent to the console from the pasted code's console logs:

nonce 150563367776500

json stringify {"Currency":"NAV"}

reqSig c759cad0960f458b88c136bbaab8feacPOSThttps://www.cryptopia.co.nz/api/getbalance150563367776500OTgwNWM4OGIxYTljYTU4NGI4YWY2ZDYyNTI5ZTVjMzE=

amx c759cad0960f458b88c136bbaab8feac:YWZmZWU3ZWE0ODdiZGQ5YTAwMmRiZDVjYjNkNWYwMWJjNDc4MGJkOWZjMzk2NTBjYTQzODVkNTA2MzE0MDIzNA==:150563367776500

{"Success":false,"Error":"Signature does not match request parameters."}

Any thoughts appreciated.

Craig.



Posted: 9/28/2017 8:54:21 AM
ThoughtWeaver
Gender: Unknown
Country: Unknown
Threads: 0, Posts: 2
#41

I'm having issues trying to use the Private API.

The response I am getting: { "Success": false, "Error": "Signature does not match request parameters." }

So i'm either not forming the signature correctly or not sending the post data correctly, but i cant figure out for the life of me what im doing wrong. I'm using NodeJS and ive basically ported the example found here from PHP to Javascript:

https://github.com/fransyozef/cryptofyer/blob/master/cryptopia/cryptopia_api.class.php#L33

Here's a paste of the code ive got:

https://pastebin.com/TRs9Vkxy

and this is the output sent to the console from the pasted code's console logs:

nonce 150563367776500

json stringify {"Currency":"NAV"}

reqSig c759cad0960f458b88c136bbaab8feacPOSThttps://www.cryptopia.co.nz/api/getbalance150563367776500OTgwNWM4OGIxYTljYTU4NGI4YWY2ZDYyNTI5ZTVjMzE=

amx c759cad0960f458b88c136bbaab8feac:YWZmZWU3ZWE0ODdiZGQ5YTAwMmRiZDVjYjNkNWYwMWJjNDc4MGJkOWZjMzk2NTBjYTQzODVkNTA2MzE0MDIzNA==:150563367776500

{"Success":false,"Error":"Signature does not match request parameters."}

Any thoughts appreciated.

Craig.

pakage: 9/28/2017 8:54:21 AM

 

I think this is an API problem :| I'm getting the same from C#, using their example code...



Posted: 9/28/2017 9:16:21 AM
Al_z
Gender: Unknown
Country: Unknown
Threads: 2, Posts: 22
#42

After moving from Python to C# I got the same issue, in my case using date instead of tick in the nonce was my obvious (in hindsight) mistake.

I can't see yours but keep doing the debug outputs and compare to working examples.



Posted: 10/4/2017 12:57:41 PM
Al_z
Gender: Unknown
Country: Unknown
Threads: 2, Posts: 22
#43

What happened to the encoding in response to json?

Private api responds to me: ܛ�s�H����\�� b�QT~(r��0*�u��

NVShad: 7/16/2017 7:41:12 PM

Hey, I'm finally almost finished my first private example, took me two weeks to get the authentication right! lol.
I decode my HTTP response with UTF-8-SIG.  Luckily Python hinted at the encoding for me so I wasn't left with the garbage you printed :P

Al_z: 7/17/2017 6:43:04 PM

 Did you plan to post the python examples somewhere? (ie: github)

reiven: 7/30/2017 4:53:31 PM

 Sorry, didn't see this reply.


https://github.com/doubleelforbesThe other

I only have those 2 examples up atm, but I'm working on an all singing all dancing C++ interface now, that'll go up there too.

Everything seems to play ball except for my "Hangups" on the private API which I've highlighted in another thread.

Al_z: 8/10/2017 2:35:31 PM

 

Which "another thread"? I'm trying to get your code to run and I'm getting an error that says: "Signature does not match request parameters."

priestc: 9/11/2017 12:49:19 AM

 Are you getting that issue with my code unedited?

I'd be interested to see this.

EDIT: Oh the other thread is just under API Forum, API Hangups.



Posted: 10/4/2017 12:58:27 PM Edited: 10/4/2017 12:58:55 PM
kroitor
Gender: Unknown
Country: Unknown
Threads: 0, Posts: 1
#44

Hello, Cryptopia!

I implemented your private REST API and it really lacks several basic methods for normal order management, that are common to most of existing exchanges, namely:

  1. GetOrder: a method to get a single order by id
  2. GetOrders: a method to get all (open and closed) orders
  3. GetOpenOrders: a method to get all open orders (← you have this)
  4. GetClosedOrders: a method to get all closed orders

Also, your current REST API does not have any means to know which orders were closed, and which trades correspond to those closed orders.

  1. GetOrderTrades: obtain a logical link between trade ids and an order by order id
  2. GetTradeHistory: add an order_id or something to each trade? There's no way to relate each trade to a corresponding closed order.

Just think of it: it's currently impossible to find out the true cost and filled amount of a closed order from the API. You only provide info on open orders, and there's no way to refer the trade history to successully closed orders, nor to get the history of closed orders, nor to get a single order by its id.

So, I wanted to ask, can you guys add the above methods to your API? And, if you can, when should your users expect that update? We really need those endpoints ASAP! ;)

Thx, really looking forward for your reply!

Best wishes,
Igor Kroitor
CCXT Dev Team
https://github.com/ccxt-dev/ccxt



Posted: 10/10/2017 6:08:42 PM Edited: 10/10/2017 8:28:57 PM
cmercuri
Gender: Unknown
Country: Unknown
Threads: 0, Posts: 2
#45

Hello,

I was interested in having also Reward transfers... I tried GetTransactions but there are only Deposits and Withdrawals. It is possible to have also Reward in GetTransactions or in another endpoint, please?

 

Thank you in advance!



Posted: 10/31/2017 6:41:59 AM
purboo
Gender: Unknown
Country: Unknown
Threads: 0, Posts: 1
#46

Cryptopia does not provide an API for querying the status of an order. I am wondering how to know how much an order is filled?

  1. I use the API to place an order, from the returned data orderId is known.
  2. I then use the API to cancel the order with orderId.
  3. It is possible that the order is filled before or during the order cancelation. Now I have no ideas whether it is filled or not. 

One can keep track of the trade history to figure out this. But if I place two orders and cancel then one by one, it is not possible to know whether they are filled or not.

Any ideas?

 



Posted: 11/2/2017 12:45:41 PM
simon_harrison
Gender: Male
Country: Afghanistan
Threads: 0, Posts: 2
#47

30


Posted: 11/7/2017 12:33:39 AM
soloam
Gender: Unknown
Country: Unknown
Threads: 0, Posts: 1
#48

Hello, I think that the withdraw fee are not filled on the API

 

I get for example this withdraw

 

[0] => stdClass Object
                (
                    [Id] => 000000
                    [Currency] => NLC2
                    [TxId] => xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                    [Type] => Withdraw
                    [Amount] => 64.16150239
                    [Fee] => 0
                    [Status] => Complete
                    [Confirmations] => 0
                    [Timestamp] => 2017-08-25T17:55:47.724745
                    [Address] => xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

But in the website I see

Currency Amount Fee Status
NLC2 64,16150239 0,01 Complete

 

Thank You



Posted: 11/7/2017 11:29:23 AM Edited: 11/7/2017 11:30:35 AM
allnewso
Gender: Unknown
Country: Unknown
Threads: 0, Posts: 1
#49

ขอรับ  api  เหรียญหน่อนคับ



Posted: 11/10/2017 5:14:36 AM