Search API Connector Documentation
Connect to an OAuth API
API Connector includes many preset OAuth2 connections. 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.
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 alternative authorization framework that lets a user securely connect a third party to their account by logging in to an application instead of entering their credentials.
You've probably encountered OAuth2 before. It's the technology behind most "sign in with X" authorization flows.
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
- Whenever you select an OAuth connection, you'll see a blue Connect button. These connections are available when you create a request and on the Manage Connections screen.
- Whichever flow you choose, these OAuth buttons will direct you to the target site, where you will be prompted to connect your account.
- Once you accept, API Connector will display your connection status and keep you connected.
- Now you can enter your request details and choose your connector to make your request:
How to Add Multiple OAuth Connections
In some cases you may log into an application or website with multiple email addresses, e.g. one email address for one of your Etsy stores, and a different email address for another.
- Wherever you can add OAuth connections, you can add in multiple connections. When creating a custom or preset request, click the
+icon. On the Manage Connections screen, add new OAuth connections by clicking Connect in the Add New OAuth section.
- By default, the new connection will take the name of the root connection with a "-2" (or "-3", "-4", etc) appended at the end, e.g. "Google Analytics-2". Optionally rename the connection from the Manage Connections screen. This will help you identify which OAuth connection is associated with which account. (Only multi-OAuths can be renamed, not the original root connection.)
- This new connection will be available wherever OAuth is available.
- To remove connections from the dropdown list, open the Manage Connections screen and click the logout icon.
- Multiple instances of OAuth2 connections are saved only to the sheet in which they're created. Unlike the original root connections, they won't be available in other sheets.
- 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 OAuth2. If you're using the OAuth2 method, just skip their instructions for adding an API key. You don't need to enter any authentication-related headers if you're using OAuth2.