Examples: Twitter and Giphy
Set up authenticated integrations and custom integrations
# 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.
**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.
## 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.

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.
<img src="https://a01-support.airkit.com/setting-up-integrations/createnew1.png" alt="organizing info" style={{ maxHeight: "350px" }} />
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}`'
<img src="https://a01-support.airkit.com/setting-up-integrations/createnew2.png" alt="organizing info" style={{ maxHeight: "450px" }} />
<img src="https://a01-support.airkit.com/setting-up-integrations/createnew3.png" alt="organizing info" style={{ maxHeight: "500px" }} />
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.
1. In the Airkit Console, go to **Integrations** and then **Connected Accounts.**

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!
<img src="https://a01-support.airkit.com/setting-up-integrations/connectedaccountTwitter.png" alt="organizing info" style={{ maxHeight: "450px" }} />
# 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.

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.
<img src="https://a01-support.airkit.com/setting-up-integrations/giphy1.png" alt="organizing info" style={{ maxHeight: "450px" }} />
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}`'
<img src="https://a01-support.airkit.com/setting-up-integrations/giphy2.png" alt="organizing info" style={{ maxHeight: "450px" }} />
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.
1. In the Airkit Console, go to **Integrations** and then **Credentials.**

2. Click on **Create new** and give the credential a name and choose the GIPHY integration in the dropdown menu.
<img src="https://a01-support.airkit.com/setting-up-integrations/giphy3.png" alt="organizing info" style={{ maxHeight: "350px" }} />
3. Then provide your API Token from your GIPHY app and click on **Create** to create an integration from GIPHY to Airkit.
<img src="https://a01-support.airkit.com/setting-up-integrations/GIPHY4.png" alt="organizing info" style={{ maxHeight: "350px" }} />
# 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](https://support.airkit.com/docs/connections-builder) using the HTTP Operation.
Updated 3 days ago