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
- Log into your Zapier account.
- Click on "Create Zap" in the top right corner.
- Name your Zap something recognizable, like "Ad Hub File Retrieval & GoHighLevel Sync."
Step 2: Choose the Trigger
- 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.
- For the trigger event, select "Catch Hook." This will listen for incoming data or events from your API.
- Click “Continue.”
Step 3: Run JavaScript Code in Zapier
- In your Zap editor, add an action called "Code by Zapier."
- Choose "Run JavaScript."
- Input the following code (replace
your_api_key
with Your Key Here and company_id
or subscription_id
with your respective values):
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;
- Click "Continue" to proceed.
Step 4: Test the Zap
- 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.
