afflink.adrastea.com

Afflink API v1

Oeffentliche HTTPS-Schnittstelle fuer Produktsuche, Link-Aufloesung, Bestandsabfragen und zentrale Aktualisierung des produktiven Afflink-Systems auf primary.adrastea.com.

Basis-URL https://afflink.adrastea.com/api/v1
Auth Authorization: Bearer <token>
Oeffentlich ohne Token GET /api/v1, GET /api/v1/health, GET /api/v1/openapi

Endpunkte

Methode Pfad Zweck
GET/api/v1API-Metadaten und Verweise auf Doku.
GET/api/v1/healthHealthcheck ohne Auth.
POST/api/v1/add-productNeues Produkt in der zentralen Afflink-Datenbank anlegen.
POST/api/v1/search-productAmazon/Fallback-Suche ohne Persistenz.
POST/api/v1/get-product-linkBesten vorhandenen Affiliate-Link aus dem Produktbestand liefern.
GET/api/v1/list-productsProduktliste mit Filtern ausgeben.
GET/api/v1/inspect-productEin einzelnes Produkt per ID laden.
POST/api/v1/queue-refreshZentralen Refresh fuer eine ASIN anstossen; erstellt oder aktualisiert direkt auf primary.
POST/api/v1/update-productEin Produkt per ID aktualisieren.
POST/api/v1/update-productsMehrere faellige Produkte batchweise aktualisieren.

Beispiele

curl -sS https://afflink.adrastea.com/api/v1/health

curl -sS \
  -H 'Authorization: Bearer AFFLINK_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"asin":"B0BS6DXX8K"}' \
  https://afflink.adrastea.com/api/v1/get-product-link

curl -sS \
  -H 'Authorization: Bearer AFFLINK_TOKEN' \
  'https://afflink.adrastea.com/api/v1/list-products?limit=10&search=ringlicht'

Wichtige Hinweise

Queue-Refresh ist absichtlich host-neutral. Statt eine Projekt-Queue auf einem fremden Host zu claimen, fuehrt der Endpoint eine zentrale Produktanlage oder Produktaktualisierung direkt auf primary aus.

Antwortformat

  • Alle Antworten sind JSON mit Content-Type: application/json.
  • Auth-Fehler liefern 401 plus WWW-Authenticate: Bearer.
  • Fachliche Fehler liefern 4xx/5xx mit einem JSON-Feld error.
  • Die kanonische Feldbeschreibung liegt in /api/v1/openapi.

Betrieb auf sbx

  • /var/www/afflink/afflink_tool.php arbeitet auf sbx als lokaler Proxy gegen diese API.
  • Bestehende Projekt-Wrapper wie cli/afflink_tool.php muessen dafuer nicht umgebaut werden.
  • Die lokalen Projektbilder und lokalen Projekt-Caches bleiben auf sbx.