Request Specifications
General API Information
- The base endpoint is: https://cb.link-kycapi.com
- All endpoints return either a JSON object or array.
- All request parameters should be passed in the request body as either a JSON object or array.
- All endpoints require passing a valid
X-SHA-Signature
header.- Do note that the signature generation method here may not align with the method used for calling other Binance API endpoints (such as https://fapi.binance.com)
- All endpoints should be called from whitelisted IP addresses.
- Otherwise, it is expected that you would encounter a HTTP
403
return code.
- Otherwise, it is expected that you would encounter a HTTP
Signature Generation
- KYC Data should be sent in the Request Body in JSON format.
- Convert the Request Body JSON to a JSON String
- Use the HmacSHA256 algorithm to sign the JSON String, and assign the result to the
X-SHA-Signature
request header.
Examples
- Request Body to be sent:
{
"bizEntityKey": "<your_biz_entity_key>",
"entityCustomerId": "<your_user_id>",
"kycType": "USER",
"extra": {
},
"notifyUrl": "<your_notify_url>"
}
- Converted Request BODY to JSON String:
{ "bizEntityKey": "<your_biz_entity_key>", "entityCustomerId": "<your_user_id>", "kycType": "USER", "extra": { },"notifyUrl": "<your_notify_url>" }
- Sign the JSON String (see below examples).
NodeJS Example
const crypto = require('crypto')
const secret = '<your_secret_key>'
const postData = {
bizEntityKey: '<your_biz_entity_key>', // entity key will be decided and given Binance team
entityCustomerId: '<your_user_id>',
kycType: 'USER',
extra: {},
notifyUrl: '<your_notify_url>'
}
const hash = crypto.createHmac('sha256', secret).update(JSON.stringify(postData)).digest('hex')
Java Example
import org.apache.commons.codec.binary.Hex;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
public class App {
public static void main(String[] args) throws Exception {
String rawString = "{ \"bizEntityKey\": \"<your_biz_entity_key>\", \"entityCustomerId\": \"<your_user_id>\", \"kycType\": \"USER\", \"extra\": { }, \"notifyUrl\": \"<your_notify_url>\" }";
Mac sha256Hmac = Mac.getInstance("HmacSHA256");
SecretKeySpec secretKey = new SecretKeySpec("<your_secret_key>".getBytes(), "HmacSHA256");
sha256Hmac.init(secretKey);
String eventSignature = new String(Hex.encodeHex(sha256Hmac.doFinal(rawString.getBytes(StandardCharsets.UTF_8))));
System.err.println(eventSignature);
}
}
Python Example
import requests
import json
import hmac
import hashlib
body = {
"bizEntityKey": "<your_biz_entity_key>",
"entityCustomerId": "<your_user_id>",
"kycType": "USER",
"extra": {
},
"notifyUrl": "<your_notify_url>"
}
api_secret = '<your_secret_key>' ##please replace with your own
json.dumps(body, separators=(',', ':')) #use this instead to remove extra spaces
signature = hmac.new(api_secret.encode(), json_str.encode(), hashlib.sha256).hexdigest()