HAMBOOK API Dokumentation

Integrieren Sie Ihre Amateurfunksoftware mit dem hambook.site Logbuch

Authentifizierung & Sicherheit

Für die Arbeit mit der API benötigen Sie einen persönlichen API Key. Alle API-Anfragen müssen im Kontext eines bestimmten Website-Benutzers ausgeführt werden.

So erhalten Sie Ihren API-Schlüssel:
  1. Melden Sie sich in Ihrem persönlichen Kabinett auf dem hambook.site Portal an.
  2. Gehen Sie auf die Registerkarte 'Einstellungen' und suchen Sie den Bereich 'API-Schlüssel'.
  3. Geben Sie den Namen Ihrer Anwendung ein und klicken Sie auf 'Schlüssel generieren'.
HTTP-Anfrageformat

Die Übertragung der QSO-Daten erfolgt über eine Standard-POST-Anfrage. Der Autorisierungsschlüssel muss entweder im HTTP-Header oder als GET-Parameter übergeben werden.

Method POST
Endpoint URL https://hambook.site/api/v1/qso/
Auth Header X-Hambook-Key: [your_api_key]
Alternative GET Auth https://hambook.site/api/v1/qso/?key=[your_api_key]

Akzeptierte Anfrageparameter

Die Daten sollten im Format application/x-www-form-urlencoded übermittelt werden (Standard-POST-Anfrage).

Parameter Type Required Description / Example
call string YES Rufzeichen des Korrespondenten (wird automatisch in Großbuchstaben umgewandelt).
Example: W1AW, R3TJL/3
my_call string No Ihr Rufzeichen (Station). Wenn leer, wird automatisch das Hauptrufzeichen des Benutzers verwendet.
Example: R8LCA
band string No Frequenzband im ADIF-Format (wird automatisch in Großbuchstaben umgewandelt).
Example: 20m, 40m, 2m
mode string No Modulationsart (Mode) im ADIF-Format.
Example: CW, SSB, FT8
submode string No Modulationssubmodus (für FT4, PSK31 usw.).
Example: FT4
freq float No Genaue QSO-Frequenz in MHz.
Example: 14.074
qso_date string No QSO-Datum im Format JJJJMMTT. Wenn leer, wird das aktuelle Datum verwendet.
Example: 20260623 (YYYYMMDD)
time_on string No QSO-Startzeit im Format HHMM (UTC). Wenn leer, wird die aktuelle Zeit verwendet.
Example: 1753 (HHMM, UTC)
rst_sent string No Gesendeter RST-Rapport.
Example: 599, -12 (Default: 59)
rst_rcvd string No Empfangener RST-Rapport.
Example: 59, -08 (Default: 59)
gridsquare string No Grid-Locator des Korrespondenten.
Example: FN31, LO06ff
my_gridsquare string No Ihr Grid-Locator während des QSOs.
Example: LO06ee
qth string No Stadt/Standort des Korrespondenten.
Example: Nizhny Novgorod
name string No Name des Korrespondenten.
Example: John
comment string No Benutzerdefinierter Kommentar für das QSO.
Example: QRP 5W, dipole

Server-Antwortformate (JSON)

Die hambook.site API gibt auch im Fehlerfall immer eine Antwort im JSON-Format mit dem HTTP-Status 200 zurück.

Erfolgreich aufgezeichnet
{
  "status": "success",
  "id": 471295
}
Duplikat erkannt (ignoriert)
{
  "status": "success",
  "message": "Duplicate ignored",
  "id": 471294
}
Authentifizierungsfehler
{
  "status": "error",
  "message": "Invalid API Key"
}

Code-Integrationsbeispiele

<?php
$ch = curl_init('https://hambook.site/api/v1/qso/');
$data = [
    'call' => 'W1AW',
    'band' => '20m',
    'mode' => 'CW',
    'rst_sent' => '599',
    'rst_rcvd' => '599',
    'comment' => 'Logged via API'
];

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'X-Hambook-Key: YOUR_API_KEY_HERE'
]);

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

$result = json_decode($response, true);
print_r($result);
?>
import requests

url = 'https://hambook.site/api/v1/qso/'
headers = {
    'X-Hambook-Key': 'YOUR_API_KEY_HERE'
}
data = {
    'call': 'W1AW',
    'band': '20m',
    'mode': 'CW',
    'rst_sent': '599',
    'rst_rcvd': '599',
    'comment': 'Logged via Python API'
}

response = requests.post(url, headers=headers, data=data)
result = response.json()
print(result)