# Google Developer Console

[**Google Developer Console**](https://console.cloud.google.com/) allows you to build, deploy, and scale applications, websites, and services on the same infrastructure as Google. Form.io offers several direct integration options under the Google Developer Console umbrella such as:

* [**Google Drive Storage**](https://help.form.io/developers/file-storage#google-drive)
* [**Google Oauth** ](https://developers.google.com/identity/protocols/oauth2)
* [**Google Sheets**](https://help.form.io/userguide/form-building/actions#webhook-action-1)

To leverage these features,  a Google project must first be established and then integrated with a Form.io Project. The following documentation will guide you through creating a Google project, establishing the correct APIs, and connecting it to your Form.io project.

### Google Project

1. Login to your [**Google Developer Console**](https://console.cloud.google.com/)
2. Click the +Create Project button (or select an existing one)
3. Give the Project a name and click **Create**

<figure><img src="https://3305536326-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPHoF2HwOA0s5HV_AIB%2Fuploads%2FlYVWXaj7PGxQecu7U6FP%2Fgoogleprojects.jpg?alt=media&#x26;token=a1cd04dc-4a3e-4dcf-bc93-4bab10959ed9" alt=""><figcaption></figcaption></figure>

### Configure Consent Screen

The **Google Developer Console Consent Screen** is part of the OAuth 2.0 authorization process used by applications requesting access to Google user data. When an application wants to access a user's data (e.g., their Google Drive files, calendar, or email), the consent screen is presented to the user. It allows them to review and grant permissions to the application before any data is accessed. Before the Google APIs can be integrated with Form.io, the consent screen must first be configured.&#x20;

1. Within your Google project navigation bar, click the **APIs and Services** product and then **OAuth consent screen**
2. Select a Google [**User Type**](https://support.google.com/cloud/answer/10311615#user-type\&zippy=)&#x20;

<figure><img src="https://3305536326-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPHoF2HwOA0s5HV_AIB%2Fuploads%2Fz7UlKHxs0QJ7LlfTzBfw%2Foauthconsentscreen.jpg?alt=media&#x26;token=ee0cbf81-c597-45b8-aa8f-579403759ca6" alt="" width="563"><figcaption></figcaption></figure>

3. Fill out the required **application fields**&#x20;

<figure><img src="https://3305536326-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPHoF2HwOA0s5HV_AIB%2Fuploads%2F95uHNKFc2MdFq8rzmBll%2Fapplicationinformation.jpg?alt=media&#x26;token=b6896c2b-4e4b-447a-a264-938664340340" alt=""><figcaption></figcaption></figure>

3. Click **Save and Continue** through the application setup. Add any **Scopes** or **Test** **Users** if needed for your application.

{% hint style="info" %}
By default, the application status will be set to Testing[^1]. In this Status, the application [**Refresh Token** ](#google-refresh-token)will continually expire. A manual refresh of the token is required or a setting can be configured that will refresh the token automatically after the expiration window.&#x20;

You can also Publish your application
{% endhint %}

3. By default, the application status will be set to Testing[^1]. In this Status, the application [**Refresh Token** ](#google-refresh-token)will continually expire.

### Enabling Google APIs

1. Within your Google project navigation bar, click the **APIs and Services** product and then **Library**

<figure><img src="https://3305536326-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPHoF2HwOA0s5HV_AIB%2Fuploads%2Fq9rAyRU6ObZfmpEwG77S%2Flibrary.jpg?alt=media&#x26;token=d5f06f6e-9517-4035-bd67-fc56802efba8" alt=""><figcaption></figcaption></figure>

2. Select the **Google Drive API** and **Google Sheets API**

<figure><img src="https://3305536326-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPHoF2HwOA0s5HV_AIB%2Fuploads%2Fufvr40imdxHxvw5nJUKl%2Fgoogleproducts.avif?alt=media&#x26;token=abcc8946-134f-4f2b-b56c-40964399457a" alt=""><figcaption></figcaption></figure>

3. Click **Enable** for both the Google Drive and Google Sheet APIs

<figure><img src="https://3305536326-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPHoF2HwOA0s5HV_AIB%2Fuploads%2FcbH6OzphxQqJNOd9NK1T%2Fenable.avif?alt=media&#x26;token=1a8a6dab-e875-4aee-873c-d8dae9cf5cdf" alt="" width="563"><figcaption></figcaption></figure>

### Application Credentials

1. Within your Google project navigation bar, click the **APIs and Services** product and then **Credentials**
2. Click the **+Create Credentials** button
3. Select **OAuth client ID**

<figure><img src="https://3305536326-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPHoF2HwOA0s5HV_AIB%2Fuploads%2F0y918rLZV2AaBi8TyKso%2Foauthclientid.jpg?alt=media&#x26;token=c38754cd-c850-4368-926a-77c2251a100e" alt=""><figcaption></figcaption></figure>

4. Select the **Web Application** option
5. Within the **Authorized redirect URIs section**, click the **+ADD URI** button and add the following:\
   `https://developers.google.com/oauthplayground`
6. Click the **Create** button

<figure><img src="https://3305536326-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPHoF2HwOA0s5HV_AIB%2Fuploads%2FNb1ZpMekFcuPGzqAb3BD%2Foauthsettings.jpg?alt=media&#x26;token=f5e68c97-220a-47eb-9dd7-41fb4a5ac697" alt="" width="542"><figcaption></figcaption></figure>

7. Take note of the **Client ID** and **Client Secret**. This information will be used in the next section.

<figure><img src="https://3305536326-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPHoF2HwOA0s5HV_AIB%2Fuploads%2FevG6bURnR14IdXramJdk%2Fclientidsecret.jpg?alt=media&#x26;token=37975cb1-24d0-4c82-9949-354e16bd4c77" alt="" width="360"><figcaption></figcaption></figure>

### Google Refresh Token

Generates a token that allows users access to the Google APIs.

1. **Navigate** to the following URL:\
   [**https://developers.google.com/oauthplayground**](https://developers.google.com/oauthplayground/)
2. Click the **Gear** icon found in the top right corner of the page.
3. Ensure the following settings are configured
   * OAuth flow: **Server-side**
   * Access type: **Offline**
4. Check the **Use your own OAuth credentials**&#x20;
   * Add the Google Project Client ID and Client Secret from the previous steps
   * Click the **Close** button

<figure><img src="https://3305536326-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPHoF2HwOA0s5HV_AIB%2Fuploads%2FXEwMVOAFCteuxuDrcUlT%2Foauthconfiguration.jpg?alt=media&#x26;token=d98c05df-7d32-42dd-a650-be362c4102ec" alt=""><figcaption></figcaption></figure>

4. Within the API list, expand the **Google Sheets API v4**&#x20;
   * Check the following API endpoints\
     <https://www.googleapis.com/auth/drive\\>
     <https://www.googleapis.com/auth/spreadsheetsXCCC&#x20>;
5. Click the **Authorize APIs** button

<figure><img src="https://3305536326-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPHoF2HwOA0s5HV_AIB%2Fuploads%2FzWyPRd7WIjW79eh0sVd4%2Fauthorize.jpg?alt=media&#x26;token=ff95c411-fc28-4487-ba53-c761b2100aa0" alt=""><figcaption></figcaption></figure>

6. Authenticate into the Google Drive platform
7. Click **Allow** to give the Google Project access to the Google Drive of the authenticated user
8. Click the **Exchange authorization code for tokens** button
9. Take note of the **Access Token** and the **Refresh Token**

{% hint style="info" %}

Enable the '**Auto-refresh token before expiration**' setting to automatically generate a new token when the current one expires. If this setting is not enabled, users will need to manually refresh the token or update the expiration time
{% endhint %}

<figure><img src="https://3305536326-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPHoF2HwOA0s5HV_AIB%2Fuploads%2FSRrlv2vPkirXjirKAXvI%2Fauthorize2.jpg?alt=media&#x26;token=e81af24e-0d5c-4cec-a05e-c6a01aebeb4f" alt=""><figcaption></figcaption></figure>

### Form.io Integration

Integrate the Google Project into the Form.io Project.

1. Within the Form.io Project, navigate to the **Google Drive** configuration \
   **Settings** > **Integration** > **Data Connections** > **Google Drive**
2. Input the **Client ID** and **Client Secret** from the [**Application Credentials**](#application-credentials) section
3. Input the **Refresh Token** from the [**Google Refresh Token** ](#google-refresh-token)section

<figure><img src="https://3305536326-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPHoF2HwOA0s5HV_AIB%2Fuploads%2Fn5uFCwkVPz0TJ7ow0KJv%2Fform.ioproject.jpg?alt=media&#x26;token=58eff40f-9c5b-4a07-96b7-0077df79bf70" alt=""><figcaption></figcaption></figure>

[^1]: If your app is still being tested and built, you can set your status to "testing". In this state, you can test your app with a limited number of users.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.form.io/developers/integrations/google-cloud-platform.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
