# Google Sheets Integration via LowCodeAPI

## Overview

Google Sheets API provides programmatic access to Google Sheets spreadsheets. Read, write, and format cell data, create sheets, and manage spreadsheets programmatically.

## Base Endpoint

```
https://api.lowcodeapi.com/googlesheets/
```

## Authentication

LowCodeAPI handles authentication automatically using OAuth2.0 credentials.

**Auth Type**: OAuth2.0

## Common Endpoints

### Category: Spreadsheets

#### List Spreadsheets

**Method**: `GET` | **LowCodeAPI Path**: `/v4/spreadsheets`

**Full URL**:
```
https://api.lowcodeapi.com/googlesheets/v4/spreadsheets?api_token={api_token}
```

**Query Parameters**:

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `api_token` | string | Yes | Your LowCodeAPI authentication token |

**Example Request**:
```bash
curl -X GET "https://api.lowcodeapi.com/googlesheets/v4/spreadsheets?api_token=YOUR_API_TOKEN"
```

---

#### Get Spreadsheet

**Method**: `GET` | **LowCodeAPI Path**: `/v4/spreadsheets/spreadsheetId`

**Full URL**:
```
https://api.lowcodeapi.com/googlesheets/v4/spreadsheets/spreadsheetId?spreadsheetId={spreadsheetId}&api_token={api_token}
```

**Description**: Get spreadsheet details

**Query Parameters**:

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `spreadsheetId` | string | Yes | The spreadsheet ID |
| `api_token` | string | Yes | Your LowCodeAPI authentication token |

**Example Request**:
```bash
curl -X GET "https://api.lowcodeapi.com/googlesheets/v4/spreadsheets/spreadsheetId?spreadsheetId=1BxiMVs0XRA5nFMdKvBdBZjGMUUqpt35fs&api_token=YOUR_API_TOKEN"
```

---

#### Update Cell Values

**Method**: `PUT` | **LowCodeAPI Path**: `/v4/spreadsheets/spreadsheetId/values/range`

**Full URL**:
```
https://api.lowcodeapi.com/googlesheets/v4/spreadsheets/spreadsheetId/values/range?spreadsheetId={spreadsheetId}&range={range}&api_token={api_token}
```

**Description**: Update values in a spreadsheet range

**Query Parameters**:

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `spreadsheetId` | string | Yes | The spreadsheet ID |
| `range` | string | Yes | The A1 notation of the range |
| `valueInputOption` | string | No | How to interpret input (RAW, USER_ENTERED) |
| `api_token` | string | Yes | Your LowCodeAPI authentication token |

**Body Parameters**:

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `values` | array | Yes | The data to write |
| `majorDimension` | string | No | Major dimension (ROWS, COLUMNS) |

**Example Request**:
```bash
curl -X PUT "https://api.lowcodeapi.com/googlesheets/v4/spreadsheets/spreadsheetId/values/range?spreadsheetId=SPREADSHEET_ID&range=Sheet1!A1:D5&valueInputOption=RAW&api_token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "values": [
      ["Name", "Email", "Phone"],
      ["John", "[email protected]", "555-1234"],
      ["Jane", "[email protected]", "555-5678"]
    ],
    "majorDimension": "ROWS"
  }'
```

---

## Usage Examples

### Example 1: Read and Write Data

```bash
# Step 1: Get spreadsheet data
# Replace SPREADSHEET_ID with actual ID
curl -X GET "https://api.lowcodeapi.com/googlesheets/v4/spreadsheets/spreadsheetId/values/Sheet1!A1:Z100?spreadsheetId=SPREADSHEET_ID&api_token=YOUR_API_TOKEN"

# Step 2: Update a range of cells
# Use the same SPREADSHEET_ID
curl -X PUT "https://api.lowcodeapi.com/googlesheets/v4/spreadsheets/spreadsheetId/values/range?spreadsheetId=SPREADSHEET_ID&range=Sheet1!A1&valueInputOption=USER_ENTERED&api_token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "values": [["Hello", "World"]],
    "majorDimension": "ROWS"
  }'
```

## Complete Endpoint Reference

- **Official Documentation**: [https://developers.google.com/sheets/api](https://developers.google.com/sheets/api)