# Notion

Before you create an Integration between the Aisera platform and your Notion application, use the following steps to get an Access Token that you will use with the connection.

## Prerequisites

1. Create an API token:

   a. Log in to your Notion application. \
   b. Go to your Notion **Integrations** page.\
   c. Click **Create new integration** or choose an existing one.\
   d. Copy the Notion integration's **Access Token**.\
   e. Share a database with your integration.
2. The Notion API is located here.
3. Use your access token when you set up your Integration with the Aisera platform, as described below.

### Integration Setup <a href="#h_01kavvmegp6f7hjgy5avswmsr5" id="h_01kavvmegp6f7hjgy5avswmsr5"></a>

To create the Notion integration:

1. Choose **Settings > Integrations** from the left navigation menu of the Aisera Admin UI.

<div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2FKocsPAs5HiAGIqfQHM85%2Fsettings_integ.png?alt=media&#x26;token=31ca9ee7-f53b-4328-9858-8e9723e477ba" alt="" width="229"><figcaption></figcaption></figure></div>

2. Click on the **+ New Integration** button in the upper-right corner.

<div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2Fv3urfoZCFka9K0wx8jB8%2Fnortion1.png?alt=media&#x26;token=221e5104-21ab-4a77-af8d-84a0746ac480" alt="" width="563"><figcaption></figcaption></figure></div>

3. Choose **Notion** from the Integration options.

<div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2FSDqeOnadWxZbrM5e9VT0%2Fpick_notion.png?alt=media&#x26;token=3a50a578-bcb7-4978-95ca-3d90e23b4158" alt="" width="339"><figcaption></figcaption></figure></div>

4. Provide a **Name** and the endpoint for your Notion application and click **Next**.

<div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2FumU8Xh3KyKesxWWIi1Qm%2Fnotion_step2_integ.png?alt=media&#x26;token=15b9cdae-e13c-435a-91a4-03830d221714" alt="" width="375"><figcaption></figcaption></figure></div>

5. Enter the **Notion Access Token** that you received in the **Prerequisite** section.

<div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2FQKwdpAMqzKmrmKjhBIrP%2Fnotion3.png?alt=media&#x26;token=55284971-3273-4c85-8bc8-27afb8cd9468" alt="" width="375"><figcaption></figcaption></figure></div>

Enter the **Username** and **Password** of the Service User or Admin who has permission to access your Notion data.

Click **OK**. The success message appears when the integration is successful.&#x20;

<div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2F2ovOKc9kEwwvYpPSeykO%2Fds_success.png?alt=media&#x26;token=80647e84-b5e0-4b53-8622-ae5962dd39a2" alt="" width="351"><figcaption></figcaption></figure></div>

### Data Source Setup <a href="#h_01kavz8myqjne9x4v6d0v6wg85" id="h_01kavz8myqjne9x4v6d0v6wg85"></a>

After configuring your Notion integration, configure your Notion Data Source.

To create a Notion data source:

1. Choose **Settings > Data Sources** from the left navigation menu of your Aisera Admin UI.
2. Choose **+ New Data Source** in the upper-right corner.

<div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2F2Q3Og1C3I5X5PhHKnWiU%2Fnew_data_source4.png?alt=media&#x26;token=aad4a452-b432-4115-adcd-28256086ac82" alt="" width="563"><figcaption></figcaption></figure></div>

2. Type **Notion** in the Search field and Select the **Notion icon**.

<div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2FqbbolFhWYibefr9wUNms%2Fchoose_notion.png?alt=media&#x26;token=7007b10c-10ba-4d8a-be39-28a7b6b92edb" alt="" width="375"><figcaption></figcaption></figure></div>

3. Click **Next**.
4. Enter a **Name** for your Data Source.

<div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2F94gLxvbignoH7AMlLLpJ%2Fnotion_functions.png?alt=media&#x26;token=0e99926f-b9bc-4aeb-a51a-33df1a28d024" alt="" width="563"><figcaption></figcaption></figure></div>

5. Choose the **Functions** that you want your data source to support. As you choose Functions, the dialog window will expand to give you more options. For most use cases, you can choose **Knowledge Base Learning**.

<div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2F7tBYLwJu1ohLwPLFt0iN%2Fstep2_notionds.png?alt=media&#x26;token=edd96bab-8b34-43ed-843a-b51ecae4c4e9" alt="" width="375"><figcaption></figcaption></figure></div>

5. Choose your Notion Integration from the Integration pull-down list.
6. If you plan to use [**Event Triggers**](https://docs.aisera.com/aisera-platform/ai-automation-optimize-flow/event-studio#complete-the-following-steps-to-create-the-event-trigger), create or choose a [**Data Type**](https://docs.aisera.com/aisera-platform/ai-automation-optimize-flow/event-studio#complete-the-following-steps-to-define-a-data-type) for the Triggers before you continue. Then choose that Data Type from the Data Types pull-down list on this page.
7. Select **On Demand** for the **Schedule** field.&#x20;
8. Click **Next**.
9. The parameters on Step 3 are optional. If you're using an Event Type, you can add it here.

<div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2FFj5yMLZgxhsEIRZryMsk%2Fnotion_step3.png?alt=media&#x26;token=f1392d23-37f9-464a-8b59-345ea846956b" alt="" width="563"><figcaption></figcaption></figure></div>

10. Step 4 allows you to add Templates for your Knowledge Articles are also optional.

<div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2FAec3CBSlgO6QYuf34L9X%2Ftemplates8.png?alt=media&#x26;token=d6ceb7f3-84bd-45f3-8268-1a4d3cffc8b9" alt="" width="563"><figcaption></figcaption></figure></div>

10. Click **Next**.
11. Keep the default parameters for Step 5, as shown below.

<div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2FqFsywejyjDkTImCsICrz%2Fstep5a.png?alt=media&#x26;token=7a11f67c-faa7-4cfd-84dd-c021fba872e6" alt="" width="563"><figcaption></figcaption></figure></div>

<div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2FbgAxxFMS9aHlN3n0tWxC%2Fstep5b.png?alt=media&#x26;token=6beac1d2-6f9e-4b71-a839-4d1c2f6bcc34" alt="" width="563"><figcaption></figcaption></figure></div>

10. Click **Next**.
11. Add code for any over-rides or transformations. Your Aisera Team can help you with the format for these.

<div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2FfFXlTTjX50suqu5beTH6%2Fadd_overrides.png?alt=media&#x26;token=0f96c360-10ac-4230-bc0e-0e16a1a4212e" alt="" width="375"><figcaption></figcaption></figure></div>

10. Click **OK**.

When you see the green success message at the top of your window for a pre-mapped connector, the data from each field is being ingested into your Aisera platform. Open the **Data Source Details** window to see the [**mapped fields**](https://docs.aisera.com/aisera-platform/adding-data-to-your-tenant/data-ingestion#field-mapping).
