Now on the Self-Hosted version of DronaHQ, it provides you with several Connectors like Databases like MySQL, Microsoft SQL, etc., and Third-party connectors like Slack, Trello, Stripe, etc. You can install the different APIs using their respective authentication methods. There are different methods of API authentication, using the API Key, using basic Auth which is using the username and password, using the OAuth which is a standard for accessing resources without a password, and the AWS authentication method.
In this article, we will focus on installing connectors on the self-hosted version with various supported authentication methods and also extending APIs for installed connectors.
Installing the API connector
To install third-party connectors, under Studio > Connectors, click (+) Connector.
On-Prem has different options like GraphQL, Airtable, Gmail, and more including the use of the REST API that allows you to easily connect to the Third-Party APIs to access the systems.
While installing third-party APIs, there are mainly 4 major API authentication supports on the Self-Hosted version.
- OAuth V2
- Basic Authentication
- API Key Authentication
- AWS Authentication
Installing API connector with OAuth
OAuth 2.0 is about authorization. The implementation returns an access token that would be used with the DronaHQ integration to authorize requests. It is a protocol that allows the user to grant a third-party website or application access to the user’s protected resources without revealing the identity of the user. It is an open standard followed by several major third-party services.
We will be selecting GITHUB for this example.
It will ask for the connector name for the installation of GitHub.
A section will open where you need to provide Client ID and Client Secret credentials for a successful connection to your GitHub account.
The credentials can be found on the GitHub application settings for the new OAuth. You can find the URL for OAuth redirection on the same tab while configuring the connector.
Copy the OAuth redirect URL: You need to copy the URL link provided in this step. It would be used in the respective developer portal of the service’s client application that will receive OAuth 2.0 credentials. Once you create the client app in the service you need to copy this URL to the section usually marked as the OAuth 2.0 redirect URI of the app. You can also add additional permissions if required for the application. You can also add the redirect URL in the allowed origin section as well.
Enter the application credentials: You need to configure the application credentials. Simply copy the Client Id and Client Secret from the app’s API or from the developer’s setting and paste them in the connector configuration.
After providing the credentials, simply click on Save. It will pop up a window to sign in. Give authorization permission.
Once the authorization is completed, you will have your GitHub API connector installed on your Self-Hosted Version along with some predefined API endpoints of the GitHub Connector.
Installing API connectors with Basic Authentication
This is mainly used in scenarios where the API relies on HTTP Basic authentication standards. When you are setting up a new service, DronaHQ prompts for the username and password and then adds the appropriate encoded authorization headers to the API request.
We will be selecting RAZORPAY here, which requires Basic Authentication.
Enter the Connector name and click continue. In the next step, you will find the base URL for your endpoint and a place to put up the Key ID and Key Secret which you can avail of from your Razorpay account. After filling the details click Save.
Once the authorization is completed, you will have your Razorpay API Connector installed on your Self-Hosted Version and some predefined API endpoints of the Razorpay Connector.
Installing API connectors with API Key Authentication
Let us now understand how to connect to any API using an API key. One of the advantages of using API key authentication is its inherent simplicity. It’s a single key that allows you to authenticate just by including the key. Most commonly these connectors using API keys are used for read-only data.
We will be selecting HACKERRANK here, which requires API key authentication.
Enter the Connector name and click continue. In the next step, you will find the base URL for your endpoint and a place to put up the API KEY. Place the API key Bearer <API_KEY> and click Save.
Once the authorization is completed, you will have your Hackerrank API Connector installed on your Self-Hosted Version and some predefined extended API endpoints of the Hackerrank Connector.
Installing API connectors with AWS Authentication
Here we are going to use AWS authentication. Generally, you would use this authentication method when you are using the Amazon Web Service APIs. It is important to remember that you need to set up your AWS account from where you would get your access keys.
We will be selecting AMAZON AWS S3 here, which requires AWS authentication.
Enter the Connector name and click continue. In the next step, you will find the base URL for your endpoint and a place to put up Access Key, Secret Key, and AWS Region.
- Access Key: Copy the Access key provided in your account
- Secret Key: Copy the secret key provided in your account
- AWS Region: Region for the AWS account where you are going to use the service
Once these values are set you can click Save.
Once the authorization is completed, you will have your Amazon AWS S3 API connector installed on your Self-Hosted Version and some predefined API endpoints of the Amazon AWS S3 Connector.
Extending an Existing API Connector
You can now add APIs based on the Connector configuration. Under Self-Hosted Studio > Connectors you can see your connector is added. To add your new API or extend an existing API as per the API endpoint, click Add API.
We will see extending an existing API connector with the help of GitHub API which we have already installed in our Self-Hosted version.
Now Add the Connector API name and the API endpoint with the required parameters and test your API.
Now in the URL for the sake of this example, we are going to retrieve the follower details of a GitHub username. You can note that we have assigned a username parameter. This is the dynamic variable that would be used to assign the username for the user you are accessing from your GitHub.
If you Test it now, you can view the Response as shown below on successful authentication.
Click on Save and your endpoint API will be added. Your API can be seen under respective Connectors now. You can thus add API Connectors that have OAuth 2.0 as authentication.
These APIs can be used in your Apps and workflows using the CALLAPI function.