Integrations

API Integrations

This category focuses on how users can seamlessly integrate Ad Hub with various marketing tools and platforms to enhance their marketing efforts. It covers the steps to set up integrations, manage data flow, and optimize campaigns using integrated data.

Written by Support Ad Hub
Back to articles Written by Support Ad Hub

API Integrations

Overview:

  • Ad Hub API Integration with Zapier: Automate the retrieval of audience data.
  • GoHighLevel Integration: Sync your lists with GoHighLevel sub-accounts.


Step 1: Create a New Zap in Zapier

  1. Log into your Zapier account.
  2. Click on "Create Zap" in the top right corner.
  3. Name your Zap something recognizable, like "Ad Hub File Retrieval & GoHighLevel Sync."

Step 2: Choose the Trigger

  1. Select "Webhook" as the trigger event (if available). If you don’t have access to Webhooks, you can skip this step for now and follow the next actions.
  2. For the trigger event, select "Catch Hook." This will listen for incoming data or events from your API.
  3. Click “Continue.”

Step 3: Run JavaScript Code in Zapier

  1. In your Zap editor, add an action called "Code by Zapier."
  2. Choose "Run JavaScript."
  3. Input the following code (replace your_api_key with Your Key Here and company_id or subscription_id with your respective values):
javascript
const requestBody = { company_id: "your_company_id", api_key: "Your Key Here" }; const response = await fetch('https://data-out.adhubaudience.com/download-csv-file/', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify(requestBody), }); const data = await response.json(); output = data || []; return output;
  1. Click "Continue" to proceed.

Step 4: Test the Zap

  1. Click on “Test & Continue” to verify that the JavaScript is correctly set up. This step will send a request to the API and return the sample output.





Did this answer your question?

Sad smiley Neutral smiley Happy smiley
Operated by

Ad Hub Audience 2024