Search code examples
javascriptnode.jsbitcoincryptoapi

how to use Cryptocapital API v4, can't find sdk download link


Cryptocapital.co provides API to exchange crypto currency, I want to access their API to integrate with a website, they do have a documentation here - https://api.cryptocapital.co/v4

and they have a sample code as below

var key = '1234567890abcdef';
var secret = '1234567890abcdef';
var command = 'PING';
var nonce = Date.now();
var message = command + nonce;
var signature = CryptoJS.SHA1(message + key + secret);

var options = {
  url: 'https://api.cryptocapital.co/v4/ping',
  headers: {
    'key': key,
    'message': message,
    'signature': signature,
    'nonce': nonce
  }
};

request(options, function(err, res, body) {
  // do something
  // ...
});

There is no download link or reference to any SDK, when i run this code it says

request is not defined

I don't know where to start in this specific API.

please see the documentation and help me on identifying what I am doing wrong.


Solution

  • It's making the assumption that your using the popular request lib to make the HTTP request.

    You can, however, use whatever library you like. Or don't use a library at all, use https.get.