Connecting to GoogleForms
Authentication
Google Forms requires OAuth 2.0 authentication to ensure secure access to form data and management features. This authentication method allows you to securely connect to your own forms and responses, or enable other users to connect to their Google Forms data with proper authorization.
OAuth 2.0 Setup and Configuration
Step 1: Create Google Cloud Project
To set up OAuth authentication:
- Visit the Google Cloud Console
- Create a new project or select an existing project
- Navigate to "APIs & Services" > "Library"
- Search for and enable the "Google Forms API"
- Go to "APIs & Services" > "Credentials"
- Click "Create Credentials" and select "OAuth Client ID"
- Configure the OAuth consent screen if prompted
- Select "Desktop application" or "Web application" as appropriate
- Set the authorized redirect URI (CallbackURL)
- Copy the Client ID and Client Secret for use in your connection
Required Connection Properties
- AuthScheme: Set this to OAuth (required)
- OAuthClientId: Client ID from Google Cloud Console (required)
- OAuthClientSecret: Client secret from Google Cloud Console (required)
- CallbackURL: Redirect URI specified in your OAuth application (required)
- InitiateOAuth: Set to GETANDREFRESH for automatic token management (recommended)
Required OAuth Scopes
The Google Forms API Profile requires the following OAuth scopes for full functionality:
- https://www.googleapis.com/auth/forms.body - Read and manage form structure, questions, and settings
- https://www.googleapis.com/auth/forms.responses.readonly - Read form responses and submission data
Available Tables
The Google Forms API Profile provides access to comprehensive form management and response data:
- Forms - Retrieve form metadata, structure, settings, and configuration including questions, quiz settings, and publication details.
- Responses - Access form submission data and user responses with comprehensive filtering and export capabilities.
- Watches - Manage and monitor webhook notifications for real-time form response updates and event tracking.
Connection Examples
Basic OAuth Connection String
Profile=C:\profiles\GoogleForms.apip;AuthScheme=OAuth;InitiateOAuth=GETANDREFRESH;OAuthClientId=your_client_id;OAuthClientSecret=your_client_secret;CallbackUrl=your_callback_url;
Advanced OAuth Connection with Custom Settings
Profile=C:\profiles\GoogleForms.apip;AuthScheme=OAuth;InitiateOAuth=GETANDREFRESH;OAuthClientId=your_client_id;OAuthClientSecret=your_client_secret;CallbackUrl=http://localhost:8080/auth/callback;OAuthSettingsLocation=C:\oauth\settings;
Usage Examples
Form Management
Get form details with quiz settings:
SELECT FormId, Title, QuizEnabled, CollectEmail, ResponderUri FROM Forms WHERE FormId = 'your_form_id'
Analyze response patterns:
SELECT ResponseId, Answers, TotalScore FROM Responses WHERE FormId = 'your_form_id';
Webhook Management
Monitor active watches:
SELECT WatchId, EventType, Target, State FROM Watches WHERE FormId = 'your_form_id'
API Quotas and Limits
Google Forms API has usage quotas and rate limits based on your Google Cloud project configuration. Monitor your API usage in the Google Cloud Console. Consider implementing efficient querying strategies and caching for frequently accessed data.
Data Privacy and Security
When working with Google Forms data, ensure compliance with privacy regulations and Google's terms of service. Form responses may contain sensitive personal information. Implement appropriate data handling, storage, and access controls in your applications.
Connection Properties
The connection string properties are the various options that can be used to establish a connection. This section provides a complete list of the options you can configure in the connection string for this provider.
| Property | Description |
| AuthScheme | The scheme used for authentication. Accepted entries are None or OAuth. Allowed values are: BASIC, NONE, NTLM, OAUTH, APIKEY, OAUTH_CLIENT |
| CallbackURL | Identifies the URL users return to after authenticating to API via OAuth (Custom OAuth applications only). |
| InitiateOAuth | Specifies the process for obtaining or refreshing the OAuth access token, which maintains user access while an authenticated, authorized user is working. Allowed values are: OFF, GETANDREFRESH, REFRESH |
| OAuthClientId | Specifies the client ID (also known as the consumer key) assigned to your custom OAuth application. This ID is required to identify the application to the OAuth authorization server during authentication. |
| OAuthClientSecret | Specifies the client secret assigned to your custom OAuth application. This confidential value is used to authenticate the application to the OAuth authorization server. (Custom OAuth applications only.). |
| Scope | Scope(s) to use when authenticating, that control access to specific information. |