Google Sheets Sync
Append new visitor records to a Google Sheet automatically.
Step 1 – Get your API key
Go to Settings in your SiteSafe dashboard and copy your API key.
Step 2 – Open Apps Script in your Sheet
Open a new Google Sheet. Click Extensions → Apps Script.
Step 3 – Paste the script
Replace the default code with the script below. Insert your API key and the site ID you want to sync (optional).
const API_KEY = 'YOUR_API_KEY';
const BASE_URL = 'https://sitesafe.thesift.space/api/v1/visitors';
const SITE_ID = ''; // optional – leave empty for all sites
function syncVisitors() {
const sheet = SpreadsheetApp.getActiveSheet();
if (sheet.getLastRow() === 0) {
sheet.appendRow(['Full Name', 'Company', 'Host', 'Signed In', 'Signed Out', 'Safety OK']);
}
const url = SITE_ID ? BASE_URL + '?siteId=' + SITE_ID : BASE_URL;
const response = UrlFetchApp.fetch(url, {
headers: { Authorization: 'Bearer ' + API_KEY },
});
const visitors = JSON.parse(response.getContentText());
visitors.forEach(v => {
sheet.appendRow([
v.fullName,
v.company,
v.hostName || '',
v.signedInAt,
v.signedOutAt || '',
v.safetyAcknowledged ? 'Yes' : 'No',
]);
});
}
Step 4 – Run and schedule
Click Run → review permissions → the first rows will appear. Then go to Triggers (clock icon) and add a time‑driven trigger (e.g., every 10 minutes) to keep the sheet updated automatically.
Need help?
Check the API docs or email us at cloudandclipboard@gmail.com.