api documentation bitcoin.co.id microsoft word - api documentation bitcoin.co.id.docx author lady...

11
Copyright © 2013 - 2014 PT BitCoin API Documentation Link : https://vip.bitcoin.co.id/trade_ Our API is very similar with BTC-e’s be very easy task to use our API. Public API Ticker - https://vip.bitcoin.co.id/api/b Trades - https://vip.bitcoin.co.id/api/ Depth - https://vip.bitcoin.co.id/api/b Trade API Authentication Authorization is done by sending da Key — API key. Sample API key: 14 Sign — POST data (?param=val&pa key; Please send request into this URL : All variables must be sent with POS with increment integer. Method which used will be decided b Server will give respond in json form Respond‘s format if request success {"success":1,"return":{}} n Indonesia. All Rights Reserved API Docum _api s API. If you already done integration with Btc-e.com btc_idr/ticker /btc_idr/trades btc_idr/depth ata via HTTP header with the following variable: 4B0C9D6-UG71XOID-SH4IB5VQ-A9LK3YVZ-4HFR aram1=val1) encrypted with method HMAC-SHA51 https://vip.bitcoin.co.id/tapi ST command. All request should include variable with by variable name method mat. sfully done: mentation previously, it will R8X2T; 12 using secret h name nonce,

Upload: vuliem

Post on 12-Apr-2018

248 views

Category:

Documents


1 download

TRANSCRIPT

Copyright © 2013 - 2014 PT BitCoin Indonesia. All Rights Reserved

API Documentation

Link : https://vip.bitcoin.co.id/trade_api

Our API is very similar with BTC-e’s

be very easy task to use our API.

Public API

Ticker - https://vip.bitcoin.co.id/api/btc_idr/ticker

Trades - https://vip.bitcoin.co.id/api/btc_idr/trades

Depth - https://vip.bitcoin.co.id/api/btc_idr/depth

Trade API

Authentication

Authorization is done by sending data via HTTP header with the following variable:

Key — API key. Sample API key: 14B0C9D6

Sign — POST data (?param=val&para

key;

Please send request into this URL :

All variables must be sent with POST

with increment integer.

Method which used will be decided by variable name

Server will give respond in json format

Respond‘s format if request successfully done

{"success":1,"return":{}}

n Indonesia. All Rights Reserved

API Documentation

https://vip.bitcoin.co.id/trade_api

s API. If you already done integration with Btc-e.com

https://vip.bitcoin.co.id/api/btc_idr/ticker

https://vip.bitcoin.co.id/api/btc_idr/trades

https://vip.bitcoin.co.id/api/btc_idr/depth

Authorization is done by sending data via HTTP header with the following variable:

14B0C9D6-UG71XOID-SH4IB5VQ-A9LK3YVZ-4HFR8X2T;

(?param=val&param1=val1) encrypted with method HMAC-SHA512

: https://vip.bitcoin.co.id/tapi

POST command. All request should include variable with name

will be decided by variable name method

format.

if request successfully done:

API Documentation

previously, it will

4HFR8X2T;

SHA512 using secret

request should include variable with name nonce,

Copyright © 2013 - 2014 PT BitCoin Indonesia. All Rights Reserved

Respond‘s format if request resulting

{"success":0,"error":""}

Method

getInfo

This method give information about

Parameter: empty

Sample Respond:

{

"success":1,

"return":{

"balance":{

"idr":2000000,

"btc":1.52

},

"server_time":1392225342

}

}

TransHistory

This method give information about

Parameter: empty

n Indonesia. All Rights Reserved

API Documentation

resulting error:

balance and server’s timestamp.

history of deposit and withdraw

API Documentation

Copyright © 2013 - 2014 PT BitCoin Indonesia. All Rights Reserved

Sample Respond:

{

"success":1,

"return":{

"withdraw":{

"idr":[

{

"status":"wait",

"type":"coupon",

"rp":"100000",

"fee":"0",

"amount":"100000",

"submit_time":"1392135074",

"success_time":"0"

}

],

"btc":[

{

"status":"success",

"btc":"150000000",

"fee":"20000",

"amount":"149980000",

"submit_time":"1392135074",

"success_time":"0"

n Indonesia. All Rights Reserved

API Documentation

"submit_time":"1392135074",

"status":"success",

"amount":"149980000",

"submit_time":"1392135074",

API Documentation

Copyright © 2013 - 2014 PT BitCoin Indonesia. All Rights Reserved

}

]

},

"deposit":{

"idr":[

{

"status":"success",

"type":"bank",

"rp":"10000000",

"fee":"9900000",

"amount":"10000000",

"submit_time":"1392193569",

"success_time":"1392193569"

}

],

"btc":[

{

"status":"success",

"btc":"200000000",

"amount":"200000000",

"success_time":"1391979201"

}

]

}

n Indonesia. All Rights Reserved

API Documentation

"status":"success",

"amount":"10000000",

"submit_time":"1392193569",

"success_time":"1392193569"

"status":"success",

"amount":"200000000",

"success_time":"1391979201"

API Documentation

Copyright © 2013 - 2014 PT BitCoin Indonesia. All Rights Reserved

}

}

tradeHistory

This method give information about

Parameter:

Parameter Required D

count No N

from_id No First

end_id No End

order No Assign by

since No Start Time

end No End Time

pair Yes Currently only in BTC/IDR

Sample Respond:

{

"success":1,

"return":{

"trades":[

{

"trade_id":"2929",

"type":"buy",

"btc":0.013,

"price":"8068585",

"fee":"1049",

"trade_time":"1392226454"

},

n Indonesia. All Rights Reserved

API Documentation

bitcoin transaction in buying and selling history

Description V

Number of transaction which will be displayed numerical

First ID awal numerical

End ID numerical

Assign by asc / desc

Start Time UNIX time

End Time UNIX time

Currently only in BTC/IDR btc_idr

"trade_time":"1392226454"

API Documentation

Value Default

numerical 1000

numerical 0

numerical ∞

asc / desc desc

UNIX time 0

UNIX time ∞

btc_idr btc_idr

Copyright © 2013 - 2014 PT BitCoin Indonesia. All Rights Reserved

{

"trade_id":"2920",

"type":"sell",

"btc":0.01499999,

"price":"8086935",

"fee":"1214",

"trade_time":"1392225916"

}

]

}

}

openOrders

This method give information about

Parameter:

Parameter Required

pair Yes

Sample Respond

{

"success":1,

"return":{

"orders":[

{

"order_id":"11567",

n Indonesia. All Rights Reserved

API Documentation

"trade_time":"1392225916"

existing open order.

Description Value

saat ini hanya btc_idr btc_idr

API Documentation

alue Default

btc_idr btc_idr

Copyright © 2013 - 2014 PT BitCoin Indonesia. All Rights Reserved

"submit_time":"1392227908",

"price":"10000000",

"type":"buy",

"order_idr":"1000000",

"remain_idr":"1000000"

}

]

}

}

trade

This method use to make a new order

Parameter:

Parameter Required Description

pair Yes saat ini hanya btc_idr

type Yes tipe transaksi

price Yes harga order

idr pada buy jumlah rupiah untuk membeli btc. hanya diisi jika

type buy

btc pada sell jumlah bitcoin yang ingin dijual. hanya diisi jika

type sell

Sample Respond:

{

"success":1,

"return":{

"receive_btc":0,

"remain_rp":1000000,

"order_id":11560,

n Indonesia. All Rights Reserved

API Documentation

"submit_time":"1392227908",

"order_idr":"1000000",

"remain_idr":"1000000"

make a new order

Description Value

saat ini hanya btc_idr btc_idr

tipe transaksi buy / sell

harga order numerical

jumlah rupiah untuk membeli btc. hanya diisi jika

type buy

numerical

jumlah bitcoin yang ingin dijual. hanya diisi jika

type sell

numerical

API Documentation

alue Default

btc_idr btc_idr

buy / sell -

numerical -

numerical -

numerical -

Copyright © 2013 - 2014 PT BitCoin Indonesia. All Rights Reserved

"balance":{

"idr":"8000000",

"btc":1.52

}

}

}

cancelOrder

This method cancel existing open order

Parameter:

Parameter Required Description

order_id Yes Order ID

type Yes tipe transaksi

Sample Respond

{

"success":1,

"return":{

"order_id":11574,

"type":"buy",

"balance":{

"idr":"5000000",

"btc":2.5

}

}

}

n Indonesia. All Rights Reserved

API Documentation

order

Description Value

Order ID numerical

tipe transaksi buy / sell

API Documentation

alue Default

numerical -

buy / sell -

Copyright © 2013 - 2014 PT BitCoin Indonesia. All Rights Reserved

Sample PHP

<?php

function btcid_query($method, array $req = array()) {

// API settings

$key = ''; // your API-key

$secret = ''; // your Secret

$req['method'] = $method;

$req['nonce'] = time();

// generate the POST data string

$post_data = http_build_query($req, '', '&');

$sign = hash_hmac('sha512', $post_data, $secret);

// generate the extra headers

$headers = array(

'Sign: '.$sign,

'Key: '.$key,

);

// our curl handle (initialize if required)

n Indonesia. All Rights Reserved

API Documentation

function btcid_query($method, array $req = array()) {

key

$secret = ''; // your Secret-key

// generate the POST data string

$post_data = http_build_query($req, '', '&');

ac('sha512', $post_data, $secret);

// generate the extra headers

'Sign: '.$sign,

'Key: '.$key,

// our curl handle (initialize if required)

API Documentation

Copyright © 2013 - 2014 PT BitCoin Indonesia. All Rights Reserved

static $ch = null;

if (is_null($ch)) {

$ch = curl_init();

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; BTCINDO PHP client;

'.php_uname('s').'; PHP/'.phpversion().')');

}

curl_setopt($ch, CURLOPT_URL, 'https://vip.bitcoin.co.id/tapi/');

curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);

// run the query

$res = curl_exec($ch);

if ($res === false) throw new Exception('Could not get reply: '.curl_error($ch));

$dec = json_decode($res, true);

if (!$dec) throw new Exception('Invalid data received, please make sure co

working and requested API exists: '.$res);

curl_close($ch);

$ch = null;

return $dec;

}

$result = btcid_query('getInfo');

n Indonesia. All Rights Reserved

API Documentation

$ch = curl_init();

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; BTCINDO PHP client;

'.php_uname('s').'; PHP/'.phpversion().')');

curl_setopt($ch, CURLOPT_URL, 'https://vip.bitcoin.co.id/tapi/');

curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);

if ($res === false) throw new Exception('Could not get reply: '.curl_error($ch));

$dec = json_decode($res, true);

if (!$dec) throw new Exception('Invalid data received, please make sure connection is

working and requested API exists: '.$res);

API Documentation

curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; BTCINDO PHP client;

if ($res === false) throw new Exception('Could not get reply: '.curl_error($ch));

nnection is

Copyright © 2013 - 2014 PT BitCoin Indonesia. All Rights Reserved

print_r($result);

n Indonesia. All Rights Reserved

API Documentation

API Documentation