Private API


basketbojler
Gender: Unknown
Country: Unknown
Threads: 0, Posts: 1
#100

I'm trying to enable API in my account, but the settings are not being saved. After refreshing the page API enable checkbox not set. Did I miss something or it's a bug?

bitree: 1/31/2018 4:05:12 PM

 Same here, no success today, tried different browswers, no go. Any idea whats going on?



Posted: 1/31/2018 5:16:23 PM
HUSHhush1
Gender: Unknown
Country: Unknown
Threads: 0, Posts: 3
#101

Add me to the list, IE, Chrome, Firefox.... Two different computers too.



Posted: 1/31/2018 7:08:48 PM
HUSHhush1
Gender: Unknown
Country: Unknown
Threads: 0, Posts: 3
#102

Is checkbox "Enable API" gives permissions to trade, submit and cancel orders? Or only see the balance?

sheeshani, Settings / Securiity, after entering 2FA code.

detonatora: 1/29/2018 10:00:05 PM

 Yes, it gives trade, submit and cancel .



Posted: 1/31/2018 7:55:10 PM
ali_ee
Gender: Unknown
Country: Unknown
Threads: 0, Posts: 1
#103

Add me to the list, IE, Chrome, Firefox.... Two different computers too.

HUSHhush1: 1/31/2018 7:08:48 PM

 +1



Posted: 1/31/2018 8:02:55 PM
HUSHhush1
Gender: Unknown
Country: Unknown
Threads: 0, Posts: 3
#104

Working now



Posted: 2/1/2018 12:22:10 AM
bitree
Gender: Unknown
Country: Unknown
Threads: 0, Posts: 2
#105

Working now

HUSHhush1: 2/1/2018 12:22:10 AM

 Working, thanks for the info



Posted: 2/1/2018 7:49:16 AM
erictravail
Gender: Unknown
Country: Unknown
Threads: 0, Posts: 2
#106

Maybe stupid question.. but..

Where can i get an API key?

fsdev: 12/27/2017 11:57:04 PM

 "Account" , than "Securty"



Posted: 2/1/2018 9:36:14 PM
erictravail
Gender: Unknown
Country: Unknown
Threads: 0, Posts: 2
#107

I'm trying to use the CancelTrade method and I tried all types of it such as All and Trade buT I keep getting the following error:

 

{ Success: false, Error: 'Trade #0 does not exist', Data: null }

 

Any ideas on how to get this to work?!

msg768: 12/28/2017 12:04:44 PM

 Same as you. Always 'Trade #0 . I think a syntax problem, due to misunderstanding of all stuff 

We need an example. ( I'll give you here if i get one. )



Posted: 2/1/2018 9:56:03 PM
Cmajors
Gender: Unknown
Country: Unknown
Threads: 0, Posts: 1
#108

I purchased coin yesterday and it still hasn’t reflected in my balance. Should I be concerned?



Posted: 2/2/2018 11:33:58 AM
Iwan1803
Gender: Unknown
Country: Unknown
Threads: 2, Posts: 8
#109

hello all,

i tried to create my first POST API access to get my balance for DOGE, but i don't understand, what needs to be done in which order.
Mabye someone could explain, what needs to be done.
This is what i've understood:

1. create a struct whichs contains: API_KEY, URI (the called url), NONCE (as a unique parameter), CURRENCY ="DOGE"?
2. crypt that with HMAC-SHA256 and a private key - my API-key or what for a key?
3. create a MD5-Hash of that struct or which data?
4. do a HTTP POST call with the datas above as param?



Posted: 2/4/2018 2:03:42 PM Edited: 2/4/2018 2:06:57 PM
TrBaPhong
Gender: Unknown
Country: Unknown
Threads: 0, Posts: 1
#110

Hi all,

 

Is there an API that allows me to buy at Market Price? Currently, I found that we need to specify a price that we want to buy when submitting a buy order.

 

Thanks in advance



Posted: 2/4/2018 6:56:19 PM
rebelperm
Gender: Unknown
Country: Unknown
Threads: 0, Posts: 2
#111

Hello.
I'm writing a program on Delphi, trying to get a Balance.
The server returns an error that the request is not valid. Prompt in what I was mistaken, with Bittrex at me all works.

const metod = 'GetBalance';
     //rq ='';
     rq ='CurrencyId:2';
var key, secret:string;
  url,sign:string;
  HTTP:TidHTTP;
  list:TStringList;
  nonce:string;
  post_data : string;
  m : string;
  requestContentBase64String : string;
  signature : string;
  hmacsignature : string;
  header_value : string;
  headers : string;

 data: TIdMultiPartFormDataStream;

 begin
 key:='xxx';
 secret:='xxx';
 nonce:=inttostr(DateTimeToUnix(now));
url:='https://www.cryptopia.co.nz/Api/'+metod;
// url:='https://www.cryptopia.co.nz/Api/SubmitTrade';
post_data:=rq;
m:=md5(post_data);
requestContentBase64String:=EncodeBase64(m);
signature:=key + 'POST' + AnsiLowerCase(url) + nonce + requestContentBase64String;
hmacsignature:= EncodeBase64(SHA256DigestToHexa(chash.CalcHMAC_SHA256(DecodeBase64(secret),signa ture)));
header_value:= 'amx ' + key + ':' + hmacsignature + ':' + nonce;
HTTP:=TidHTTP.Create;
HTTP.IOHandler:=form1.IdSSLIOHandlerSocketOpenSSL1;
HTTP.Request.CustomHeaders.Add('Authorization:'+ header_value);
HTTP.Request.CustomHeaders.Add('Content-Type: application/json; charset=utf-8');
HTTP.Request.URL:=url;
data := TIdMultiPartFormDataStream.Create;
data.AddFormField('CurrencyId', '2');
form1.memo1.Text:=HTTP.post(url,data);   {}
data.Free;
HTTP.Free;



Posted: 2/5/2018 2:39:37 PM
mmarsching
Gender: Unknown
Country: Unknown
Threads: 0, Posts: 3
#112

Hi,

In the GetBalance call, we can elect to specify a Currency, or not select a currency. Generally speaking, I won't ever know what currencies I need to get balances for. That's why I'm querying. But, the call returns over 500 balances. Most of them will be 0. Could the API please have a parameter in the POST body so that only balances with a value greater than 0 are returned?

Thanks

kruddler: 1/15/2018 4:33:09 AM

 +1



Posted: 2/6/2018 12:15:44 AM
mmarsching
Gender: Unknown
Country: Unknown
Threads: 0, Posts: 3
#113

Here is a working example for google scripts (for example google sheets):

function HttpCryptopia (method, params) {
  var key = YOUR_API_KEY_HERE;
  var secret = YOUR_SECRET_KEY_HERE;
  var nonce = new Date().getTime();
  var baseURL = 'https://www.cryptopia.co.nz/Api/';
  var URL = baseURL + method;
  var requestContentBase64String = Utilities.base64Encode(Utilities.computeDigest(Utilities.DigestAlgorithm.MD5, JSON.stringify(params), Utilities.Charset.UTF_8));
  var signature = key + "POST" + encodeURIComponent(URL).toLowerCase() + nonce + requestContentBase64String;
  // var hmacsignature = Utilities.base64Encode(Utilities.computeHmacSignature(Utilities.MacAlgorithm.HMAC_SHA_256, signature, Utilities.base64Decode(secret), Utilities.Charset.UTF_8));

  // !! computeHmacSignature does not work, since there is a bug in google scripts!
  // !! download Sourcecode from https://github.com/Caligatio/jsSHA/releases/tag/v2.3.1
  // !! Extract > Open folder jsSHA-2.3.1.zip > Open folder src > copy code of sha265.js to the end of your .gs-code

  var sha = new jsSHA("SHA-256", "TEXT");
  sha.setHMACKey(secret, "B64");
  sha.update(signature);
  var hmacsignature = sha.getHMAC("B64");

  var options = {
    "method": 'POST',
    "headers": {
      "Authorization": "amx " + key + ":" + hmacsignature + ":" + nonce,
      "Content-Type": 'application/json; charset=utf-8',
    },
    "payload" : JSON.stringify(params),
    "contentLength": JSON.stringify(params).length
  };

  var response = UrlFetchApp.fetch(URL, options);
  var json = JSON.parse(response.getContentText());
  return json;
}

You can use your function like that:

BTCbalance = HttpCryptopia("GetBalance", {"Currency": "BTC"});

H2H



Posted: 2/6/2018 1:14:04 AM Edited: 2/6/2018 1:15:00 AM
openclerk
Gender: Unknown
Country: Unknown
Threads: 0, Posts: 1
#114

Hello! I love that you have an API, can you please add an option for an API key to not permit trades (i.e. a completely read-only key)? I don't feel safe sharing API keys with third parties which allow trading. Thank you!



Posted: 2/6/2018 3:35:06 AM
Infectedd
Gender: Unknown
Country: Unknown
Threads: 0, Posts: 1
#115

Hello,

 

I'd like to request that a method to get the rate limit through the API is added.

 

Cheers!



Posted: 2/8/2018 10:33:47 AM
toumtoum52
Gender: Unknown
Country: Unknown
Threads: 0, Posts: 1
#116

HEllo all !

I use API public for project Python. And now i search the method for recover the value of "ESTIMATED BITCOIN" with private API.

Do you have a solution ? 



Posted: 2/9/2018 9:58:03 PM
gautamhsquare
Gender: Unknown
Country: Unknown
Threads: 0, Posts: 1
#117

Hello, 

 

So I'm creating a wallet using Cryptopia as a echange using its API. I wants to know how easy it is to send and recieve coins using private API? 

 

and how easy it is when I've to send and recieve coins more than 1?(requirements is to support all possible 600 coin transfers at once). 

 

however I can't see that if cryptopia have any bulk API and would not expect that in near future but what If I do loop of transactions in background script from my wallet? is there anything from cryptopia exchange API that can stop me? 

 

relating to above question I can see there is daily API limit but still with that limit I think I can do what I want, but is it possible to increase this limit?

 

is there any possibility I can automate creation of API key for my users? its not a must but its really better if we can to provide our users seamless experience

 

I know lot of questions, but please answer guys as much as you know. 

 

Thanks in advance, really appreciate reading up to this point :-)

 



Posted: 2/10/2018 6:11:20 AM Edited: 2/10/2018 6:12:14 AM
flrizzato
Gender: Unknown
Country: Unknown
Threads: 0, Posts: 2
#118

A Delphi sample (using the native HTTPClient):

 

const
  apiKey: String = 'your apiKey';
  apiSecret: String = 'your apiSecret';
  requestURL: String = 'https://www.cryptopia.co.nz/Api/GetBalance';

var
  FHTTPClient: THTTPClient;
  LPOSTRequest: IHTTPRequest;
  LResponse: IHTTPResponse;
  LHeaders: TNetHeaders;

  Data: TJSONObject;
  nonce: String;
  signature: String;
  hmacsignature: String;
  header_value: String;
  requestB64: String;
begin
  Data := TJSONObject.Create;
  FHTTPClient := THTTPClient.Create;
  try
    // get the POST request
    LPOSTRequest := FHTTPClient.GetRequest('POST', requestURL);

    // Create the body request
    Data.AddPair(TJSONPair.Create('Currency', 'DOT'));
    LPOSTRequest.SourceStream := TStringStream.Create(Data.ToJSON);

    // Authentication
    requestB64 := TNetEncoding.Base64.EncodeBytesToString
      (THashMD5.GetHashBytes(Data.ToJSON));

    // Create random nonce for each request
    nonce := IntToStr(DateTimeToUnix(Now));

    // Creating the raw signature string
    signature := apiKey + 'POST' + LowerCase(TNetEncoding.URL.Encode(requestURL)
      ) + nonce + requestB64;

    hmacsignature := TNetEncoding.Base64.EncodeBytesToString
      (THashSHA2.GetHMACAsBytes(signature,
      TNetEncoding.Base64.DecodeStringToBytes(apiSecret)));

    header_value := 'amx ' + apiKey + ':' + hmacsignature + ':' + nonce;

    LHeaders := [
      TNetHeader.Create('Content-Type', 'application/json; charset=utf-8'),
      TNetHeader.Create('Authorization', header_value)];
    LResponse := FHTTPClient.Execute(LPOSTRequest, nil, LHeaders);

    memResult.Text := LResponse.ContentAsString;
  finally
    FHTTPClient.Free;
  end;



Posted: 2/14/2018 5:24:59 PM
brynnneilson
Gender: Unknown
Country: Unknown
Threads: 0, Posts: 1
#119

Gekko is an open source platform for automating trading strategies over bitcoin markets. Would be great to see Cryptopia added as an Exchange. I'd do it but my programming skills aren't good enough: https://gekko.wizb.it/



Posted: 2/15/2018 12:41:23 AM Edited: 2/15/2018 12:41:56 AM
Lefteris_Stamataros
Gender: Unknown
Country: Unknown
Threads: 0, Posts: 1
#120

Hello

 

i've like to ask if anyone else got status code 401 (unauthorized) when posting private_api's or if there is a problem from cryptopia-side

my private_api's was tested and was ok until today that i've got that error

i've clear cookies and also i've reset my api_key and secret but i've got the same error

public_api's still working (tested with a GetBalance and got status OK)

 

thank you for your time



Posted: Today 1:33:01 PM