Chat

Trollbox
Users Online: 0
Search Posts

API






























Last Posts
Thread: API

I want to build an API on Could anyone please help out.


Thread: API

Hey buddy I'm trying to figure this stuff out myself at the moment so I havent got an answer for you, but looks like you left your API key in your post? Probably something to avoid.


Thread: API

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: Also, your current REST API does not have any means to know which orders were closed, and which trades correspond to those closed orders. 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 KroitorCCXT Dev Team


Thread: API

 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.


Thread: API

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.


Thread: API

For API Programs visit sanfoundry, stackoverflow, or read some blogs, they are very helpful and also you get free examples.


Thread: API

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


Thread: API

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: Here's a paste of the code ive got: 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.


Thread: API

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: Here's a paste of the code ive got: 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.


Thread: API

the C# private api example does not work.   When using that code, changing only: request.Content = new StringContent(JsonConvert.SerializeObject(postData), Encoding.UTF8, "application/json"); to: request.Content = new ObjectContent(typeof(object), postData, new JsonMediaTypeFormatter()); (old code does not work in new .Net) I get  "Signature does not match request parameters." I've tried enabling / disabling api access,  re-creating the api key / secret, to no avail.   Does it work for anyone else?


Thread: API

<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>


Thread: API


Thread: API

<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>


Thread: API

3


Thread: API

<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>


Thread: API

<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>


Thread: API

<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>


Thread: API

Hello,   Trying to do a powershell version of the API. Haven't got it to authenticate yet. Managed to get the same signature as PHP reports, but something must be wrong in the call or missing as I always get a "Signature does not match request parameters". Anyone care the comment? $cryptopiaApiKey = "key";$cryptopiaSecret = "secret"; $cryptopiaEndpoint = "https://www.cryptopia.co.nz/Api/"$cryptopiaMarketPath = $cryptopiaEndpoint + "GetMarket"$cryptopiaBalancePath = $cryptopiaEndpoint + "GetBalance" Function md5($string){$md5 = new-object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider $utf8 = new-object -TypeName System.Text.UTF8Encoding $md5.ComputeHash($utf8.GetBytes($string)) #[System.BitConverter]::ToString($md5.ComputeHash($utf8.GetBytes($string)))} Function cryptopiaDecode($secret){ $sigMod4 = $secret.length % 4 if($sigMod4 -eq 2){ $secretBase64 = $secret + "==" }elseif($sigMod4 -eq 3){ $secretBase64 = $secret + "=" }else{ $secretBase64 = $secret } [System.Convert]::FromBase64String($secretBase64)} Function getHmacSha256($message, $secret){ $hmacsha = New-Object System.Security.Cryptography.HMACSHA256 $hmacsha.key = $secret $signature = $hmacsha.ComputeHash([Text.Encoding]::ASCII.GetBytes($message)) $signature} $unixtime=[int][double]::Parse($(Get-Date -date (Get-Date).ToUniversalTime()-uformat %s))$req = @{Currency = 'HUSH'}$postData = ConvertTo-Json $req -Compress $nonce = $unixtime$nonce#$nonce = "1506151943" $m = md5 $postData$requestContentBase64String = [Convert]::ToBase64String($m)$encodedUrl = [System.Web.HttpUtility]::UrlEncode($cryptopiaBalancePath).ToLower()$signature = $cryptopiaApiKey + "POST" + $encodedUrl + $nonce + $requestContentBase64String$cryptopiaSecretDecoded = cryptopiaDecode $cryptopiaSecret$hmacsignature = getHmacSha256 $signature $cryptopiaSecretDecoded$hmacSignatureBase64 = [Convert]::ToBase64String($hmacsignature) $header_value = "amx " + $cryptopiaApiKey + ":" + $hmacSignatureBase64 + ":" + $nonce$header_value$headers = @{"Content-Type"="application/json; charset=utf-8";"Authorization"=$header_value}$headers $response = Invoke-WebRequest -UseBasicParsing $cryptopiaBalancePath -Headers $headers -Method POST -Body $postData$response  


Thread: API

I think this is not working anymore, can you check?


Thread: API

I'm pulling data for BUMBA : or   However the data those calls return when manually looking at the info.   Also it doesn't match up with The complete GetMarkets appears to be correct.