EntwicklerSDKs & Beispiele

UEAD / DEVELOPER REFERENCE

SDKs & Codebeispiele

Sichere serverseitige Beispiele für deine Integration.

QUICKSTART

Deine erste API-Anfrage

Entweder mit OAuth-Benutzertoken oder serverseitigem API-Schlüssel. Geheime Schlüssel niemals in Browsercode speichern.

1

App registrieren

Registriere die App in der Developer Console und wähle eine Umgebung.

2

Scopes freigeben

Für Lesezugriff animals:read, für Schreiben animals:write bzw. reports:write.

3

Zugriff erhalten

OAuth mit Authorization Code + PKCE; Server-zu-Server mit geheimem API-Schlüssel.

4

Mit Listen starten

JSON-Fehler und HTTP-Status prüfen.

Developer Console ↗

CURL

Liste abrufen

cURL · GET animals
# A token/kulcs a szerveren legyen tárolva, ne a böngészőben.
export UEAD_TOKEN='YOUR_SERVER_SIDE_TOKEN'
curl -fsS \
  -H "Authorization: Bearer ${UEAD_TOKEN}" \
  'https://dev.uead.eu/developers/api/v1/animals?limit=10&offset=0'

NODE.JS / SERVER

Serverseitiges JavaScript

Node.js 22+ · fetch
// Node.js 22+ — SERVER-SIDE only, never embed the secret in a web page.
const baseUrl = 'https://dev.uead.eu/developers/api/v1';
const token = process.env.UEAD_API_TOKEN;
if (!token) throw new Error('Missing UEAD_API_TOKEN');

const response = await fetch(`${baseUrl}/animals?limit=25&offset=0`, {
  headers: { Authorization: `Bearer ${token}` }
});
const payload = await response.json();
if (!response.ok) throw new Error(payload.error || `HTTP ${response.status}`);
console.log(payload.items);

SANDBOX

Testdatensatz erstellen

Sandbox-Daten sind von Produktion isoliert.

cURL · POST sandbox animals
# Sandbox hitelesítővel: a környezetet maga a hitelesítő határozza meg.
export UEAD_TOKEN='YOUR_SANDBOX_API_KEY'
curl -fsS -X POST \
  'https://dev.uead.eu/developers/api/v1/animals' \
  -H "Authorization: Bearer ${UEAD_TOKEN}" \
  -H 'Content-Type: application/json' \
  --data '{"data":{"name":"Teszt állat","species":"dog","sex":"female"}}'

PRODUCTION SUBMISSION

Beispiel für Produktion

Das Beispiel benötigt eine echte UEAD-Orts-ID und korrekte Berechtigungen.

cURL · POST reports
# Production példa: a helyazonosító a tényleges UEAD katalógusból származzon.
export UEAD_TOKEN='YOUR_PRODUCTION_SERVER_TOKEN'
export IDEMPOTENCY_KEY='report-20261019-unique-0001'
curl -fsS -X POST \
 'https://dev.uead.eu/developers/api/v1/reports' \
 -H "Authorization: Bearer ${UEAD_TOKEN}" \
 -H 'Content-Type: application/json' \
 -H "Idempotency-Key: ${IDEMPOTENCY_KEY}" \
 --data '{"locale":"hu","data":{"category":"neglect","urgency":"ongoing","eventPlaceId":"VALOS_UEAD_HELY_ID","knowledgeSource":"observed","eventDescription":"Teszt leírás","reporterMode":"identified"}}'

Alle Übermittlungsfelder →