Docs / Stackposts

Google Drive API

๐Ÿ“ Google Drive API Integration for Stackposts This guide explains how to connect your Google Drive to Stackposts, allowing users to import or upload files directly from their Goog...

Estimated reading: 2 minutes

๐Ÿ“ Google Drive API Integration for Stackposts

This guide explains how to connect your Google Drive to Stackposts, allowing users to import or upload files directly from their Google Drive account.


๐Ÿงฉ 1. Create a Google Cloud Project

  1. Go to: https://console.developers.google.com/projectcreate

  2. Enter a Project name, for example: Stackposts Drive Integration.

  3. Click Create.


โš™๏ธ 2. Enable Google Drive API

  1. After creating the project, open this link:
    https://console.developers.google.com/apis/library/drive.googleapis.com

  2. Click Enable to activate the Google Drive API for your project.


๐Ÿงพ 3. Configure the OAuth Consent Screen

  1. Go to APIs & Services โ†’ OAuth consent screen.

  2. Select External, then click Create.

  3. Fill in the following details:

    • App name: Stackposts Google Drive Integration

    • User support email: your Google account email

    • Developer contact information: your email address

  4. Click Save and Continue to move to the next step.


๐Ÿ” 4. Add Required Scopes

  1. In the Scopes step, click Add or Remove Scopes.

  2. Add this scope:

    https://www.googleapis.com/auth/drive
  3. Click Save and Continue.


๐Ÿ‘ฅ 5. Add Test Users

  1. Go to the Test users section.

  2. Click Add users.

  3. Enter your Google account email.

  4. Click Save and Continue.


๐Ÿ” 6. Create OAuth Credentials

  1. Go to APIs & Services โ†’ Credentials.

  2. Click + Create Credentials โ†’ OAuth client ID.

  3. Choose:

    • Application type: Web application

    • Name: Stackposts Drive Integration

  4. Under Authorized redirect URIs, add:

    https://yourdomain.com/callback/google_drive

    (Replace yourdomain.com with your actual domain.)

  5. Click Create.

You will get two values:

  • Client ID

  • Client Secret


๐Ÿงฐ 7. Get Your API Key

  1. Go to APIs & Services โ†’ Credentials again.

  2. Click + Create Credentials โ†’ API key.

  3. Copy the generated API Key.


โš™๏ธ 8. Enter the Following Fields in Stackposts

In your Stackposts Admin Panel, go to:

Settings โ†’ Files โ†’ Google Drive

Then fill in the following fields:

  • API Key โ†’ (Paste the key you copied from Google Cloud)

  • Client ID โ†’ (From your OAuth client credentials)

  • Client Secret โ†’ (From your OAuth client credentials)

After entering, click Save Changes and ensure Status = Enable.


๐Ÿงพ 9. OAuth Verification (Optional but Recommended)

When submitting your app for Google review, fill in the following:

Scopes Justification:

My app will use this permission: https://www.googleapis.com/auth/drive To show a user's files on Google Drive and allow downloading them from their account. This feature helps users attach files from Google Drive directly within Stackposts.

Additional Information:

This is a video demo showing how the permission above is used in our system: [Insert your YouTube video link here]

โœ… 10. Completed

Once everything is configured, users can now connect their Google Drive accounts and access their files directly from Stackposts.