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.

GET /api/sh/{API_KEY}/{SHEET_ID}/{TAB_NAME}
GET /api/sh/{apiKey}/{sheetId}/{tabName}

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.

ParameterLocationDescription
apiKeyPathYour app's API key
sheetIdPathGoogle Spreadsheet ID
tabNamePathName 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);
Example Response
{
  "success": true,
  "rows": [
    { "Name": "Alice", "Email": "alice@example.com", "Age": "28" },
    { "Name": "Bob", "Email": "bob@example.com", "Age": "34" }
  ],
  "count": 2
}
POST /api/sh/{apiKey}/{sheetId}/{tabName}

Append a new row to the specified tab. Send column data as a JSON object in the request body.

ParameterLocationDescription
apiKeyPathYour app's API key
sheetIdPathGoogle Spreadsheet ID
tabNamePathName of the tab/sheet
bodyBody (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();
Example Response
{
  "success": true,
  "message": "Row added successfully"
}
PUT /api/sh/{apiKey}/{sheetId}/{tabName}

Update an existing row. Provide a row number and the fields to update.

ParameterLocationDescription
apiKeyPathYour app's API key
sheetIdPathGoogle Spreadsheet ID
tabNamePathName of the tab/sheet
rowBody (JSON)Row number to update (1-indexed, excluding header)
dataBody (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();
Example Response
{
  "success": true,
  "message": "Row 2 updated successfully"
}
DELETE /api/sh/{apiKey}/{sheetId}/{tabName}/{row}

Delete a specific row from the tab by row number.

ParameterLocationDescription
apiKeyPathYour app's API key
sheetIdPathGoogle Spreadsheet ID
tabNamePathName of the tab/sheet
rowPathRow 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();
Example Response
{
  "success": true,
  "message": "Row 3 deleted successfully"
}
GET /api/dr/{apiKey}/{folderId}/files

List all files in a linked Google Drive folder. Returns file names, IDs, MIME types, and sizes.

ParameterLocationDescription
apiKeyPathYour app's API key
folderIdPathGoogle 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);
Example Response
{
  "success": true,
  "files": [
    {
      "id": "1abc...xyz",
      "name": "report.pdf",
      "mimeType": "application/pdf",
      "size": "245760"
    }
  ]
}
POST /api/dr/{apiKey}/{folderId}/upload

Upload a file to the specified Google Drive folder. Send the file as multipart form data.

ParameterLocationDescription
apiKeyPathYour app's API key
folderIdPathGoogle Drive folder ID
fileBody (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();
Example Response
{
  "success": true,
  "file": {
    "id": "1new...file",
    "name": "report.pdf",
    "mimeType": "application/pdf"
  }
}
DELETE /api/dr/{apiKey}/{folderId}/files/{fileId}

Delete a specific file from the linked Drive folder.

ParameterLocationDescription
apiKeyPathYour app's API key
folderIdPathGoogle Drive folder ID
fileIdPathID 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();
Example Response
{
  "success": true,
  "message": "File deleted successfully"
}