Our REST/URL connector connects to most APIs that use the REST protocol and one of these authentication methods (if authentication is required): Basic HTTP authentication, 2-Step authentication, API Key authentication, and OAuth authentication. The example in this article uses OAuth authentication.
To connect to your data using the REST/URL connector, you need to:
- Write a query by referring to the service provider's API documentation.
- Create and save a data source.
Step 1: Write a query
Some API connection requests are free and open to the public. However, depending on the service provider, you may need to:
- Have an account with the service provider.
- Contact the service provider to grant you API request permissions.
- Contact the service provider to receive an authentication token.
- Pay an API access fee.
To learn more about these requirements and how to write your query, refer to the service provider’s API documentation. Once you have a query, you will copy and paste it into Klips, when creating and saving your data source. See the following section for details.
Step 2: Create and save a data source
The following procedure uses the example of OAuth as the authentication method and assumes you have an existing OAuth token for the service you're getting data from.
To create and save a data source:
- Click the + button beside Data Sources in the left navigation sidebar.
Note: If you don't see this option, click your Account Name at the bottom of the left navigation sidebar and select Data Sources instead. Then, in your data source library, click Create a New Data Source. - On the Where is your data? page, under Additional options, click REST/URL.
- On the Configure your connection page, at Query URL, paste your query into the text box.
- Select a Data Format (JSON, XML, CSV, or Excel).
- At Method, select the method required by the API (GET or POST).
- Expand Query Parameters and enter settings as required by the API (many APIs do not require any). Type a Name and Value for each parameter required and set one of the following Types:
- Query - This is equivalent to the parameters in an API query. You can either include them in the URL or in this section.
- Header - If required by the API (for example, Smartsheets), add parameters to the query Header.
- Cookie - If required by the API, Cookie parameters are used for session-related data.
- Expand the Authentication (OAuth, 2-Step, X-WSSE, or Basic) menu.
- At Type, select OAuth Token.
See the section below if you want to learn more about OAuth authentication. - At Use Existing, select an existing token from the drop-down list.
- Click Get data.
- Ensure this is the data you’re looking for and, optionally, select the checkbox to Model your data. Learn more about modelling your data source.
- Click Continue.
- Name, choose refresh settings, and, optionally, share your data source.
- Click Save.
Learn more about OAuth authentication
OAuth token authentication is an open standard for authentication and is used as a security measure when retrieving data from web services. Many third-party services require an OAuth token to be passed with the API request to ensure that the server requesting the data is safe.
See these related articles for more detailed information on using OAuth authentication to connect to data in Klips: