Skip to main content
All CollectionsIntegrationsProductivity Integrations
Setting up the integration to import from a Cloud Storage Provider
Setting up the integration to import from a Cloud Storage Provider

How to set up integrations to import from a cloud provider

Christian Dreyer avatar
Written by Christian Dreyer
Updated over 2 months ago

The Operations Module hosts a multitude of integrations that allow you to unlock more from Planhat. With Planhat integrations, you can easily import data periodically from any of our supported cloud providers (GCP Cloud Storage, Google Drive, AWS S3 and OneDrive).

This article briefly explains what the native integrations for cloud providers support, and how to set them up.

Contents


1. How does it work?

When the integration is active, Planhat will run a scheduled job at the frequency you define, to access your bucket folder, retrieve all the files, and import (create or update) their data into Planhat.

This means you can drop as many files as you want into your connected bucket, and Planhat will process them periodically.

What do the integrations support?

Formats: XLSX, XLS, CSV, JSON

Providers: GCP Cloud Storage, AWS S3, Google Drive, and Microsoft OneDrive

📌 Note: once a file is processed, it is moved to a folder called "processed" within your bucket. This ensures that we do not process the same file more than once.


2. How do I set it up?

Select any of these links to jump to your provider-specific instructions.


GCP Cloud Storage

  • Authentication: OAuth2

  • Requirements:

    • access to the Google Developer Console

    • a Google Cloud Storage bucket

    • a Planhat account with access to the Operations Module

In Google Cloud Storage

  1. Head to the Google Developer Console and log in

  2. Click OAuth consent screen on the left-hand panel

    1. Under "User Type" select Internal

      If you don’t see this screen probably you have an OAuth consent screen already created, so skip to Step 8

    2. Click Create

  3. In the "Edit app registration" > "App information" screen, populate the form

    1. App name: something memorable like "Planhat"

    2. User support email: select your email from the dropdown

  4. In the "Edit app registration" > "Developer contact information" screen, populate the Email addresses with, at minimum, your contact email

  5. Click "Save and Continue"

  6. On the "Scopes" section, click "Save and Continue"

  7. Click "Back to Dashboard"

  8. Click "Credentials" on the left-hand panel

  9. Click "Create Credentials" and choose OAuth client ID from the dropdown

  10. Under "Application type", select "Web application"

  11. Name the client something memorable like "Bucket for Planhat"

  12. Under the "Authorized redirect URIs" header, click "+ Add URI" and add this URL, cluster https://api-cluster (i.e. us4).planhat.com/connectiondata/oauth2/authresult

  13. Click "Create" - you will now receive a confirmation screen as follows. Click "Download JSON" to store your OAuth credentials. This is what you will need to initiate the authentication in Planhat

In Planhat

  1. Go to the Operations Module in Planhat

  2. Once inside Integrations tab, select "GCP Cloud Storage" among the native integrations

  3. Complete the Authentication section by filling in the following data:

    Client Id: Check the client_id of the JSON in step 13

    Client Secret: Check the client_secret of the JSON in step 13

  4. Click Authenticate now at the right of the authentication section. This action will open a new "Sign in with Google" tab/popup. Then, click the account owner and select "accept/allow" to grant Planhat access

  5. Complete End points section by choosing which end points you wish to enable

  6. Click on the actions you wish to add and customize them accordingly


Google Drive

  • Authentication: OAuth2

  • Requirements:

    • access to the Google Developer Console

    • a Google Drive (folder)

    • a Planhat account with access to the Operations Module

In Google Cloud Storage

  1. Head to the Google Developer Console and log in

  2. Click OAuth consent screen on the left-hand panel

    1. Under "User Type" select Internal

      If you don’t see this screen probably you have an OAuth consent screen already created, so skip to Step 8

    2. Click Create

  3. In the "Edit app registration" > "App information" screen, populate the form

    1. App name: something memorable like "Planhat"

    2. User support email: select your email from the dropdown

  4. In the "Edit app registration" > "Developer contact information" screen, populate the Email addresses with, at minimum, your contact email

  5. Click "Save and Continue"

  6. On the "Scopes" section, click "Save and Continue"

  7. Click "Back to Dashboard"

  8. Click "Credentials" on the left-hand panel

  9. Click "Create Credentials" and choose OAuth client ID from the dropdown

  10. Under "Application type", select "Web application"

  11. Name the client something memorable like "Bucket for Planhat"

  12. Under the "Authorized redirect URIs" header, click "+ Add URI" and add this URL https://api.planhat.com/connectiondata/oauth2/authresult

  13. Click "Create" - you will now receive a confirmation screen as follows. Click "Download JSON" to store your OAuth credentials. This is what you will need to initiate the authentication in Planhat

In Planhat

  1. Go to the Operations Module in Planhat

  2. Once inside Integrations tab, select "Google Drive" among the integrations

  3. Complete the Authentication section by filling in the following data:

    Client Id: Check the client_id of the JSON in step 13

    Client Secret: Check the client_secret of the JSON in step 13

  4. Click Authenticate now at the right of the authentication section. This action will open a new "Sign in with Google" tab/popup. Then, click the account owner and select "accept/allow" to grant Planhat access

  5. Complete the End points section by choosing which end points you wish to enable

  6. Click on the actions you wish to add and customize them accordingly


Microsoft OneDrive

  • Authentication: OAuth2

  • Requirements:

    • access to the Microsoft Azure Developer Console

    • Microsoft OneDrive

    • a Planhat account with access to the Operations Module

In Microsoft Azure

  1. Head to the Azure App Registrations Page and log in

  2. Click Register an application and populate the following values...

    1. Name: Some meaningful name like planhat-app

    2. Supported account types: Accounts in any organizational directory (Any Azure AD directory - Multitenant)

    3. Redirect URI: Choose Web in the dropdown and input the redirect URL https://api.planhat.com/connectiondata/oauth2/authresult

  3. Copy the Application (Client) ID and keep it in a convenient place to use later

  4. Click into Certificates & secrets on the left sidepanel, then click on + New client secret

    1. Description: Something meaningful like planhat-file-fetcher

    2. Expires: Select a date for the secret to expire (remember, this will cause the connection to break, so this should be sufficiently far in the future and you should schedule to renew the secret before expiry)

  5. Click Add, copy the Value parameter (Client Secret), and keep it somewhere convenient along with the Client ID, to use later

In Planhat

  1. Go to the Operations Module in Planhat

  2. Once inside Integrations tab, select "OneDrive" among the integrations.

  3. Complete the Authentication section by filling in the following data:

    Client Id: Check the client_id in step 5

    Client Secret: Check the client_secret in step 5

  4. Click Authenticate now at the right of the authentication section. This action will open a new "Sign in with Microsoft" tab/popup where you can sign in and grant Planhat access

    Annoyed by Windows 10 sign in prompts, here's how to stop it

  5. Complete the End points section by choosing which end points you wish to enable

  6. Click on the actions you wish to add and customize them accordingly


AWS S3

  • Authentication: Basic Auth

  • Requirements:

    • access to the AWS Console

    • an AWS S3 bucket

    • a Planhat account with access to the Operations Module

In AWS S3

  1. Go to AWS Console and log in with the account where you have the bucket

  2. Click on Add Users

  3. Fill the User name with something like “import-data-bucket-planhat” and click Next

  4. The idea is to create a user without any permissions and then grant permissions via roles each time a request is made

  5. Click on Create user

  6. After creating the user, you will be directed back to the list of users. From there, click on the user that was recently created

  7. Copy the ARN from the Summary section and keep it in an easily accessible place for later use

  8. Click on the “Security credentials” tab and then on “Create access key”

  9. Select the "Application running outside AWS" option, check the "confirmation" box, and click “Next”

  10. Click on “Create access key”

  11. The access key has been created. Click on "Download .csv file”

  12. Open the CSV file and you will see something like this:

  13. Then, go to IAM > Roles in the AWS console and click on the Create role blue button

  14. Select ‘Custom trust policy’ and change the principal property for this:

    "Principal": { 

    "AWS": "PASTE THE ARN COPIED BEFORE HERE"

    }

  15. Click on next, add the AmazonS3FullAccess permission and click next

  16. Write a meaningful name and click on create role

  17. After created, search your role name and open the details. Once you see the details copy the ARN of the role (in Summary) and keep it in an easily accessible place for later use

  18. To proceed, go to the AWS S3 Dashboard and locate the zone where your bucket is located. Remember this information for later. (In this screenshot, the zone where my bucket is located is highlighted in blue. The zone of my bucket is us-west-2)

In Planhat

  1. Go to the Operations Module in Planhat

  2. Once inside Integrations tab, select "Amazon Web Services" among the integrations

  3. Complete the Authentication section by filling in the following data:

    API Base URL with Base Path: s3.[your_zone].amazonaws.com

    (My example bucket: s3.us-west-2.amazonaws.com)

  4. Click Authenticate now at the right of the Authentication section. This action will open a new tab/popup where you can set up basic auth that grants Planhat access

    Username: Your Access Key ID 
    Password: Your Secret Access Key

  5. Complete the End points section by choosing which end points you wish to enable

  6. Click on the actions you wish to add and customize them accordingly


3. Add actions

Now that your integration is set up, you can go ahead and apply the actions from the action templates:

  1. Click on any of the templated actions you wish to set up

  2. Configure the template as you wish, setting:

    1. Frequency: how often should new files be scanned and imported from your bucket?

    2. Object / Metric:

      1. For CRM data, decide where in Planhat you wish to import the data to

      2. For Metrics data, decide what type of data you wish to configure it as in Planhat

  3. Complete the Required Fields.

    1. GCP Cloud Storage: Bucket Name, Folder Path

    2. Google Drive: Folder Id

    3. Microsoft OneDrive: Folder Path

    4. AWS S3: Bucket Name, Folder Path, Region, ARN Role

      1. Note:

        1. To refer to the root of the bucket, leave the folder path field empty

        2. If you want to use a folder, please start with its name and end with a slash (/)

          If you put a slash at the beginning, the automation will not work

  4. Click Add Action

  5. Now you're all set and the action will fetch data on the schedule you defined. If at any point you want the fetch to run immediately

Did this answer your question?