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 APIContent-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 updateKeyType- 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 bedroomsBathrooms- number, required - Number of bathroomsUrl- string, required - Property listing URLMLSNumber- string, required - MLS numberYearBuilt- number, required - Year the property was builtDaysOnMarket- number, required - Number of days on marketLotArea- number, required - Lot area sizeBuildingArea- number, required - Building area sizeAreaUnit- string, required - Must be one of: [Square Feet, Square Meters]Images- array - Array of image URLsTours- string - Must be one of: [OpenHouse, 3D]ParkingSpots- number, required - Number of parking spotsDescription- string - Property descriptionExtensionColumn- array - Additional property information in format[{'Key': 'xx', 'value': 'xx'}]Location- string - Property location descriptionAddress- string - Street addressCity- string - City nameState- string - State nameZIP- string - ZIP codeLatitude- number - Property latitudeLongitude- number - Property longitudeSalePrice- number - Sale priceUnitAreaPrice- number - Price per unit areaHOAMonth- number - Monthly HOA feeZestimatePrice- number - Zestimate priceRentPrice- number - Monthly rent priceSpaceType- string - Must be one of: [Entire place, Room]DepositFee- number - Required deposit amount
Esempi di Richiesta
- JavaScript (Fetch API)
- Python (Requests)
- cURL
- HTTP Raw
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);
import requests
import json
url = 'https://app.neoagent.co/chat/Chatbot/RealEstateUpdate'
headers = {
"chatrobot-sessionkey": "<Your-Session-Key>"
}
data = {
"SerialNumber": "3254a9d0424c4806b9ea3d0763xxxxxx",
"Key": "PROP123456",
"KeyType": "NewOaks",
"SaleType": "for_sale",
"Status": "Active",
"PropertyType": "Single Family Residential",
"Bedrooms": 3,
"Bathrooms": 2.5,
"MLSNumber": "MLS123456",
"SalePrice": 100000
}
response = requests.post(url, headers=headers, json=data)
data = response.json()
print(data)
curl 'https://app.neoagent.co/chat/Chatbot/RealEstateUpdate' \
-X POST \
-H 'chatrobot-sessionkey: <Your-Session-Key>' \
-d '{"SerialNumber":"3254a9d0424c4806b9ea3d0763xxxxxx","Key":"PROP123456","KeyType":"NewOaks","SaleType":"for_sale","Status":"Active","PropertyType":"Single Family Residential","Bedrooms":3,"Bathrooms":2.5,"MLSNumber":"MLS123456","SalePrice":100000}'
POST /chat/Chatbot/RealEstateUpdate HTTP/1.1
Host: app.neoagent.co
chatrobot-sessionkey: <Your-Session-Key>
{
"SerialNumber": "3254a9d0424c4806b9ea3d0763xxxxxx",
"Key": "PROP123456",
"KeyType": "NewOaks",
"SaleType": "for_sale",
"Status": "Active",
"PropertyType": "Single Family Residential",
"Bedrooms": 3,
"Bathrooms": 2.5,
"MLSNumber": "MLS123456",
"SalePrice": 100000
}
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:
- Controllare il codice di stato HTTP per errori a livello di rete
- Esaminare i campi
CodeeMessagenella risposta per errori a livello business - Il campo
Messageconterrà informazioni dettagliate sull'errore