Sprawdź status AML
Pobiera najnowszy status i ocenę ryzyka istniejącej weryfikacji AML. Dane są aktualizowane, gdy pojawiają się nowe informacje.
POST /v1/aml-checks/check
Żądanie
Parametry
| Pole | Typ | Wymagane | Opis |
|---|---|---|---|
| id | string | Tak | Identyfikator weryfikacji AML |
bash
#!/bin/bash
API_TOKEN="your_api_token"
API_SECRET="your_api_secret"
REQUEST_BODY='{
"id": "1042"
}'
# Oblicz sygnaturę
SIGNATURE=$(echo -n "${REQUEST_BODY}${API_SECRET}" | sha256sum | cut -d' ' -f1)
# Wyślij żądanie API
curl -X POST "https://api.trxup.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: '1042'
});
// Oblicz sygnaturę
const signature = crypto
.createHash('sha256')
.update(requestBody + apiSecret)
.digest('hex');
// Wyślij żądanie API
axios({
method: 'post',
url: 'https://api.trxup.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' => '1042'
]);
// Oblicz sygnaturę
$signature = hash('sha256', $requestBody . $apiSecret);
// Wyślij żądanie API
$ch = curl_init('https://api.trxup.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': '1042'
})
# Oblicz sygnaturę
signature = hashlib.sha256((request_body + api_secret).encode()).hexdigest()
# Wyślij żądanie API
headers = {
'Authorization': f'Bearer {api_token}',
'X-Signature': signature,
'Content-Type': 'application/json'
}
response = requests.post(
'https://api.trxup.com/v1/aml-checks/check',
headers=headers,
data=request_body
)
print(response.json())Odpowiedź
Zwraca szczegóły weryfikacji AML z najnowszymi danymi ryzyka. Jeśli weryfikacja ma nadal status pending, serwer przed odpowiedzią ponownie pyta o wynik, więc każde wywołanie zwraca najnowszy stan; odpytuj dalej, aż status się zmieni.
Pola odpowiedzi
| Pole | Typ | Opis |
|---|---|---|
| code | integer | Kod odpowiedzi (0 = sukces) |
| request_id | string | Unikalny identyfikator żądania |
| result | object | Dane weryfikacji AML |
| result.id | string | Identyfikator weryfikacji AML |
| result.type | string | Typ usługi AML (address lub hash) |
| result.address | string | Weryfikowany adres |
| result.network | string | Kod sieci blockchain zapisany tak jak na liście obsługiwanych sieci (np. TRX, TetherOMNI) |
| result.status | string | Aktualny status (pending, processing, completed, failed, expired, skipped) |
| result.risk_score | string|null | Ocena ryzyka jako ciąg z dwoma miejscami po przecinku (np. "12.50") lub null, gdy ocena nie jest jeszcze dostępna |
| result.risk_level | string|null | Poziom ryzyka (low, medium, high) |
| result.blacklist | boolean | Informacja, czy wykryto wpis na liście blokad |
| result.risk_factors | array | Kategorie ryzyka, z którymi powiązane są środki, posortowane malejąco według score, jeden wpis na kategorię; pusta [], gdy nie zgłoszono żadnej kategorii (np. dopóki weryfikacja nie została zakończona) |
| result.risk_factors[].name | string | Klucz kategorii, jeden z wymienionych w sekcji Kategorie czynników ryzyka; kategoria spoza tej listy jest zgłaszana jako other |
| result.risk_factors[].label | string | Angielska nazwa kategorii (nietłumaczona) |
| result.risk_factors[].group | string | Grupa ryzyka kategorii: low, medium lub high |
| result.risk_factors[].score | number | Udział środków powiązanych z tą kategorią, od 0 do 1, zaokrąglony do 3 miejsc po przecinku |
| result.checked_at | string | Znacznik czasu utworzenia weryfikacji (ISO 8601) |
| result.hash | string | Weryfikowany hash transakcji (tylko dla weryfikacji hash) |
| result.direction | string | Weryfikowana strona transakcji, deposit lub withdrawal (tylko dla weryfikacji hash) |
Kategorie czynników ryzyka
risk_factors[].name jest zawsze jednym z tych kluczy. Kategoria spoza tej listy jest zgłaszana jako other. label jest zawsze po angielsku: to część odpowiedzi, a nie tłumaczenie.
| name | label | group |
|---|---|---|
enforcement_action | Enforcement Action | high |
ransom | Ransom | high |
dark_market | Dark Market | high |
dark_service | Dark Service | high |
illegal_service | Illegal Service | high |
mixer | Mixer | high |
scam | Scam | high |
gambling | Gambling | high |
stolen_coins | Stolen Coins | high |
exchange_fraudulent | Fraudulent Exchange | high |
child_exploitation | Child Exploitation | high |
sanctions | Sanctions | high |
terrorism_financing | Terrorism Financing | high |
malware | Malware | high |
infrastructure_as_a_service | Infrastructure-as-a-Service | medium |
decentralized_exchange_contract | Decentralized Exchange Contract | medium |
unnamed_service | Unnamed Service | medium |
atm | ATM | medium |
risky_exchange | Risky Exchange | medium |
p2p_exchange_mlrisk_high | P2P Exchange (High Risk) | medium |
liquidity_pools | Liquidity Pools | medium |
exchange | Exchange | low |
merchant_services | Merchant Services | low |
wallet | Wallet | low |
miner | Miner | low |
payment | Payment | low |
marketplace | Marketplace | low |
p2p_exchange | P2P Exchange | low |
seized_assets | Seized Assets | low |
other | Other | low |
Przykładowa odpowiedź
json
{
"code": 0,
"request_id": "bbf74bcd-fb36-4df8-adc8-25f2bacd087b",
"result": {
"id": "1042",
"type": "address",
"address": "TPY1Kb8cKAZQfm95gXQQs2Mh8Uygtos21D",
"network": "TRX",
"status": "completed",
"risk_score": "12.50",
"risk_level": "medium",
"blacklist": false,
"risk_factors": [
{
"name": "exchange",
"label": "Exchange",
"group": "low",
"score": 0.9
},
{
"name": "p2p_exchange_mlrisk_high",
"label": "P2P Exchange (High Risk)",
"group": "medium",
"score": 0.1
}
],
"checked_at": "2024-03-25T10:42:12+00:00"
}
}W przypadku weryfikacji hash pola hash i direction następują po checked_at:
json
{
"code": 0,
"request_id": "bbf74bcd-fb36-4df8-adc8-25f2bacd087b",
"result": {
"id": "1043",
"type": "hash",
"address": "TPY1Kb8cKAZQfm95gXQQs2Mh8Uygtos21D",
"network": "TRX",
"status": "completed",
"risk_score": "3.20",
"risk_level": "low",
"blacklist": false,
"risk_factors": [],
"checked_at": "2024-03-25T10:44:31+00:00",
"hash": "E3F2A1B66DBB9F0B24C4125229163944A7D91EB3F1AC5E409FFCEE0C81A913F2",
"direction": "deposit"
}
}Możliwe błędy
| Kod błędu | Key | Opis |
|---|---|---|
| 1 | auth | Błąd uwierzytelniania (nieprawidłowy token lub sygnatura) |
| 2 | invalid_service_or_params | Nieprawidłowe parametry (brak id lub jest puste) |
| 30 | aml_check_not_found | Weryfikacja AML nie została znaleziona lub należy do innego konta |
| 500 | internal_server_error | Wewnętrzny błąd serwera |