Some APIs require API keys to authenticate the requester and authorize them to perform an action. API Key is a token that the requester provides while making the API call. The API Key is either included in the request URL or the request Header of your API call. It is a secret that only the requester and the API server should know. For more details about API-key and how it works, read our guide.
In this article, we'll explain how to configure your app's authorization if it uses the API Key authorization method.
Let's get started.
API Key Authorization Method
After successfully adding your app's basic information, in the next step you have to configure your app's authorization.
Step 1: Go to the Authorizations section.
Select API Key as your Authorization Type.
Note: If you want to create more than one authorizations for a single app, you can do that by exiting the App Connector Builder's wizard mode and clicking on the 'Create New Authorization' button.
All your current authorizations will be listed (shown above).
You can perform the following operations on your existing authorization. (Refer to the above image)
- Test your authorization by clicking on the 'flash' icon button.
- Delete your authorization by clicking on the 'bin' icon button.
- View the accounts that are currently using the authorization by clicking on the 'user' icon button.
- Add more accounts to your authorization by clicking on the '+ Add New Account' button.
That said, let's continue with creating your API Key based authorization.
Click on 'Continue' to proceed.
Note: The Authorization Type cannot be changed once saved.
Testing the API Call
Step 2: In this step, you'll configure the API call and test how the call will be made for every individual end-user.
Enter the following information.
The Request URL consists of an HTTP method, a Base URL, and a resource URI. A base URL is the prefix of all the URLs in your application.
In this example, we've added the API token inside the resource URI. You'll see that the final URL will be saved and appear right below the 'Request URL' field. This URL will be hit when API requests are made on the Resource Server.
If your API requires the API Key to be passed in the request Header, you can add the key and value to the Header field. (Shown below)
Click on 'Test Authorization.'
Step 3: Next, you'll be asked to authenticate yourself by providing your API Key.
Add your API Key here and click on 'Proceed.'
If your API Key is authenticated by the API, your authorization will be tested successfully. Click on 'Continue' to proceed.
You're all done configuring the API Key based authorization for your app. You can go ahead and start creating Activities for your app.