Google API provider

What is a provider?

Providers contain the connection details to external platforms. A provider only needs to be set up once and can then be used when creating tiles on a dashboard.

There are two types of integrations and therefore providers:

  • generic Web API providers that can connect to any REST API
  • dedicated providers that connect to a specific external platform or database (SQL, ServiceNow, Azure Active App Insights, Elasticsearch, etc.)

About Google API providers

Adding a particular Google API provider is a one-time configuration task, and once you have that Google API provider configured you can use it with multiple tiles. The instructions below use the example of the Google Analytics API, but can be used to create providers for other Google REST APIs.

Adding a Google API provider in SquaredUp DS

1. Add a new provider in SquaredUp DS for Azure

  1. In SquaredUp DS navigate to the right-hand menu ☰ > system > Integrations

  2. Under Integrations click Web API
  3. Click on the authentication type OAuth
  4. In the service name box type in a suitable name for this provider. This name is used to create a URL so it is best to avoid spaces and non-alphanumeric characters., e.g. GoogleAnalytics.
  5. Leave the grant type as authorization code
  6. The base URL should be https://www.googleapis.com/
  7. The authorization URL should https://accounts.google.com/o/oauth2/v2/auth?prompt=consent&access_type=offline&include_granted_scopes=true

    The parameters appended to the authorization URL allow SquaredUp DS to continue to access the API after the first hour. Without them SquaredUp DS can't reauthorize the provider automatically after the first token has expired. access_type=offline - requests that the API return a refresh token to keep the connection alive. If you omit the prompt=consent and the app is already authorized, you will not receive a refresh token back. The token expires every hour and without a refresh token, you have to manually reauthorize the provider each time. include_granted_scopes=true - allows the refreshed token to have the same permissions as the original request when the user was present.

  8. The token URL should be https://oauth2.googleapis.com/token
    At this point we need to save the provider and follow the next steps to obtain a client ID and secret from the Google Developer Console, after which we will return to complete these provider details.
  9. Click save to save the provider.
  10. Copy the redirect url displayed. This will be used in the next section.

2. Configure the Google Developer Console

  1. Visit the Google Developer Console
  2. Create a new project as required.
  3. Select Create Credentials > OAuth Client ID
  4. Select Web Application
  5. Enter the following:
    Name: This can be anything
    Authorized JavaScript origins: Should be the hostname of your SquaredUp server including the http/https
    Authorized Redirect URIs: Should be the redirect url copied from SquaredUp DS right-hand menu ☰ > system > web api. It will be your SquaredUp DS instance followed by /ext-core-webapi/callback/GoogleAPIProvider where GoogleAPIProvider is the name of the provider you created.
    For example: https://SquaredUpServer/SquaredUp/ext-core-webapi/callback/GoogleAnalytics
    Where SquaredUpServer is the name of the server where SquaredUp DS is installed.
  6. Click save/create
  7. Copy the client ID and secret to use in the next section.

3. Complete the provider setup in SquaredUp DS

  1. In SquaredUp DS navigate to the right-hand menu ☰ > system > Integrations

  2. Click on the provider you created earlier to edit it.
  3. Paste in the client id and secret copied from the Google Developer Console.
  4. Paste in the relevant authorization scope from OAuth 2.0 Scopes for Google APIs. For example, for Google Analytics it should be the URL scope listed for 'View your Google Analytics data' which is https://www.googleapis.com/auth/analytics.readonly
  5. Click save. You will be redirected to Google to login and authorize and then back to SquaredUp DS.

If the configuration is correct then you will see a green tick.

If the provider is not authorized it could be that some of the provider configuration is incorrect (for example the username, password, secret etc), or if you use a proxy it could be that the proxy is not configured. See How to configure SquaredUp DS to use a proxy.

You can now add Web API tiles using this Google API provider, see How to use the Web API tile with Google APIs, such as Google Analytics

Was this article helpful?


Have more questions or facing an issue?