Passa al contenuto principale

Aggiorna Real Estate

L'API per il real estate di app.neoagent.co fornisce la funzionalità per aggiornare i real estate inviando una richiesta POST all'endpoint /chat/Chatbot/RealEstateUpdate.

warning

Attenzione: questa API è compatibile solo con i chatbot tradizionali e non è ancora compatibile con i chatbot basati su template.

Endpoint

URL della Richiesta: https://app.neoagent.co/chat/Chatbot/RealEstateUpdate
Metodo: POST

Headers richiesti

La richiesta API deve includere i seguenti header:

  • Authorization: <Your-Secret-Key> - string, obbligatorio - La chiave segreta per autenticare la richiesta API
  • Content-Type: application/json - string, obbligatorio - Il tipo di contenuto del payload della richiesta (deve essere application/json)

Corpo della Richiesta

Il corpo della richiesta deve contenere i seguenti parametri:

{
// stringa, obbligatoria - ID del chatbot (disponibile nelle impostazioni del chatbot -> generale -> ID chatbot)
"SerialNumber": "3254a9d0424c4806b9ea3d0763xxxxxx",
// stringa, obbligatoria - Valore della chiave primaria utilizzata per l'aggiornamento
"Key": "PROP123456",
// stringa, obbligatoria - Deve essere uno tra: [NewOaks, MLSNumber, URL]
"KeyType": "NewOaks",
// stringa, obbligatoria - Deve essere uno tra: [for_sale, for_rent]
"SaleType": "for_sale",
// stringa, obbligatoria - Deve essere uno tra: [Active, PreOnMarket, Sold]
"Status": "Active",
// stringa, obbligatoria - Simbolo della valuta (ad esempio, $)
"CurrencySymbol": "$",
// stringa, obbligatoria - Tipo di proprietà (ad esempio, Single Residenziale unifamiliare)
"PropertyType": "Residenziale unifamiliare",
// numero, obbligatorio - Numero di camere da letto
"Bedrooms": 3,
// numero, obbligatorio - Numero di bagni
"Bathrooms": 2,5,
// stringa, obbligatorio - URL dell'annuncio
"Url": "https://example.com/property/123",
// stringa, obbligatorio - Numero MLS
"MLSNumber": "MLS123456",
// numero, obbligatorio - Anno di costruzione dell'immobile
"YearBuilt": 1998,
// numero, obbligatorio - Numero di giorni di permanenza sul mercato
"DaysOnMarket": 2,
// numero, obbligatorio - Superficie del lotto
"LotArea": ​​800,
// numero, obbligatorio - Superficie dell'edificio
"BuildingArea": ​​2500,
// stringa, obbligatorio - Deve essere uno tra: [Square Feet, Square Meters]
"AreaUnit": "Square Feet",
// array - Array di URL delle immagini
"Images": [
"https://example.com/img1.jpg",
"https://example.com/img2.jpg"
],
// string - Deve essere uno dei seguenti: [OpenHouse, 3D]
"Tours": "OpenHouse",
// number, obbligatorio - Numero di posti auto
"ParkingSpots": 8,
// string - Descrizione della proprietà
"Description": "Splendida casa di famiglia con comfort moderni",
// array - Informazioni aggiuntive sulla proprietà nel formato [{'Key': 'xx', 'value': 'xx'}]
"ExtensionColumn": [
{
// string, obbligatorio - Il valore della chiave primaria utilizzata per l'aggiornamento
"Key": "Pool",
"value": "Yes"
},
{
// string, obbligatorio - Il valore della chiave primaria utilizzata per l'aggiornamento
"Key": "Garage",
"value": "2 auto"
}
],
// string - Proprietà Descrizione della posizione
"Location": "Zona residenziale",
// stringa - Indirizzo
"Address": "123 Main St",
// stringa - Nome della città
"City": "Los Angeles",
// stringa - Nome dello stato
"State": "CA",
// stringa - Codice postale
"ZIP": "90001",
// numero - Latitudine dell'immobile
"Latitude": 30,96,
// numero - Longitudine dell'immobile
"Longitude": -78,93,
// numero - Prezzo di vendita
"SalePrice": 100000,
// numero - Prezzo per unità di superficie
"UnitAreaPrice": 100,
// numero - Canone condominiale mensile
"HOAMonth": 500,
// numero - Prezzo stimato
"ZestimatePrice": 100000,
// numero - Canone mensile dell'affitto
"RentPrice": 2500,
// stringa - Deve essere uno tra: [Intero spazio, Stanza]
"SpaceType": "Intero spazio",
// numero - Importo del deposito richiesto
"DepositFee": 5000
}

Parametri

  • SerialNumber - string, required - The ID of the chatbot (found on the chatbot settings -> general -> chatbot ID)
  • Key - string, required - The value of the primary key used for the update
  • KeyType - string, required - Must be one of: [NewOaks, MLSNumber, URL]
  • SaleType - string, required - Must be one of: [for_sale, for_rent]
  • Status - string, required - Must be one of: [Active, PreOnMarket, Sold]
  • CurrencySymbol - string, required - Currency symbol (e.g., $)
  • PropertyType - string, required - Type of property (e.g., Single Family Residential)
  • Bedrooms - number, required - Number of bedrooms
  • Bathrooms - number, required - Number of bathrooms
  • Url - string, required - Property listing URL
  • MLSNumber - string, required - MLS number
  • YearBuilt - number, required - Year the property was built
  • DaysOnMarket - number, required - Number of days on market
  • LotArea - number, required - Lot area size
  • BuildingArea - number, required - Building area size
  • AreaUnit - string, required - Must be one of: [Square Feet, Square Meters]
  • Images - array - Array of image URLs
  • Tours - string - Must be one of: [OpenHouse, 3D]
  • ParkingSpots - number, required - Number of parking spots
  • Description - string - Property description
  • ExtensionColumn - array - Additional property information in format [{'Key': 'xx', 'value': 'xx'}]
  • Location - string - Property location description
  • Address - string - Street address
  • City - string - City name
  • State - string - State name
  • ZIP - string - ZIP code
  • Latitude - number - Property latitude
  • Longitude - number - Property longitude
  • SalePrice - number - Sale price
  • UnitAreaPrice - number - Price per unit area
  • HOAMonth - number - Monthly HOA fee
  • ZestimatePrice - number - Zestimate price
  • RentPrice - number - Monthly rent price
  • SpaceType - string - Must be one of: [Entire place, Room]
  • DepositFee - number - Required deposit amount

Esempi di Richiesta

const res = await fetch('https://app.neoagent.co/chat/Chatbot/RealEstateUpdate', {
method: 'POST',
headers: {
"chatrobot-sessionkey": "<Your-Session-Key>"
},
body: JSON.stringify({
"SerialNumber": "3254a9d0424c4806b9ea3d0763xxxxxx",
"Key": "PROP123456",
"KeyType": "NewOaks",
"SaleType": "for_sale",
"Status": "Active",
"PropertyType": "Single Family Residential",
"Bedrooms": 3,
"Bathrooms": 2.5,
"MLSNumber": "MLS123456",
"SalePrice": 100000
})
});

const data = await res.json();
console.log(data);

Risposta

La risposta API sarà un oggetto JSON con la seguente struttura:

{
// integer - Number of records updated (1 indicates success)
"Data": 1,
// string - API version
"Version": "1.0.0",
// boolean - Operation success status
"Success": true,
// integer - HTTP status code
"Code": 200,
// string - Error message if any
"Message": ""
}

Gestione degli Errori

Se la richiesta fallisce, dovresti:

  1. Controllare il codice di stato HTTP per errori a livello di rete
  2. Esaminare i campi Code e Message nella risposta per errori a livello business
  3. Il campo Message conterrà informazioni dettagliate sull'errore