# Setting up Integrations

## Standard Integrations

Applications have the ability to natively integrate with many popular services, including Twilio, Zendesk, Salesforce, and more. When setting up an integration, the services can be displayed and managed right from your application. For example, when [setting up a Salesforce integration](../../building-apps/integration-guides/create-a-salesforce-lead), Airkit will bring in all of the tables that are associated with a Salesforce account and can then leverage the built in operations such as Create Record, Delete Record, Update Record, Find Records or Query Records.

## Creating a Custom Integration

Custom integrations can be used to connect to external data sources that are not a part of Airkit's standard integrations. Any one of these standard authentication methods can be used for your API.

For a more detailed breakdown of what is required to create an integration using these authentication methods, see [Custom Integrations](../../integrations/custom-integrations),

* [OAuth 2.0](https://support.airkit.com/v17.15/reference/custom-integrations#oauth-20)
* [API Token](https://support.airkit.com/v17.15/reference/custom-integrations#api-token)
* [HTTP Basic Auth](https://support.airkit.com/v17.15/reference/custom-integrations#http-basic-auth)
* [Custom Token](https://support.airkit.com/v17.15/reference/custom-integrations#custom-token)
* [SFTP](https://support.airkit.com/v17.15/reference/custom-integrations#sftp)

## Using OAuth 2.0 to integrate Twitter

This example demonstrates how to create a custom authenticated integration with the Twitter API that uses OAuth 2.0 and connect it to an Airkit application.&#x20;

**Note**: When setting up an OAuth 2.0 integration in Airkit, a refresh token is expected, and the system/endpoint must be configured accordingly. Some systems will automatically account for this and some systems may not.&#x20;

**Prerequisites**

* [Twitter developer account](https://developer.twitter.com/content/developer-twitter/en/docs/basics/developer-portal/overview)
* A [Twitter App](https://developer.twitter.com/content/developer-twitter/en/docs/basics/developer-portal/guides/apps) with a developer account

**Setting up your custom integration**

1. Sign in to [console.airkit.com](https://console.airkit.com) and select **Integrations** and then \*\*Custom Integrations.\*\*This is where to manage the integrations associated with an organization.

![cusromintsmall.png](https://2093598723-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2DgLBPTrwoEhWaU24LL%2Fuploads%2Fgit-blob-515a65520cf95a1fb9bbb1f12af650bd1eb4c597%2Fsetting-up-integrations-v180-0.png?alt=media)

2. Then click on **Create new** to add a new Custom Integration. Enter the name of the service  and a unique key. This key is a global unique identifier associated with your custom integration. Then select OAuth 2.0 for the Authentication Type. This will then expand the fields that are required to create the integration.

![organizing info](https://2093598723-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2DgLBPTrwoEhWaU24LL%2Fuploads%2Fgit-blob-d39f80ae63e51b2a1ab6aa7c3391e488a462ee89%2Fsetting-up-integrations-v180-1.png?alt=media)

3. For the [Twitter API](https://developer.twitter.com/en/docs), provide the following for the configuration fields:
   * **Authorization Grant Type:** choose 'Client Credentials'
   * **Access Token Endpoint:** enter [https://api.twitter.com/oauth2/token](https://api.twitter.com/oauth2/token)
   * **Access Token Verb:** choose 'POST'
   * **Authorization Endpoint:** enter [https://api.twitter.com/oauth2/token](https://api.twitter.com/oauth2/token)
   * **OAuth Scope:** enter 'read'
   * **Client ID:** enter your API key that was generated from the Twitter App
   * **Client Secret:** enter in your API Secret generated from the Twitter App
   * **Token Parameter Type**: choose 'Header'
   * **Token Parameter name**: enter 'Authorization'
   * **Token Parameter Value Template**: enter 'Bearer {token}'

![organizing info](https://2093598723-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2DgLBPTrwoEhWaU24LL%2Fuploads%2Fgit-blob-92c8747e94edc9e760e58a904a03bcb0332d2c69%2Fsetting-up-integrations-v180-2.png?alt=media) ![organizing info](https://2093598723-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2DgLBPTrwoEhWaU24LL%2Fuploads%2Fgit-blob-946bda9e6a95d9f435a9424ded0c7e779f6277ef%2Fsetting-up-integrations-v180-3.png?alt=media)

4. Click **Create** to finish creating the custom integration

**Connecting the custom integration to Airkit**

After setting up the custom integration, you need to connect the integration to Airkit. This will surface the integration to your application and make it usable in the app.&#x20;

1. In the Airkit Console, go to **Integrations** and then \*\*Connected Accounts.

![](https://2093598723-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2DgLBPTrwoEhWaU24LL%2Fuploads%2Fgit-blob-e3f22ead7fda491349c538f2375ef2cc6492b3e8%2Fsetting-up-integrations-v180-4.png?alt=media)\*\*

2. Click on **Create new** and give the credential a name and choose the Twitter integration in the dropdown menu. Then click on **Create**, which then enables you to connect Twitter to your Airkit App!

![organizing info](https://2093598723-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2DgLBPTrwoEhWaU24LL%2Fuploads%2Fgit-blob-d10394c6d8fdd018c55839f6025055ad0424e9d3%2Fsetting-up-integrations-v180-5.png?alt=media)

## Using an API Token to integrate with GIPHY

This example demonstrates how to create a custom integration with the [GIPHY API](https://developers.giphy.com/docs/sdk) that uses an API Token and connect it to an application.

**Prerequisites**

* [GIPHY Developer Account](https://developers.giphy.com/)
* GIPHY App with associated API Key

**Setting up your custom integration**

1. Sign in to [console.airkit.com](https://console.airkit.com) and select **Integrations** and then \*\*Custom Integrations.\*\*This is where to manage the integrations associated within organization.

![cusromintsmall.png](https://2093598723-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2DgLBPTrwoEhWaU24LL%2Fuploads%2Fgit-blob-515a65520cf95a1fb9bbb1f12af650bd1eb4c597%2Fsetting-up-integrations-v180-0.png?alt=media)

2. Then click on **Create new** to add the new Custom Integration. Enter the name of the service and a unique key. This key is a global unique identifier associated with your custom integration. Then select API Token for the Authentication Type. This will then expand the fields that are required to create the integration.

![organizing info](https://2093598723-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2DgLBPTrwoEhWaU24LL%2Fuploads%2Fgit-blob-1e6c5c2f09041f1f8cfa09c5b586a1377531f299%2Fsetting-up-integrations-v180-7.png?alt=media)

3. For the GIPHY API, provide the following for the configuration fields:
   * **Token Paramater Type**: choose 'URL Parameter'
   * **Token Parameter Name:** enter 'api\_key'
   * **Token Parameter Value Template:** enter '{token}'

![organizing info](https://2093598723-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2DgLBPTrwoEhWaU24LL%2Fuploads%2Fgit-blob-24efb57ab13b9ecb9577b8c5780f457be6c18eb8%2Fsetting-up-integrations-v180-8.png?alt=media)

4. Click on **Create** to finish creating the custom integration

**Connecting your custom integration to Airkit**

After setting up the custom integration, you need to connect the integration to Airkit. This will surface the integration to your application and make it usable in the app.&#x20;

1. In the Airkit Console, go to **Integrations** and then \*\*Credentials.

![](https://2093598723-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2DgLBPTrwoEhWaU24LL%2Fuploads%2Fgit-blob-e3f22ead7fda491349c538f2375ef2cc6492b3e8%2Fsetting-up-integrations-v180-4.png?alt=media)\*\*

2. Click on **Create new** and give the credential a name and choose the GIPHY integration in the dropdown menu.&#x20;

![organizing info](https://2093598723-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2DgLBPTrwoEhWaU24LL%2Fuploads%2Fgit-blob-b401bb7f7aca944c232867cd4dee3a994937d4ae%2Fsetting-up-integrations-v180-10.png?alt=media)

3. Then provide your API Token from your GIPHY app and click on **Create** to create an integration from GIPHY to Airkit.

![organizing info](https://2093598723-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2DgLBPTrwoEhWaU24LL%2Fuploads%2Fgit-blob-7e50802c466488caf6db0ecc548ff11ea9d1d561%2Fsetting-up-integrations-v180-11.png?alt=media)

### Using Integrations in an App

Now that the integrations is added, they can now be used in an application. Integrations can be used to call API endpoints directly from [Connections Builder](../../studio/builder-bar/connections-builder) using the HTTP Operation.&#x20;

## Adding an integration into an Airkit App

To use the integration, it needs to be added to your app from [Settings](../../studio/builder-bar/settings).&#x20;

1. In the Airkit studio, go to **Settings** and scroll down to Integrations. Then click on **+New** > **Adapters** and select the custom integration that was created in the console.

![](https://2093598723-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2DgLBPTrwoEhWaU24LL%2Fuploads%2Fgit-blob-388de3dfc63229321dac03b98028ff57fa4b577c%2Fsetting-up-integrations-v180-12.png?alt=media)

2. Then select the credential that is associated with your custom integration and Save your app. This will enable your app to leverage your integration in the HTTP Operation in Connections Builder.

![](https://2093598723-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2DgLBPTrwoEhWaU24LL%2Fuploads%2Fgit-blob-6af8d62faf26ccd5ae63aceccd3a441272509d36%2Fsetting-up-integrations-v180-13.png?alt=media)

## Understanding Profiles and Integrations

Oftentimes when building out an application, there's the need to have separate environments such as DEV, QA, and Production environments. For example, you can set up a DEV environment with a dev instance of a custom integration, and be able to test and debug an application without needing to touch production data. To configure this, you need to [set up different profiles](../../building-apps/publishing/publishing-your-application) within your application, and each profile would have different configuration settings.&#x20;

### Next steps

Now with the integrations set up, an application can then be used for inbound requests to [query and manipulate data on external systems](querying-and-manipulating-data). Integrations can also be used for outbound requests to [push data from Airkit to external systems](subscriptions) as well.
