Configuring for Google Docs
This topic describes the configuration for a Logi Info application that uses Connection.Google Docs and elements like DataLayer.Google Spreadsheet.
Google Docs uses OAuth 2.0 authentication and you'll need to have a Google account in order to create appropriate credentials for your Logi application. Here are the general steps that you'll need to take to configure the Connection.Google Docs element:
- Login to your Google account and obtain a Client ID and Client Secret from the Google API Console.
- Fill in the attributes (see below) of the Connection.Google Docs element, exceptGoogleOAuth2Json.
- Click the Browse button at the end of the GoogleOAuth2Json attribute.
- In the Google Authorization page that opens, ensure the user name matches the Username attribute value you entered.
- Click Allow on the authorization page and it will close
- Click OK on the dialog box in Studio and the GoogleOAuth2Json attribute value will be filled-in for you.
Here are the Connection.Google Docs element attributes:
(Required) Specifies the OAuth 2.0 Client ID value from the Google API Console.
(Required) Specifies the OAuth 2.0 Client Secret value from the Google API Console.
(Required) Specifies a special JSON string, generated by the Google Authorization page. Do not click the browse button in this attribute until all other attributes have been filled-in. See Steps 4, 5, and 6 above.
(Required) Specifies a unique, arbitrary connection element ID.
(Required) Specifies the user name for the Google account that owns the data we want to access.
Here are the detailed instructions for your interaction with the Google API Console:
- Click ENABLE APIS AND SERVICES in the Dashboard page, which takes you to the Library page. In the G Suite section, find and click the Google Drive API, as shown above.
- You'll be shown a page with information about the API. Click ENABLE as shown above.
- Return to the library and repeat the process for the Google Sheets API.
- Return to the Dashboard page of the console, as shown above, and you should see the two newly-enabled APIs.
- If you already have credentials, skip to Step 10. To create new credentials, go to the Credentials page, as shown above, and click Create credentials. Select the OAuth client ID option.
- If you see the warning shown above, click Configure consent screen and provide an application name. You do not need to provide any other information. Click Save at the bottom of the page.
- In the Application Type list, select the Other application type and provide an arbitrary name for the client. Click Create to continue.
- Your new credentials will be displayed, as shown above. Copy the values...
- ...and paste them into the Connection.Google Docs element's Client ID and Client Secret attributes, as shown above.
Be sure that there are no leading or trailing spaces in the values you paste into these attributes, especially if you use the Google-supplied Copy icons.
Then provide the required element ID and enter the Username for the account that owns the data that you want to access on Google Docs. In the Google API Console, click OK to continue, and skip to Step 8 in these instructions.
- If you already have OAuth client credentials and just need the Client security values, in the Credentials page click the name of the client ID, as shown above, to see them:
The details of the credentials set will be displayed, including the Client ID and Client Secret values. Copy and paste these values into the Connection.Google Docs element's Client ID and Client Secret attributes. You can also change the restrictions on the credentials here. Then provide the required element ID and enter the Username for the account that owns the data that you want to access on Google Docs.
- Next, in Logi Studio, click the Browse button in the Connection.Google Docs element's GoogleOAuth2Json attribute, as shown above. If you don't see the button, click the blank attribute value first. This dialog box will appear:
Click OK to continue.
- Your browser will open, requesting a login to Google. After a successful login, the page shown above will be displayed; click Allow to consent to access.
- In Logi Studio, the dialog box shown above will appear. Click OK to continue.
Now when you look at the Connection element, the GoogleOAuth2Json attribute should have a JSON value.
You're now ready to use your connection to retrieve data from Google Docs.