# Snapchat Import Integration Snapchat allows you to easily communicate with friends, view live stories from around the world, and discover news via temporary pictures and video messaging. As a business, you can run Snapchat Ads Manager to create and manage ads and run campaigns to generate leads and more. Snapchat Import integration allows you to import lead generation report data from Snapchat. ## Prerequisites - Basic knowledge of Treasure Data - A Snapchat business account ## Requirements and Limitations - Import of only lead generation report data is supported. - Data collected from lead generation ads is not stored for more than 30 days. This means that the start time cannot be more than 30 days in the past. - The Snapchat Marketing API implements rate limits to ensure infrastructure stability. Rate limits are implemented both at App and Token level. The App supports an overall average volume of 20 requests per second while individual Access tokens issued by the App can make requests at an average of 10 requests per second. ## Static IP Address of Treasure Data Integration If your security policy requires IP whitelisting, you must add Treasure Data's IP addresses to your allowlist to ensure a successful connection. Please find the complete list of static IP addresses, organized by region, at the following link: [https://api-docs.treasuredata.com/en/overview/ip-addresses-integrations-result-workers/](https://api-docs.treasuredata.com/en/overview/ip-addresses-integrations-result-workers/) ## Get Snapchat Ads Account ID 1. Go to [https://ads.snapchat.com/](https://ads.snapchat.com/).  Fill username and password, and click log in. 2. After logging in, you can see your ad account ID from URL. For example, https://ads.snapchat.com/112345-3211-410f-test-1332433/create. Here, "112345-3211-410f-test-1332433" is your ad account ID. ## Import from Snapchat via TD Console ### Create Authentication Your first step is to create a new authentication with a set of credentials. 1. Select **Integrations Hub**. 2. Select **Catalog**. ![](/assets/image2021-9-30_14-38-2.ca92fa4ab9277dca95973c6bd413fc662a3f0d04b57d58f7a8c952a29f28bbec.2891338a.png) 1. Search for **Snapchat** in the Catalog; hover your mouse over the icon and select **Create Authentication**. ![](/assets/snapicon.0ca38b774caa0896efe0d41214276a3ff40cc71ebd1c5b252270380bf5927d5d.2891338a.png) ![](/assets/image2021-9-30_14-42-0.d6a5ad453f9fa98b4336af9506dadbd04ea44299e2f9af7fd760f75ac68e3f88.2891338a.png) 1. Ensure that the **Credentials** tab is selected and then enter credential information for the integration Or select **Click here** to connect to a Snapchat account. You are redirected to Snapchat to login, if you haven't logged in yet, or to the consent page to grant access to Treasure Data. ![](/assets/mceclip3-2.e1578e5759d705d835407753a7ddc77120fcd7863a1720a6c8e84d90222030be.2891338a.png) | Parameter | Description | | --- | --- | | Ad Account ID | Snapchat Business Ad Account ID | 1. Enter a name for your authentication, and select **Done**. ### Create a Source 1. Open TD Console. 2. Navigate to **Integrations Hub** > **Authentications**. 3. Locate your new authentication and select **New Source**. ### Create a Connection Complete the following table for the source. | Parameter | Description | | --- | --- | | Data Transfer Name | You can define the name of your transfer. | | Authentication | The authentication name that is used to a transfer. | 1. Type a source name in the Data Transfer Name field. 2. Select **Next**. The Create Source page displays with the **Source Table** tab selected. ### Identify a Source Table | Parameter | Description | | --- | --- | | Data Source | Object data that will be import | | Start Time | Import data since this time | | End Time | Import data until this time | | Incremental loading | `Whether to enable incremental loading` | Select **Next**. ### Define Data Settings | Parameter | Description | | --- | --- | | Max wait time for report to complete | Max wait time for report to complete in hours | | Max retry count per API call | Max retry count per API call | | Initial retry interval per API call | Initial retry interval per API call in seconds | | Max retry interval per API call | Max retry interval per API call in seconds | Select **Next**. ### Data Preview You can see a [preview](/products/customer-data-platform/integration-hub/batch/import/previewing-your-source-data) of your data before running the import by selecting Generate Preview. Data preview is optional and you can safely skip to the next page of the dialog if you choose to. 1. Select **Next**. The Data Preview page opens. 2. If you want to preview your data, select **Generate Preview**. 3. Verify the data. ### Data Placement For data placement, select the target database and table where you want your data placed and indicate how often the import should run. 1. Select **Next.** Under Storage, you will create a new or select an existing database and create a new or select an existing table for where you want to place the imported data. 2. Select a **Database** > **Select an existing** or **Create New Database**. 3. Optionally, type a database name. 4. Select a **Table**> **Select an existing** or **Create New Table**. 5. Optionally, type a table name. 6. Choose the method for importing the data. - **Append** (default)-Data import results are appended to the table. If the table does not exist, it will be created. - **Always Replace**-Replaces the entire content of an existing table with the result output of the query. If the table does not exist, a new table is created. - **Replace on New Data**-Only replace the entire content of an existing table with the result output when there is new data. 7. Select the **Timestamp-based Partition Key** column. If you want to set a different partition key seed than the default key, you can specify the long or timestamp column as the partitioning time. As a default time column, it uses upload_time with the add_time filter. 8. Select the **Timezone** for your data storage. 9. Under **Schedule**, you can choose when and how often you want to run this query. #### Run once 1. Select **Off**. 2. Select **Scheduling Timezone**. 3. Select **Create & Run Now**. #### Repeat Regularly 1. Select **On**. 2. Select the **Schedule**. The UI provides these four options: *@hourly*, *@daily* and *@monthly* or custom *cron*. 3. You can also select **Delay Transfer** and add a delay of execution time. 4. Select **Scheduling Timezone**. 5. Select **Create & Run Now**. After your transfer has run, you can see the results of your transfer in **Data Workbench** > **Databases.** ## Import from Snapchat via Workflow You can import data from Snapchat by using td_load>: operator of workflow. If you have already created a SOURCE, you can run it. ### Using a Source 1. Identify your source. 2. To obtain a unique ID, open the Source list and then filter by product. 3. Open the menu and select "Copy Unique ID". ![](/assets/image2021-10-12_12-26-58.09d9b84b0f1f752c7c95b0bc1c2d8e8b7302e5b91c6a3cb5f01309dadf53a604.2891338a.png) 1. Define a workflow task using td_load> operator. ```yaml +load: td_load>: unique_id_of_your_source database: ${td.dest_db} table: ${td.dest_table} ``` 1. Run a workflow.