INTRODUCTION
FOBLGATE API Document
Base URI : https://api2.foblgate.com
All REST, WEBSOCKET endpoints are documented below.
To access private endpoints, a permanent API key is required.
REST Authentication procedure is header add name SecretHeader SHA256(public key + parameters + secret key)
REST CALL is limited to less then 60 times per minute.
1.TICKER
1.1 orderbook
var request = require('request');
var crypto = require('crypto');
var apiKey = "d5f3a6b82d6a7aea"; // You'r Public Api Key
var scretKey = "451891f41c220e57"; // You'r Secret Api Key
var pairName = "ETH/BTC";
var formData = {
apiKey : apiKey,
pairName : pairName
};
var secretHash = crypto.createHash('sha256').update(apiKey + pairName + scretKey).digest('hex');
var options = {
url: 'https://api2.foblgate.com/api/ticker/orderBook',
headers: {
SecretHeader: secretHash
},
form:formData
};
request.post(options, function (error, response, body) {
if (error) {
console.error(error);
} else {
console.log(body);
}
});
Path : https://api2.foblgate.com/api/ticker/orderBook
Request
Type : POST
Return Type : application/json
Description : The call receives orderBook data (public)
request parameter
Parameter | type | Description |
---|---|---|
pairName | String | Coin Name / Maket Name (Ex. ETH/BTC, LTC/BTC, ATX/BTC) |
apiKey | String | Open API Public Key |
{"trest":"testt"}
response parameter(json)
Parameter | type | Description |
---|---|---|
funcName | String | request func name (Options. orderBook) |
status | String | error code |
message | String | return message |
data | Object | return data object |
pairName | String | Coin Name / Maket Name (Ex. ETH/BTC, LTC/BTC, ATX/BTC) |
tickUnit | String | price tick unit |
orderMinUnit | String | Minimum requested order amount |
amountUnit | String | amount tick unit |
buyList | Array | Orderbook buy List |
price | String | Price |
amount | String | Amount |
sellList | Array | Orderbook sell List |
price | String | Price |
amount | String | Amount |
1.2 publicSign
var request = require('request');
var crypto = require('crypto');
var apiKey = "d5f3a6b82d6a7aea"; // You'r Public Api Key
var scretKey = "451891f41c220e57"; // You'r Secret Api Key
var pairName = "ETH/BTC";
var formData = {
apiKey : apiKey,
pairName : pairName
};
var secretHash = crypto.createHash('sha256').update(apiKey + pairName + scretKey).digest('hex');
var options = {
url: 'https://api2.foblgate.com/api/ticker/publicSign',
headers: {
SecretHeader: secretHash
},
form:formData
};
request.post(options, function (error, response, body) {
if (error) {
console.error(error);
} else {
console.log(body);
}
});
Path : https://api2.foblgate.com/api/ticker/publicSign
Request
Type : POST
Return Type : application/json
Description : The call receives public sign data (public)
request parameter
Parameter | type | Description |
---|---|---|
pairName | String | Coin Name / Maket Name (Ex. ETH/BTC, LTC/BTC, ATX/BTC) |
apiKey | String | Open API Public Key |
response parameter(json)
Parameter | type | Description |
---|---|---|
funcName | String | request func name (Options. publicSign) |
status | String | error code |
message | String | return message |
data | Object | [ action | price | amount | time ] String Array |
2.CHART
2.1 selectChart
var request = require('request');
var crypto = require('crypto');
let moment = require('moment');
var apiKey = "d5f3a6b82d6a7aea"; // You'r Public Api Key
var scretKey = "451891f41c220e57"; // You'r Secret Api Key
var pairName = "ETH/BTC";
var type = 0;
var min = 240;
var startDateTime = moment().format('YYYYMMDDHHmmss');
var cnt = 10;
var formData = {
apiKey: apiKey,
pairName: pairName,
type: type,
min: min,
startDateTime: startDateTime,
cnt: cnt
};
var secretHash = crypto.createHash('sha256').update(apiKey + pairName + type + min + startDateTime + cnt + scretKey).digest('hex');
var options = {
url: 'https://api2.foblgate.com/api/chart/selectChart',
headers: {
SecretHeader: secretHash
},
form:formData
};
request.post(options, function (error, response, body) {
if (error) {
console.error(error);
} else {
console.log(body);
}
});
Path : https://api2.foblgate.com/api/chart/selectChart
Request
Type : POST
Return Type : application/json
Description : The call receives chart data (public)
request parameter
Parameter | type | Description |
---|---|---|
pairName | String | Coin Name / Maket Name (Ex. ETH/BTC, LTC/BTC, ATX/BTC) |
type | Int | Chart Type (0:minute, 1:day, 2:week, 3:month) |
min | Int | If Type is 0. requied (Ex. 1, 5, 15, 30, 60, 240) |
startDateTime | String | Seach start date. request In reverse order. (yyyyMMddHHmmss) |
cnt | Int | Number of result to fetch |
response parameter(json)
Parameter | type | Description |
---|---|---|
funcName | String | request func name (Options. selectChart) |
status | String | error code |
message | String | return message |
data | Object | [ time | open | high | low | close | volume ] String Array |
3.ACCOUNT
3.1 balance
var request = require('request');
var crypto = require('crypto');
var apiKey = "d5f3a6b82d6a7aea"; // You'r Public Api Key
var scretKey = "451891f41c220e57"; // You'r Secret Api Key
var mbId = "api_test@dealab.com";
var formData = {
apiKey : apiKey,
mbId : mbId
};
var secretHash = crypto.createHash('sha256').update(apiKey + mbId + scretKey).digest('hex');
var options = {
url: 'https://api2.foblgate.com/api/account/balance',
headers: {
SecretHeader: secretHash
},
form:formData
};
request.post(options, function (error, response, body) {
if (error) {
console.error(error);
} else {
console.log(body);
}
});
Path : https://api2.foblgate.com/api/account/balance
Request Type : POST
Return Type : application/json
Description : The call receives balance data (private)
request parameter
Parameter | type | Description |
---|---|---|
mbId | String | user Id |
apiKey | String | Open API Public Key |
response parameter(json)
Parameter | type | Description |
---|---|---|
funcName | String | request func name (Options. balance) |
status | String | error code |
message | String | return message |
data | Object | return data object |
avail | Array | User avail coin |
COINNAME | String | coin value (Ex. "BTC" : "1.00001") |
total | Array | User total coin |
COINNAME | String | coin value (Ex. "ETH" : "0.4528") |
in_use | Array | User used coin |
COINNAME | String | coin value (Ex. "XRP" : "85.7983") |
buy_price | Array | By average price |
COINNAME | String | coin value (Ex. "BTC" : "13066031.18955539") |
in_withdraw | Array | Withdrawable amount |
COINNAME | String | coin value (Ex. "BTC" : "1.1895") |
3.2 notSignBalance
var request = require('request');
var crypto = require('crypto');
var apiKey = "d5f3a6b82d6a7aea"; // You'r Public Api Key
var scretKey = "451891f41c220e57"; // You'r Secret Api Key
var mbId = "api_test@dealab.com";
var pairName = "ETH/BTC";
var action = "bid";
var cnt = "10";
var skipIdx = "0";
var formData = {
apiKey : apiKey,
mbId : mbId,
pairName : pairName,
action : action,
cnt : cnt,
skipIdx : skipIdx
};
var secretHash = crypto.createHash('sha256').update(apiKey + mbId + pairName + action + cnt + skipIdx + scretKey).digest('hex');
var options = {
url: 'https://api2.foblgate.com/api/account/notSignBalance',
headers: {
SecretHeader: secretHash
},
form:formData
};
request.post(options, function (error, response, body) {
if (error) {
console.error(error);
} else {
console.log(body);
}
});
Path : https://api2.foblgate.com/api/account/notSignBalance
Request
Type : POST
Return Type : application/json
Description : The call receives not sign balance data
(private)
request parameter
Parameter | type | Description |
---|---|---|
mbId | String | user Id |
pairName | String | Coin Name / Maket Name (Ex. ETH/BTC, LTC/BTC, ATX/BTC) |
action | String | Order type (Ex. bid, ask, all) |
cnt | Int | Number of result to fetch |
skipIdx | String | Number of skip count |
apiKey | String | Open API Public Key |
response parameter(json)
Parameter | type | Description |
---|---|---|
funcName | String | request func name (Options. notSignBalance) |
status | String | error code |
message | String | return message |
data | Object | return data object |
totalCnt | Int | Total count |
list | Array | User not sign List |
ordNo | Int | Order number |
ordDt | String | Order time (yyyyMMddHHmmss) |
mbId | String | User id |
pairName | String | Coin Name / Maket Name (Ex. ETH/BTC, LTC/BTC, ATX/BTC) |
action | String | Order type (Ex. bid, ask) |
ordPrice | String | Order price |
ordAmount | String | Order amount |
remainAmount | String | Order remaining quantity |
3.3 orderHistory
var request = require('request');
var crypto = require('crypto');
var apiKey = "d5f3a6b82d6a7aea"; // You'r Public Api Key
var scretKey = "451891f41c220e57"; // You'r Secret Api Key
var mbId = "api_test@dealab.com";
var pairName = "ETH/BTC";
var action = "bid";
var cnt = "10";
var skipIdx = "0";
var formData = {
apiKey : apiKey,
mbId : mbId,
pairName : pairName,
action : action,
cnt : cnt,
skipIdx : skipIdx
};
var secretHash = crypto.createHash('sha256').update(apiKey + mbId + pairName + action + cnt + skipIdx + scretKey).digest('hex');
var options = {
url: 'https://api2.foblgate.com/api/account/orderHistory',
headers: {
SecretHeader: secretHash
},
form:formData
};
request.post(options, function (error, response, body) {
if (error) {
console.error(error);
} else {
console.log(body);
}
});
Path : https://api2.foblgate.com/api/account/orderHistory
Request
Type : POST
Return Type : application/json
Description : The call receives user order history data
(private)
request parameter
Parameter | type | Description |
---|---|---|
mbId | String | user Id |
pairName | String | Coin Name / Maket Name (Ex. ETH/BTC, LTC/BTC, ATX/BTC) |
action | String | Order type (Ex. bid, ask, all) |
cnt | Int | Number of result to fetch |
skipIdx | String | Number of skip count |
apiKey | String | Open API Public Key |
response parameter(json)
Parameter | type | Description |
---|---|---|
funcName | String | request func name (Options. orderHistory) |
status | String | error code |
message | String | return message |
data | Object | return data object |
totalCnt | Int | Total count |
list | Array | User order history List |
pairName | String | Coin Name / Maket Name (Ex. ETH/BTC, LTC/BTC, ATX/BTC) |
ordNo | Int | Order number |
ordDt | String | Order time (yyyyMMddHHmmss) |
action | String | Order type (Ex. bid, ask) |
ordPrice | String | Order price |
ordAmount | String | Order amount |
balance | String | Total Order amount (price * amount) |
fee | String | Order fee |
isCancel | Boolean | Whether to cancel |
3.4 signHistory
var request = require('request');
var crypto = require('crypto');
var apiKey = "d5f3a6b82d6a7aea"; // You'r Public Api Key
var scretKey = "451891f41c220e57"; // You'r Secret Api Key
var mbId = "api_test@dealab.com";
var pairName = "ETH/BTC";
var action = "bid";
var cnt = "10";
var skipIdx = "0";
var formData = {
apiKey : apiKey,
mbId : mbId,
pairName : pairName,
action : action,
cnt : cnt,
skipIdx : skipIdx
};
var secretHash = crypto.createHash('sha256').update(apiKey + mbId + pairName + action + cnt + skipIdx + scretKey).digest('hex');
var options = {
url: 'https://api2.foblgate.com/api/account/signHistory',
headers: {
SecretHeader: secretHash
},
form:formData
};
request.post(options, function (error, response, body) {
if (error) {
console.error(error);
} else {
console.log(body);
}
});
Path : https://api2.foblgate.com/api/account/signHistory
Request
Type : POST
Return Type : application/json
Description : The call receives user sign history data
(private)
request parameter
Parameter | type | Description |
---|---|---|
mbId | String | user Id |
pairName | String | Coin Name / Maket Name (Ex. ETH/BTC, LTC/BTC, ATX/BTC) |
action | String | Order type (Ex. bid, ask, all) |
cnt | Int | Number of result to fetch |
skipIdx | String | Number of skip count |
apiKey | String | Open API Public Key |
response parameter(json)
Parameter | type | Description |
---|---|---|
funcName | String | request func name (Options. signHistory) |
status | String | error code |
message | String | return message |
data | Object | return data object |
totalCnt | Int | Total count |
list | Array | User sign history List |
mbId | String | User id |
pairName | String | Coin Name / Maket Name (Ex. ETH/BTC, LTC/BTC, ATX/BTC) |
ordNo | Int | Order number |
ordDt | String | Order time (yyyyMMddHHmmss) |
action | String | Order type (Ex. bid, ask) |
signPrice | String | Sign price |
signAmount | String | Sign amount |
signBalance | String | Sign total order amount (price * amount) |
signDt | String | Sign time (yyyyMMddHHmmss) |
fee | String | fee |
adjBalance | String | Amount excluding the fee from the sign balance |
3.5 depositWithDraw
var request = require('request');
var crypto = require('crypto');
var apiKey = "d5f3a6b82d6a7aea"; // You'r Public Api Key
var scretKey = "451891f41c220e57"; // You'r Secret Api Key
var mbId = "api_test@dealab.com";
var action = "bid";
var cnt = "10";
var skipIdx = "0";
var formData = {
apiKey : apiKey,
mbId : mbId,
action : action,
cnt : cnt,
skipIdx : skipIdx
};
var secretHash = crypto.createHash('sha256').update(apiKey + mbId + action + cnt + skipIdx + scretKey).digest('hex');
var options = {
url: 'https://api2.foblgate.com/api/account/depositWithDraw',
headers: {
SecretHeader: secretHash
},
form:formData
};
request.post(options, function (error, response, body) {
if (error) {
console.error(error);
} else {
console.log(body);
}
});
Path : https://api2.foblgate.com/api/account/depositWithDraw
Request
Type : POST
Return Type : application/json
Description : The call receives user deposit withdraw
history data (private)
request parameter
Parameter | type | Description |
---|---|---|
mbId | String | user Id |
action | String | deposit / withdraw / admin Type (Ex. withdraw, deposit, ALL, ADMIN) |
cnt | Int | Number of result to fetch |
skipIdx | String | Number of skip count |
apiKey | String | Open API Public Key |
response parameter(json)
Parameter | type | Description |
---|---|---|
funcName | String | request func name (Options. depositWithDraw) |
status | String | error code |
message | String | return message |
data | Array | return data object |
reqId | Int | Request id |
odId | Int | Order id |
txid | String | Transaction id |
status | String | status () |
action | Int | Deposit or Withdraw Type |
odReceiptCoin | String | Actual amount of withdrawal / deposit amount |
odRequestCoin | String | Request withdraw amount. / deposit amount |
odRequestFee | String | Request withdraw fee. |
odRequestAddress | String | Request withdraw address. |
coinName | String | Coin name |
odBankName | String | Bank name |
odBankHolder | String | Bank holder |
coinFlag | String | Coin index |
depositMemo | String | Deposit memo (ex: XRP destination code) |
mbId | String | User id |
withdrawConfirmYn | String | User approval status |
adminId | String | Admin ID |
reject | String | The reason for reject |
txFee | String | Blockchain fee |
errorMessage | String | transaction error message |
date | String | At the time of registration (yyyyMMddHHmmss) |
4.TRADE
4.1 orderPlace
var request = require('request');
var crypto = require('crypto');
var apiKey = "d5f3a6b82d6a7aea"; // You'r Public Api Key
var scretKey = "451891f41c220e57"; // You'r Secret Api Key
var mbId = "api_test@dealab.com";
var pairName = "ETH/BTC";
var action = "bid";
var price = "0.05";
var amount = "1.2";
var formData = {
apiKey : apiKey,
mbId : mbId,
pairName : pairName,
action : action,
price : price,
amount : amount,
};
var secretHash = crypto.createHash('sha256').update(apiKey + mbId + pairName + action + price + amount + scretKey).digest('hex');
var options = {
url: 'https://api2.foblgate.com/api/trade/orderPlace',
headers: {
SecretHeader: secretHash
},
form:formData
};
request.post(options, function (error, response, body) {
if (error) {
console.error(error);
} else {
console.log(body);
}
});
Path : https://api2.foblgate.com/api/trade/orderPlace
Request
Type : POST
Return Type : application/json
Description : The call is used for placing orders.
request parameter
Parameter | type | Description |
---|---|---|
mbId | String | user Id |
pairName | String | Coin Name / Maket Name (Ex. ETH/BTC, LTC/BTC, ATX/BTC) |
action | String | Order type (Ex. bid, ask, all) |
price | String | price of order |
amount | String | amount of order |
apiKey | String | Open API Public Key |
response parameter(json)
Parameter | type | Description |
---|---|---|
funcName | String | request func name (Options. orderPlace) |
status | String | error code |
message | String | return message |
4.2 orderCancel
var request = require('request');
var crypto = require('crypto');
var apiKey = "d5f3a6b82d6a7aea"; // You'r Public Api Key
var scretKey = "451891f41c220e57"; // You'r Secret Api Key
var mbId = "api_test@dealab.com";
var pairName = "ETH/BTC";
var ordNo = "1";
var action = "bid";
var ordPrice = "0.05";
var formData = {
apiKey : apiKey,
mbId : mbId,
pairName : pairName,
ordNo : ordNo,
action : action,
ordPrice : ordPrice
};
var secretHash = crypto.createHash('sha256').update(apiKey + mbId + pairName + ordNo + action + ordPrice + scretKey).digest('hex');
var options = {
url: 'https://api2.foblgate.com/api/trade/orderCancel',
headers: {
SecretHeader: secretHash
},
form:formData
};
request.post(options, function (error, response, body) {
if (error) {
console.error(error);
} else {
console.log(body);
}
});
Path : https://api2.foblgate.com/api/trade/orderCancel
Request
Type : POST
Return Type : application/json
Description : The call is used for order cancel.
request parameter
Parameter | type | Description |
---|---|---|
mbId | String | user Id |
pairName | String | Coin Name / Maket Name (Ex. ETH/BTC, LTC/BTC, ATX/BTC) |
ordNo | String | Order number |
action | String | Order type (Ex. bid, ask, all) |
ordPrice | String | price of order |
apiKey | String | Open API Public Key |
response parameter(json)
Parameter | type | Description |
---|---|---|
funcName | String | request func name (Options. orderCancel) |
status | String | error code |
message | String | return message |
Errors
The Bimax API uses the following error codes:
Error Code | Meaning |
---|---|
0 | IS_OK -- Your request sucks |
5000 | IS_NOT_READY -- Server is not ready. |
5001 | INVALID_PARAM -- Parameter is invalid. |
5002 | LOW_KRW_BALANCE -- Request Krw Balance is Low. |
5003 | LOW_COIN_BALANCE -- Request coin balance is low. |
5004 | NO_EXIST_ORD -- Request order is not exist. |
5005 | ALREADY_EXIST_ORD -- Request order is not exist. |
5006 | TOO_MANY_NOT_SIGN -- Request order is not exist. |
5998 | TOO_MANY_REQUEST -- too many request error. |
6001 | NOT_CHECK_KEY -- api key validation error. |
6002 | UNKOWN_APINO -- This is an unknown api no. |
6101 | NOT_MEMBER_ID -- This is an unknown member id. |
6102 | PAREMETER_ERROR -- This is an parameter error. |
6103 | UNKOWN_FUNCNAME -- This is an unknown funcname. |
6104 | NOT_MARKET_NAME -- This is an unknown market name. |
6105 | UNKOWN_PAIRNAME -- This is an unknown pairname. |
9998 | UNKNOW_WRR -- This is an unknown error. |
-1900 | NEED_TOKEN -- A token value is required. |
-2000 | INVALID_TOKEN -- Token is invalid. |
-2400 | OAUTH_TOKEN_FAIL -- Failed to validate token value. |