Search API Connector Documentation

Print

Connect to a Preset OAuth2 API

premium

API Connector includes many preset OAuth2 connections (see the full list here). For these preset connections, you can securely authenticate yourself by clicking a Connect button rather than retrieving and entering an API key or other credentials.

You may also add your own custom OAuth2 connections for APIs we haven’t integrated.

Contents

Before You Begin

Click here to install the API Connector add-on from the Google Marketplace.

What is OAuth 2.0?

Most APIs require some kind of authorization. Frequently this involves entering an API key or token, which function similarly to passwords.

OAuth2 is an authorization framework that lets a user securely connect a third party to their account without manually entering or exposing their credentials.

You’ve probably encountered OAuth2 before. It’s the technology behind most “sign in with X” authorization flows. For example:

oauth2-img0

Why Use OAuth 2.0?

  • some APIs provide access only through OAuth 2.0
  • connect by clicking a button rather than digging through documentation for API keys
  • avoid manually managing the process of exchanging & refreshing tokens
  • connect securely, without needing to enter or share sensitive access credentials.

How to Connect

  1. Whenever you select an OAuth connection, you’ll see a blue Connect button. These connections are available in the API library, through your own custom OAuth requests, and in the Manage Connections screen.
    presetoauth-connect
  2. Whichever flow you choose, these OAuth buttons will direct you to the target site, where you will be prompted to connect your account.
    oauth2-img3
  3. Once you accept, API Connector will display your connection status and keep you connected.
    presetoauth-connected
  4. Now you can enter your request details and choose your connector to make your request:
    presetoauth-response

Notes

  • When you connect your sheet to an API via OAuth2, only your account can run the queries. If other people have Edit access to your sheet, they can see and edit your requests, but they need to authenticate through their own accounts to run them.
  • Some APIs provide multiple methods of connecting, e.g. either an API key or OAuth 2.0. If you’re using the OAuth 2.0 method, just skip their instructions for adding an API key. You don’t need to enter any authentication-related headers if you’re using OAuth 2.0.
  • API Connector only supports one OAuth2 connection per service. For example, you can not authenticate to two different FB Ads Manager accounts at the same time (but there’s no problem connecting to multiple client accounts if they’re all under the same FB Ads Manager account).

Previous Add Request Body
Next Edit Fields

36 thoughts on “Connect to a Preset OAuth2 API”

    • Hi Adam, thank you for the suggestion. I’ve mostly been adding high-demand connections like Facebook and YouTube etc, so this one might make more sense as a custom OAuth2 connection that you add privately.

      Reply
  1. Hey,

    I have a question about Connections. Is there a way to create a global connection for all the accounts editing the google spreadsheet? For example, we would like to create a Quickbook connection that can be used by all the editors to create requests. Thank you for your answer!

    Reply
    • Hi Erik! Thank you for your message. The OAuth2 connections are per user, since OAuth2 is an authentication framework based around allowing access only for the specific users that have authorized the application. If you would like multiple people to access the connection, you could either have each user authorize the connection separately, or you could create a shared gmail account for use with Sheets, or you could designate someone to set up / schedule requests and just give everyone else read access to the data. I hope that helps clarify, if not, please let me know.

      Reply
    • Hey David, I haven’t connected to the Google Ads API myself but I think you could do this by following Google’s documentation on how to get your OAuth2 details and connect to the API. I’ll probably go through this process myself and add it as a default connection.

      Reply
  2. Hello. I suggest a connection to Mercadolibre API, the most important market place in Latinamerica and one of the largest of the world.

    Reply
    • Thanks, I looked into this but couldn’t seem to create a connection without being a resident of their supported countries. So for now I suggest creating your own custom OAuth connection, just register an app on their site and they’ll give you the client ID and secret. Then the Auth URL is https://auth.mercadolibre.com.ar/authorization (change ‘ar’ based on the country domain you use with them), and the Token URL is https://api.mercadolibre.com/oauth/token. Just enter those 4 values into API Connector’s custom OAuth form to connect.

      Reply
    • I just checked this out and it was pretty straightforward to set up OAuth, I was able to connect and retrieve test data using our OAuth connection manager. However, the confusing part is that they don’t seem to provide any simple mechanism for an individual merchant to get their own data, instead they require that you set up a sandbox account, set up a test app, then get approved for a production account, then create a production app to be published in their marketplace, etc. I just applied for a production account and will see how that goes.

      Reply
    • Thanks for the suggestion. In the meantime you could set up a custom OAuth connection. Based on their docs, you’d get your client ID and secret by registering an app here, and then the auth URL would be https://api.getbase.com/oauth2/authorize?scope=read and token URL would be https://api.getbase.com/oauth2/token

      Reply
    • Not really sure, I just searched online and couldn’t find any link to API documentation for Titan K-12. Do you have a link? If so I can take a look.

      Reply
      • I’m having troubles locating it as well since it is a relatively new software system. I’ll let you know if I find it, thanks though!

  3. I’m getting closer: I can now connect, but when I run the request, I get this message:

    1) getemail: Request failed: Access not granted or expired. Please click Manage Connections and check OAuth2 connection status.

    I don’t understand what I’m being asked to do.

    Reply
    • Hi Brian, that error message means you’re not connected to the OAuth connection you’re using.
      To connect, please click the Manage connections link in the main menu or on the Create screen. From here, you can scroll down the screen and click Connect if you’re not already connected.

      If you’re still stuck, can you please send me a screenshot of what your full request looks like?

      Reply

Leave a Comment

Table of Contents