Aller au contenu

API Qubihome

Gérez vos annonces et recevez vos contacts depuis votre propre logiciel. La référence ci-dessous est en anglais.

L'API est disponible avec les offres Agency et Developer pour les agents et agences vérifiés. Créez vos clés dans Intégrations.

Démarrage rapide

curl https://qubihome.vercel.app/api/v1/listings \
  -H "Authorization: Bearer qh_live_..."

curl -X POST https://qubihome.vercel.app/api/v1/listings \
  -H "Authorization: Bearer qh_live_..." \
  -H "Content-Type: application/json" \
  -d '{"category":"apartment","transaction":"sale","title":"Bright flat near the park",
       "description":"Two rooms, renovated kitchen, balcony facing south.",
       "price":245000,"currency":"EUR","country":"PL","city":"Krakow",
       "latitude":50.0614,"longitude":19.9366,"area_m2":52,"rooms":2}'

Points de terminaison

MéthodeCheminFonctionAutorisation
GET/api/v1/listingsList your listingslistings:read
POST/api/v1/listingsCreate a draft listinglistings:write
GET/api/v1/listings/{id}Get one of your listingslistings:read
PATCH/api/v1/listings/{id}Update a draft or rejected listinglistings:write
POST/api/v1/listings/{id}/submitSend a draft to moderationlistings:write
POST/api/v1/listings/{id}/statusChange the status of a live listinglistings:write
GET/api/v1/listings/{id}/mediaList photos and floor planslistings:read
POST/api/v1/listings/{id}/mediaImport a photo or floor plan from a public https URLlistings:write
DELETE/api/v1/listings/{id}/media/{mediaId}Remove a photo or floor planlistings:write
GET/api/v1/leadsList contact requests sent to youleads:read

Règles

  • Authentifiez chaque requête avec Authorization: Bearer YOUR_KEY.
  • Les annonces créées sont des brouillons. L'envoi les place en modération ; elles ne sont en ligne qu'après approbation, comme dans l'application web.
  • 120 requêtes par minute et par clé. Un dépassement renvoie HTTP 429. La limite d'annonces de votre offre s'applique aux envois.
  • Les erreurs sont en JSON avec un objet "error" contenant code, message et details, et le statut HTTP correspondant.
  • Les photos sont importées depuis des adresses https publiques. Les redirections et adresses privées sont refusées.

Webhooks

Chaque envoi est un POST avec un corps JSON et ces en-têtes. Vérifiez la signature avant de faire confiance aux données.

X-Qubihome-Event: lead.created | listing.published | listing.status_changed
X-Qubihome-Delivery: <delivery id>
X-Qubihome-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<raw body>">
// Node.js
import { createHmac, timingSafeEqual } from "node:crypto";

function verify(rawBody, header, secret) {
  const parts = Object.fromEntries(header.split(",").map((p) => p.split("=")));
  if (Math.abs(Date.now() / 1000 - Number(parts.t)) > 300) return false;
  const expected = createHmac("sha256", secret).update(parts.t + "." + rawBody).digest("hex");
  return timingSafeEqual(Buffer.from(parts.v1, "hex"), Buffer.from(expected, "hex"));
}

Répondez avec un statut 2xx en moins de 8 secondes. Les envois échoués sont réessayés jusqu'à six fois avec des délais croissants.