Overview
ContGoogle provides a RESTful API gateway that lets you interact with Google Sheets as a database and Google Drive as file storage — all through simple HTTP requests using your API key.
Base URL:
https://your-server.com
API Key: Your API key is embedded in the URL path. You can find it in your app's detail page on the dashboard.
Authentication
All API endpoints are authenticated using your API key which is part of the URL path. No additional headers are needed for Sheets and Drive operations.
Retrieve all rows from a specific tab in a Google Spreadsheet. Returns data as an array of objects where column headers are used as keys.
| Parameter | Location | Description |
|---|---|---|
| apiKey | Path | Your app's API key |
| sheetId | Path | Google Spreadsheet ID |
| tabName | Path | Name of the tab/sheet |
const response = await fetch( 'https://your-server.com/api/sh/YOUR_KEY/SHEET_ID/Sheet1' ); const data = await response.json(); console.log(data.rows);
{
"success": true,
"rows": [
{ "Name": "Alice", "Email": "alice@example.com", "Age": "28" },
{ "Name": "Bob", "Email": "bob@example.com", "Age": "34" }
],
"count": 2
}
Append a new row to the specified tab. Send column data as a JSON object in the request body.
| Parameter | Location | Description |
|---|---|---|
| apiKey | Path | Your app's API key |
| sheetId | Path | Google Spreadsheet ID |
| tabName | Path | Name of the tab/sheet |
| body | Body (JSON) | Object with column headers as keys |
const response = await fetch(
'https://your-server.com/api/sh/YOUR_KEY/SHEET_ID/Sheet1',
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
Name: 'Charlie',
Email: 'charlie@example.com',
Age: '25'
})
}
);
const data = await response.json();
{
"success": true,
"message": "Row added successfully"
}
Update an existing row. Provide a row number and the fields to update.
| Parameter | Location | Description |
|---|---|---|
| apiKey | Path | Your app's API key |
| sheetId | Path | Google Spreadsheet ID |
| tabName | Path | Name of the tab/sheet |
| row | Body (JSON) | Row number to update (1-indexed, excluding header) |
| data | Body (JSON) | Object with fields to update |
const response = await fetch(
'https://your-server.com/api/sh/YOUR_KEY/SHEET_ID/Sheet1',
{
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
row: 2,
data: { Email: 'newemail@example.com' }
})
}
);
const result = await response.json();
{
"success": true,
"message": "Row 2 updated successfully"
}
Delete a specific row from the tab by row number.
| Parameter | Location | Description |
|---|---|---|
| apiKey | Path | Your app's API key |
| sheetId | Path | Google Spreadsheet ID |
| tabName | Path | Name of the tab/sheet |
| row | Path | Row number to delete |
const response = await fetch(
'https://your-server.com/api/sh/YOUR_KEY/SHEET_ID/Sheet1/3',
{ method: 'DELETE' }
);
const result = await response.json();
{
"success": true,
"message": "Row 3 deleted successfully"
}
List all files in a linked Google Drive folder. Returns file names, IDs, MIME types, and sizes.
| Parameter | Location | Description |
|---|---|---|
| apiKey | Path | Your app's API key |
| folderId | Path | Google Drive folder ID |
const response = await fetch( 'https://your-server.com/api/dr/YOUR_KEY/FOLDER_ID/files' ); const data = await response.json(); console.log(data.files);
{
"success": true,
"files": [
{
"id": "1abc...xyz",
"name": "report.pdf",
"mimeType": "application/pdf",
"size": "245760"
}
]
}
Upload a file to the specified Google Drive folder. Send the file as multipart form data.
| Parameter | Location | Description |
|---|---|---|
| apiKey | Path | Your app's API key |
| folderId | Path | Google Drive folder ID |
| file | Body (form-data) | The file to upload |
const formData = new FormData();
formData.append('file', fileInput.files[0]);
const response = await fetch(
'https://your-server.com/api/dr/YOUR_KEY/FOLDER_ID/upload',
{
method: 'POST',
body: formData
}
);
const data = await response.json();
{
"success": true,
"file": {
"id": "1new...file",
"name": "report.pdf",
"mimeType": "application/pdf"
}
}
Delete a specific file from the linked Drive folder.
| Parameter | Location | Description |
|---|---|---|
| apiKey | Path | Your app's API key |
| folderId | Path | Google Drive folder ID |
| fileId | Path | ID of the file to delete |
const response = await fetch(
'https://your-server.com/api/dr/YOUR_KEY/FOLDER_ID/files/FILE_ID',
{ method: 'DELETE' }
);
const result = await response.json();
{
"success": true,
"message": "File deleted successfully"
}