> ## Documentation Index
> Fetch the complete documentation index at: https://support.i.moneyforward.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Drive

> Steps to integrate Google Drive with Admina using a service account.

## Supported Features

<Badge color="blue">File Aggregation</Badge> <Badge color="blue">File Permission Management</Badge>

## Integrating with Google Drive

Follow these steps to integrate Google Drive with Admina. The integration retrieves information about publicly shared files. ([About the External Shared Content Management feature](/en/it-management/file-management/aakpi1r7gq-file-management#1023961436))

<Info>
  * Account information is not retrieved.
  * Only the names and links of files shared (made public) in shared drives (including My Drive) are retrieved. Data is not synced to Admina.
  * Viewing files requires the Admin role in Admina. For details on Admina roles, see the page below.
</Info>

[About Admina admin users: what are the differences between roles?](/en/it-management/settings/yne7fl2lcy-role-new)

## Prerequisites

### Enable APIs (Google Cloud Platform)

1. Create an account for the integration from Google Cloud Platform. Go to [Google Cloud Console](https://console.cloud.google.com/) and select or create a project.

2. Under **APIs & Services** > **Enabled APIs & Services**, confirm that the following two APIs are enabled. If they are not enabled, add them from the [API Library](https://console.cloud.google.com/apis/library).
   * **Google Drive API**
   * **Admin SDK API**

<img src="https://mintcdn.com/moneyforwardi/H1U6E2frRcGDFDpD/images/integrations/k7vonejs7q/1681952321507.png?fit=max&auto=format&n=H1U6E2frRcGDFDpD&q=85&s=7a1188f2231eab92f37f2c489b3a918f" alt="Enable APIs" width="2520" height="1188" data-path="images/integrations/k7vonejs7q/1681952321507.png" />

### Create a Service Account

3. Go to **APIs & Services > Credentials > Create Credentials > Service account**.

<img src="https://mintcdn.com/moneyforwardi/H1U6E2frRcGDFDpD/images/integrations/k7vonejs7q/1681952435408.png?fit=max&auto=format&n=H1U6E2frRcGDFDpD&q=85&s=3204f574341c8969818832bc9966fc4e" alt="Create service account" width="2648" height="830" data-path="images/integrations/k7vonejs7q/1681952435408.png" />

4. Enter any name for the service account name and click **Done** (steps 2 and 3 are not required).

<img src="https://mintcdn.com/moneyforwardi/H1U6E2frRcGDFDpD/images/integrations/k7vonejs7q/1681952609494.png?fit=max&auto=format&n=H1U6E2frRcGDFDpD&q=85&s=a39947a153311d4d4d5b6a5ef56e2b8a" alt="Enter service account name" width="2102" height="1206" data-path="images/integrations/k7vonejs7q/1681952609494.png" />

### Issue an API Key

5. The service account you created will appear under **APIs & Services > Credentials** — click it.

6. Go to the **Keys** tab and click **Add Key > Create new key**.

<img src="https://mintcdn.com/moneyforwardi/H1U6E2frRcGDFDpD/images/integrations/k7vonejs7q/1681953025811.png?fit=max&auto=format&n=H1U6E2frRcGDFDpD&q=85&s=177e90df194ce1cd2fd0770304f5c0a4" alt="Create key" width="2682" height="1092" data-path="images/integrations/k7vonejs7q/1681953025811.png" />

7. Select **JSON** and click the **Create** button. A message "Private key saved to your computer" will appear, and a JSON file will be downloaded automatically. Keep this file safe, as it contains parameters such as the Client ID required for the Admina integration.

<img src="https://mintcdn.com/moneyforwardi/H1U6E2frRcGDFDpD/images/integrations/k7vonejs7q/1681953121670.png?fit=max&auto=format&n=H1U6E2frRcGDFDpD&q=85&s=9e97d2f526f4c6e98f60b87e90b0fcda" alt="Save in JSON format" width="1086" height="678" data-path="images/integrations/k7vonejs7q/1681953121670.png" />

### Configure Domain-Wide Delegation (Google Admin Console)

8. Go to the Google Workspace [Admin console](https://admin.google.com/) and click **Security > API controls > Manage Domain Wide Delegation**.

<img src="https://mintcdn.com/moneyforwardi/H1U6E2frRcGDFDpD/images/integrations/k7vonejs7q/1676945315793.png?fit=max&auto=format&n=H1U6E2frRcGDFDpD&q=85&s=43495b4ece5251bf6b960bb49a659254" alt="Domain-wide delegation" width="3002" height="1432" data-path="images/integrations/k7vonejs7q/1676945315793.png" />

9. Click the **Add new** button.

10. Open the JSON file you saved. Enter the value of `client_id` from the JSON file in the **Client ID** field.

<img src="https://mintcdn.com/moneyforwardi/H1U6E2frRcGDFDpD/images/integrations/k7vonejs7q/1681953322629.png?fit=max&auto=format&n=H1U6E2frRcGDFDpD&q=85&s=184e0ace6299ba27531eb70578918240" alt="Enter Client ID" width="3062" height="1246" data-path="images/integrations/k7vonejs7q/1681953322629.png" />

11. Enter the following four values in **OAuth scopes**, then click **Authorize**.
    1. `https://www.googleapis.com/auth/drive`
    2. `https://www.googleapis.com/auth/admin.directory.user.readonly`
    3. `https://www.googleapis.com/auth/admin.directory.group.readonly`
    4. `https://www.googleapis.com/auth/admin.directory.domain.readonly`

<img src="https://mintcdn.com/moneyforwardi/H1U6E2frRcGDFDpD/images/integrations/k7vonejs7q/1676947283032.png?fit=max&auto=format&n=H1U6E2frRcGDFDpD&q=85&s=86ac2a9aea919857496c7e479b72aa92" alt="OAuth scope settings" width="920" height="806" data-path="images/integrations/k7vonejs7q/1676947283032.png" />

<Info>
  You can also set scope (a) to `https://www.googleapis.com/auth/drive.readonly`.
  This allows all data to be retrieved as Read Only, but only files in **My Drive** will be retrieved (files in shared drives cannot be retrieved).
</Info>

## Integration Setup

1. In the Admina integrations screen, search for **Google Drive**.

2. Open the JSON file you saved. Enter the values listed below and click **Connect**.

<img src="https://mintcdn.com/moneyforwardi/H1U6E2frRcGDFDpD/images/integrations/k7vonejs7q/1681953436548.png?fit=max&auto=format&n=H1U6E2frRcGDFDpD&q=85&s=fccd702b09cfbae1f3552450c38aece9" alt="Integration settings screen" width="3060" height="1230" data-path="images/integrations/k7vonejs7q/1681953436548.png" />

3. **Service account email address**: Enter the value of `client_email` from the JSON file.

4. **Private key**: Enter the private key `private_key` from the JSON file.
   Enter everything from **-----BEGIN PRIVATE KEY-----** to **-----END PRIVATE KEY-----**. (The leading `"` and trailing `\n",` are not required.)

5. **Email address**: Enter the email address of the **Google Workspace** super admin.

<img src="https://mintcdn.com/moneyforwardi/H1U6E2frRcGDFDpD/images/integrations/k7vonejs7q/1683722820125.png?fit=max&auto=format&n=H1U6E2frRcGDFDpD&q=85&s=d812d4ecfd62a8f8c7f9ffcfa5167e72" alt="Enter credentials" width="482" height="745" data-path="images/integrations/k7vonejs7q/1683722820125.png" />

<Info>
  Trusted domains: You can exclude specified domains from external sharing detection. Use this to specify domains such as group company domains that you do not want to be detected as external. If there are multiple domains, separate them with commas (,) as shown below. (Your own company domain does not need to be entered.)
  `moneyfoward.co.jp, i.moneyfoward.com`
</Info>

6. Once the integration with Google Drive is successful, a "Files" tab will appear under the service, displaying information about shared files. (Synchronization may take some time depending on the number of files.)

<img src="https://mintcdn.com/moneyforwardi/H1U6E2frRcGDFDpD/images/integrations/k7vonejs7q/1673406422261.png?fit=max&auto=format&n=H1U6E2frRcGDFDpD&q=85&s=1de8d86c78a48b90400b5154a0728471" alt="Integration success screen" width="3018" height="1494" data-path="images/integrations/k7vonejs7q/1673406422261.png" />

If the integration does not complete successfully, go to the **Status** tab on the integrations screen, click **Edit**, and try connecting again.

If the issue persists, please contact us via chat.

For an overview of the Google Drive integration, see the [integration page](https://admina.moneyforward.com/en/integrations/google-drive).

## Stopping Sharing

You can check the sharing status of retrieved files and stop sharing.

Click the **Share** button from the drawer on the right side.

<img src="https://mintcdn.com/moneyforwardi/H1U6E2frRcGDFDpD/images/integrations/k7vonejs7q/1681981353191.png?fit=max&auto=format&n=H1U6E2frRcGDFDpD&q=85&s=287e23b60306dc0eaf4fd99545830a43" alt="Share button" width="2794" height="1622" data-path="images/integrations/k7vonejs7q/1681981353191.png" />

Select the user, group, or link whose sharing you want to stop, then click **Apply**.

<img src="https://mintcdn.com/moneyforwardi/H1U6E2frRcGDFDpD/images/integrations/k7vonejs7q/1681981480764.png?fit=max&auto=format&n=H1U6E2frRcGDFDpD&q=85&s=d2f26535cbab94e990e97768b39cf8ac" alt="Stop sharing" width="1978" height="1262" data-path="images/integrations/k7vonejs7q/1681981480764.png" />

## FAQ

### Q. Can you explain the sharing status for each file?

A. Please refer to the following.

| Status                        | Description                                                                                                           |
| ----------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| **External sharing**          | Files shared with addresses outside the domains registered in Google Workspace are classified as "externally shared." |
| **Public (anyone with link)** | Files shared with "Anyone with the link" are displayed as "Public."                                                   |
