π€ AI Receptionist β’ 24/7 Online
Hotel Management Dashboard
function doPost(e) {
const data = JSON.parse(e.postData.contents);
const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
// Add headers if empty
if(sheet.getLastRow() === 0) {
sheet.appendRow([
'Timestamp', 'Customer ID', 'Name', 'Mobile',
'Type', 'Field', 'Value', 'Room Type',
'Check-in', 'Check-out', 'Guests', 'Full Response'
]);
}
sheet.appendRow([
data.timestamp,
data.customerId,
data.customerName || '',
data.customerMobile || '',
data.type,
data.field || '',
data.value || '',
data.room || '',
data.checkin || '',
data.checkout || '',
data.guests || '',
JSON.stringify(data)
]);
return ContentService.createTextOutput(JSON.stringify({
success: true,
row: sheet.getLastRow()
})).setMimeType(ContentService.MimeType.JSON);
}
function doGet() {
return ContentService.createTextOutput("Google Sheets API is working!");
}