Skip to content

检查 AML 状态

获取已有 AML 检查的最新状态及风险评估。若有新信息,数据会自动刷新。

POST /v1/aml-checks/check

请求

请求参数

字段类型必填说明
idstringAML 检查 ID
bash
#!/bin/bash
API_TOKEN="your_api_token"
API_SECRET="your_api_secret"
REQUEST_BODY='{
  "id": "01jq7h6bvf6p5t1amnz6y3n8c4"
}'

# 计算签名
SIGNATURE=$(echo -n "${REQUEST_BODY}${API_SECRET}" | sha256sum | cut -d' ' -f1)

# 发送请求
curl -X POST "https://api.tronzap.com/v1/aml-checks/check" \
  -H "Authorization: Bearer ${API_TOKEN}" \
  -H "X-Signature: ${SIGNATURE}" \
  -H "Content-Type: application/json" \
  -d "${REQUEST_BODY}"
javascript
const crypto = require('crypto');
const axios = require('axios');

const apiToken = 'your_api_token';
const apiSecret = 'your_api_secret';
const requestBody = JSON.stringify({
  id: '01jq7h6bvf6p5t1amnz6y3n8c4'
});

// 计算签名
const signature = crypto
  .createHash('sha256')
  .update(requestBody + apiSecret)
  .digest('hex');

// 发送请求
axios({
  method: 'post',
  url: 'https://api.tronzap.com/v1/aml-checks/check',
  headers: {
    'Authorization': `Bearer ${apiToken}`,
    'X-Signature': signature,
    'Content-Type': 'application/json'
  },
  data: requestBody
})
.then(response => console.log(response.data))
.catch(error => console.error(error));
php
<?php
$apiToken = 'your_api_token';
$apiSecret = 'your_api_secret';
$requestBody = json_encode([
  'id' => '01jq7h6bvf6p5t1amnz6y3n8c4'
]);

// 计算签名
$signature = hash('sha256', $requestBody . $apiSecret);

// 发送请求
$ch = curl_init('https://api.tronzap.com/v1/aml-checks/check');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $requestBody);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  'Authorization: Bearer ' . $apiToken,
  'X-Signature: ' . $signature,
  'Content-Type: application/json'
]);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>
python
import hashlib
import json
import requests

api_token = 'your_api_token'
api_secret = 'your_api_secret'
request_body = json.dumps({
  'id': '01jq7h6bvf6p5t1amnz6y3n8c4'
})

# 计算签名
signature = hashlib.sha256((request_body + api_secret).encode()).hexdigest()

# 发送请求
headers = {
  'Authorization': f'Bearer {api_token}',
  'X-Signature': signature,
  'Content-Type': 'application/json'
}

response = requests.post(
  'https://api.tronzap.com/v1/aml-checks/check',
  headers=headers,
  data=request_body
)

print(response.json())

响应

返回 AML 检查的最新风险数据。若检查仍在进行中,状态会保持为 pendingprocessing

响应字段

字段类型说明
codeinteger响应码(0 = 成功)
resultobjectAML 检查数据
result.idstringAML 检查 ID
result.typestringAML 服务类型(addresshash
result.addressstring被检查的地址
result.hashstring被检查的哈希(仅 hash 服务)
result.directionstring交易方向(depositwithdrawal
result.networkstring区块链网络代码
result.statusstring当前状态(pending, processing, completed, failed
result.risk_scorefloat风险评分
result.risk_levelstring风险等级(low、medium、high)
result.blacklistboolean是否命中黑名单
result.risk_factorsarray风险因素列表
result.checked_atstring检查创建时间(ISO 8601)

响应示例

json
{
  "code": 0,
  "result": {
    "id": "01jq7h6bvf6p5t1amnz6y3n8c4",
    "type": "hash",
    "address": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
    "hash": "E3F2A1B66DBB9F0B24C4125229163944A7D91EB3F1AC5E409FFCEE0C81A913F2",
    "direction": "withdrawal",
    "network": "BTC",
    "status": "processing",
    "risk_score": null,
    "risk_level": null,
    "blacklist": false,
    "risk_factors": [
      {
        "name": "p2p_exchange_mlrisk_high",
        "label": "P2P Exchange (High Risk)",
        "group": "medium",
        "score": 0.796
      },
      {
        "name": "exchange",
        "label": "Exchange",
        "group": "low",
        "score": 0.203
      }
    ],
    "checked_at": "2024-03-25T10:42:12Z"
  }
}

可能的错误

错误码说明
1认证错误(令牌或签名无效)
2参数无效
30未找到 AML 检查
500服务器内部错误

Tron Energy API Documentation