# Google Drive Integration via LowCodeAPI

## Overview

Google Drive API provides programmatic access to files and folders in Google Drive. Upload, download, search, and manage files, folders, and shared drives.

## Base Endpoint

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

## Authentication

LowCodeAPI handles authentication automatically using OAuth2.0 credentials.

**Auth Type**: OAuth2.0

## Common Endpoints

### Category: Files

#### List Files

**Method**: `GET` | **LowCodeAPI Path**: `/drive/v3/files`

**Full URL**:
```
https://api.lowcodeapi.com/googledrive/drive/v3/files?api_token={api_token}
```

**Query Parameters**:

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `q` | string | No | Search query string |
| `pageSize` | number | No | Number of results per page |
| `pageToken` | string | No | Page token for pagination |
| `api_token` | string | Yes | Your LowCodeAPI authentication token |

**Example Request**:
```bash
curl -X GET "https://api.lowcodeapi.com/googledrive/drive/v3/files?pageSize=10&api_token=YOUR_API_TOKEN"
```

---

#### Get File

**Method**: `GET` | **LowCodeAPI Path**: `/drive/v3/files/fileId`

**Full URL**:
```
https://api.lowcodeapi.com/googledrive/drive/v3/files/fileId?fileId={fileId}&api_token={api_token}
```

**Description**: Get file metadata or content

**Query Parameters**:

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `fileId` | string | Yes | The file ID |
| `alt` | string | No | Alternative representation (media) |
| `api_token` | string | Yes | Your LowCodeAPI authentication token |

**Example Request**:
```bash
curl -X GET "https://api.lowcodeapi.com/googledrive/drive/v3/files/fileId?fileId=FILE_ID&api_token=YOUR_API_TOKEN"
```

---

#### Create File

**Method**: `POST` | **LowCodeAPI Path**: `/upload/drive/v3/files`

**Full URL**:
```
https://api.lowcodeapi.com/googledrive/upload/drive/v3/files?api_token={api_token}
```

**Description**: Upload a new file

**Query Parameters**:

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `uploadType` | string | Yes | Upload type (multipart, resumable, media) |
| `api_token` | string | Yes | Your LowCodeAPI authentication token |

**Body Parameters**:

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `file` | file | Yes | File to upload |
| `name` | string | No | File name |
| `parents` | array | No | List of parent folder IDs |

**Example Request**:
```bash
curl -X POST "https://api.lowcodeapi.com/googledrive/upload/drive/v3/files?uploadType=multipart&api_token=YOUR_API_TOKEN" \
  -H "Content-Type: multipart/form-data" \
  -F "[email protected]" \
  -F 'metadata={"name": "My Document", "parents": ["FOLDER_ID"]}'
```

---

## Usage Examples

### Example 1: File Management

```bash
# Step 1: List files
# No ID required - lists all accessible files
curl -X GET "https://api.lowcodeapi.com/googledrive/drive/v3/files?pageSize=20&api_token=YOUR_API_TOKEN"

# Step 2: Search for specific files
# No ID required - uses search query
curl -X GET "https://api.lowcodeapi.com/googledrive/drive/v3/files?q=name+contains+%27report%27&api_token=YOUR_API_TOKEN"

# Step 3: Upload a file
# No ID required - creates new file and returns file ID
curl -X POST "https://api.lowcodeapi.com/googledrive/upload/drive/v3/files?uploadType=multipart&api_token=YOUR_API_TOKEN" \
  -F "[email protected]"

# Step 4: Get file metadata
# Replace FILE_ID with ID from previous step
curl -X GET "https://api.lowcodeapi.com/googledrive/drive/v3/files/fileId?fileId=FILE_ID&api_token=YOUR_API_TOKEN"
```

## Complete Endpoint Reference

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