AML-Services abrufen
Listet die AML-Prüftypen auf, die für Ihr Projekt angeboten werden, jeweils mit eigenem Preis.
POST /v1/aml-checks
Anfrage
Für diese Anfrage sind keine Parameter erforderlich.
bash
#!/bin/bash
API_TOKEN="your_api_token"
API_SECRET="your_api_secret"
REQUEST_BODY='{}'
# Signatur berechnen
SIGNATURE=$(echo -n "${REQUEST_BODY}${API_SECRET}" | sha256sum | cut -d' ' -f1)
# API-Anfrage senden
curl -X POST "https://api.trxup.com/v1/aml-checks" \
-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({});
// Signatur berechnen
const signature = crypto
.createHash('sha256')
.update(requestBody + apiSecret)
.digest('hex');
// API-Anfrage senden
axios({
method: 'post',
url: 'https://api.trxup.com/v1/aml-checks',
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([]);
// Signatur berechnen
$signature = hash('sha256', $requestBody . $apiSecret);
// API-Anfrage senden
$ch = curl_init('https://api.trxup.com/v1/aml-checks');
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({})
# Signatur berechnen
signature = hashlib.sha256((request_body + api_secret).encode()).hexdigest()
# API-Anfrage senden
headers = {
'Authorization': f'Bearer {api_token}',
'X-Signature': signature,
'Content-Type': 'application/json'
}
response = requests.post(
'https://api.trxup.com/v1/aml-checks',
headers=headers,
data=request_body
)
print(response.json())Antwort
Die Antwort ist immer eine Liste mit einem Eintrag pro Prüftyp, der für Ihr Projekt angeboten wird: address und/oder hash. Jeder Typ ist ein eigener Service mit eigener Kennung und eigenem Preis — eine Prüfung eines Transaktionshashs kann einen anderen Preis haben als eine Adressprüfung. Wird nichts angeboten, ist die Liste leer ([]).
Antwortfelder
| Feld | Typ | Beschreibung |
|---|---|---|
| code | integer | Antwortcode (0 = Erfolg) |
| request_id | string | Eindeutiger Anfrage-Bezeichner |
| result | array | Liste der verfügbaren AML-Services |
| result[].id | string | Kennung des AML-Services |
| result[].type | string | Typ des AML-Services (address oder hash) |
| result[].price | float | Preis pro Prüfung dieses Typs |
Beispielantwort
json
{
"code": 0,
"request_id": "bbf74bcd-fb36-4df8-adc8-25f2bacd087b",
"result": [
{
"id": "3",
"type": "address",
"price": 2.5
},
{
"id": "4",
"type": "hash",
"price": 3.75
}
]
}Mögliche Fehler
| Fehlercode | Key | Beschreibung |
|---|---|---|
| 1 | auth | Authentifizierungsfehler (falsches Token oder Signatur) |
| 500 | internal_server_error | Interner Serverfehler |