Configuring Google Drive API through REST Client in Astera

Astera has an in-built REST service using which you can retrieve data residing on online sources such as Google drive. In this document, we will cover the REST API configuration required to call data from Google drive.

Getting the IDs and Names of Files Present in Google Drive

  1. Create a new project on https://console.developers.google.com/apis.

  2. On the Dashboard window, click Enable APIs and Services and add Google Drive API.

  1. Now select Google Drive API from the Project Dashboard and click on Try in API Explorer.

  1. On the API Explorer window, turn on Authorize requests using the OAuth 2.0 option. At this step, you will be required to sign in to your Google Drive account. Log in by providing your username and password and click Allow.

  1. Now go back to the Project Dashboard and click Credentials in the menu bar on the left. Click on the Create credentials drop-down button and select OAuth Client ID from the drop-down list. Now, in the context menu, select Web Application and in the Authorized Redirect URLs field, type: https://developers.google.com/oauthplayground.

  1. Copy your Client ID and Secret Key. You will need these in the next steps.

  1. Now go to https://developers.google.com/oauthplayground. Click on OAuth 2.0 Configuration and check the Use your own OAuth credentials checkbox.

Enter the OAuth client ID and Client Secret Key (created in the previous step) in the OAuth Client ID and OAuth Client secret fields respectively.

Now type https://www.googleapis.com/auth/drive in Input Scope and click Authorize. Click Allow on the next screen.

  1. On the OAuth 2.0 Playground Step 2 tab, click Exchange authorization code for tokens to generate the OAuth access token.

Configuring REST Client

  1. Now open the Astera client and configure the Rest Client with the following settings:

  1. Create the layout in Astera using sample JSON text to retrieve data from Google Drive.

Additional Note:

The token for the REST client is generated outside Astera, that is, on the source platform you want to retrieve the data from. Once generated, this token can be used for multiple subsequent REST calls and you’ll be able to get the result as long as the token is not expired.

However, the token can also expire for different reasons. It can be that the time duration is breached or because it hasn’t been in use for the required time frame.

Astera does not offer any such maintenance as to withhold this token expiry. This is outside the scope of the application and the expiry setting of the token is maintained and controlled by the online source platform itself.

Last updated