> ## Documentation Index
> Fetch the complete documentation index at: https://idle.docs.datacircle.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# ActiveCampaign

> Put a person's LinkedIn headline, job title and company on their ActiveCampaign record, from the LinkedIn URL on it, with n8n or your own code.

Our n8n node gets the LinkedIn profile from a contact's LinkedIn URL, and the workflow writes their headline, job title and company back to the contact. We fetch each profile live and charge the provider's [price](/pricing) to your [balance](/balance).

## 1. Add the fields

In ActiveCampaign, add four custom contact fields of type text: **LinkedIn URL**, **Headline**, **Job title** and **Company**.

## 2. Build the workflow in n8n

Install our node first: [n8n](/n8n). Your ActiveCampaign API URL and key are in ActiveCampaign, **Settings**, **Developer**. Then add three nodes:

1. **ActiveCampaign Trigger**. Events: `subscribe`, when a person joins a list. Its output names each custom field by its ID: `contact[fields][3]` holds the LinkedIn URL when that field's ID is 3.
2. **Datacircle**: LinkedIn Profile, Get. Profile URL: `{{ $json['contact[fields][3]'] }}`, with your LinkedIn URL field's ID in place of 3. Provider: Up2Data, HarvestAPI or Fetchin.
3. **ActiveCampaign**: Contact, Update. Contact ID: `{{ $('ActiveCampaign Trigger').item.json['contact[id]'] }}`. Under Update Fields, Custom Fields, pick each field and give it its value:

| Field | Up2Data | HarvestAPI | Fetchin |
| - | - | - | - |
| Headline | `{{ $json.data.headline }}` | `{{ $json.element.headline }}` | `{{ $json.title }}` |
| Job title | `{{ $json.data.current_company?.title }}` | `{{ $json.element.currentPosition[0]?.position }}` | `{{ $json.jobTitle }}` |
| Company | `{{ $json.data.current_company?.name }}` | `{{ $json.element.currentPosition[0]?.companyName }}` | `{{ $json.companyName }}` |

Then publish the workflow. A record with no LinkedIn URL gets our `400`, not charged.

Don't add the `update` event with the Api source: the workflow's own update would start the workflow again, and you pay for each run.

## Without n8n

Your code makes three calls. In step 3, your code writes the profile's fields from the table above.

```bash theme={null}
# 1. The person's custom field values, the LinkedIn URL among them
curl "$ACTIVECAMPAIGN_API_URL/api/3/contacts/<contact id>/fieldValues" -H "Api-Token: $ACTIVECAMPAIGN_API_KEY"

# 2. Their LinkedIn profile, through Datacircle
curl -X POST "https://idle.api.datacircle.dev/v1/profiles/enrich" \
  -H "Authorization: Token $DATACIRCLE_API_KEY" -H "X-Data-Provider: up2data" \
  -H "Content-Type: application/json" -d '{"url": "<their LinkedIn URL>"}'

# 3. The headline, job title and company back to their fields, each by its field ID
curl -X PUT "$ACTIVECAMPAIGN_API_URL/api/3/contacts/<contact id>" -H "Api-Token: $ACTIVECAMPAIGN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"contact": {"fieldValues": [{"field": "4", "value": "<headline>"}, {"field": "5", "value": "<job title>"}, {"field": "6", "value": "<company>"}]}}'
```

[LinkedIn Profile API](/linkedin-profile) has the requests for the other providers.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.