Google Sheets API Configuration
Request
POST https://api.fivetran.com/v1/connections
{ "group_id": "group_id", "service": "google_sheets", "trust_certificates": true, "trust_fingerprints": true, "run_setup_tests": true, "paused": false, "pause_after_trial": false, "sync_frequency": 1440, "data_delay_sensitivity": "NORMAL", "data_delay_threshold": 0, "daily_sync_time": "14:00", "schedule_type": "auto", "connect_card_config": { "redirect_uri": "https://your.site/path", "hide_setup_guide": true }, "proxy_agent_id": "proxy_agent_id", "private_link_id": "private_link_id", "networking_method": "Directly", "hybrid_deployment_agent_id": "hybrid_deployment_agent_id", "destination_configuration": { "virtual_warehouse": "virtual_warehouse" }, "destination_schema_names": "SOURCE_NAMING", "config": { "auth_type": "ServiceAccount | OAuth", "sheet_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "named_range": "range", "schema": "schema_name", "table": "table_name" }, "auth": { "refresh_token": "my_refresh_token", "client_access": { "client_secret": "my_client_secret", "client_id": "my_client_id" } } }
Config parameters
| Name | Description |
|---|---|
auth_type | The OAuth value must be specified for this type of authorization. |
sheet_id | The URL of the sheet that can be copied from the browser address bar, or the ID of the sheet that can be found in the sheet's URL between /d/ and /edit. |
named_range | The name of the named data range on the sheet that contains the data to be synced. |
schema (required) | Destination schema name. Schema name is permanent and cannot be changed after connection creation |
table (required) | Destination table. Table is permanent and cannot be changed after connection creation |
Authorization
There are three ways to authorize this connector type:
- User Account: By specifying the values for the
client_accessandrefresh_tokenparameters in theauthsection and the values for thesheet_idandnamed_rangeparameters in the request.POST https://api.fivetran.com/v1/connections{ "service": "google_sheets", "group_id": "group_id", "config": { "sheet_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "named_range": "range" }, "auth": { "client_access": { "client_secret": "my_client_secret", "client_id": "my_client_id" }, "refresh_token": "my_refresh_token" } }Auth Parameters
Name Description refresh_tokenThe long-lived Refresh tokenalong with theclient_idandclient_secretparameters carry the information necessary to get a new access token for API resources.client_accessclient_access.client_secretClient Secretof your Google Sheets client application.client_access.client_idClient IDof your Google Sheets client application. - Service Account: By specifying the
auth_typeas"ServiceAccount"and the values for thesheet_idandnamed_rangeparameters in the request.POST https://api.fivetran.com/v1/connections{ "service": "google_sheets", "group_id": "group_id", "config": { "auth_type": "ServiceAccount", "sheet_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "named_range": "range" } }The connector uses service account authentication. You must share the sheet with Fivetran's service account namedg-[group_id]@fivetran-production.iam.gserviceaccount.com, where[group_id]is the connector's group ID. By using the Connect Card or the Fivetran dashboard.