Hello,
I’m trying to create a scenario that would periodically retrieve informations about each campaign I’m sending in Active Campaign and copy them in a google sheet.
From what I’ve seen, the Active Campaigns node doesn’t include much related to campaigns data so I have to make a http request.
I’m using the endpoint : https://{youraccountname}.api-us1.com/api/3/messages
as shown here : List all messages
My issue is that this request returns way too much information and I’m only interested in a few.
Specifically, I’m only interested in the “id”, “fromname” and “subject” fields.
I also know that the Active Campaign API doesn’t have the options to only retrieve a selection of fields. So if it’s possible to do it, it’ll have to be inside N8N.
Here’s the beginning of what the http request is returning in Json format :
[
{
“messages”: [
{
“userid”: “1”,
“ed_instanceid”: “0”,
“ed_version”: “1”,
“cdate”: “2023-07-26T04:32:46-05:00”,
“mdate”: “2023-07-26T04:32:46-05:00”,
“name”: “”,
“fromname”: "Pierre ",
“fromemail”: “”,
“reply2”: “”,
“priority”: “3”,
“charset”: “utf-8”,
“encoding”: “quoted-printable”,
“format”: “mime”,
“subject”: “Votre confirmation de désabonnement”,
“preheader_text”: “”,
“text”: “Bonjour %FULLNAME%, Il s’agit d’un e-mail de confirmation vous permettant de connaître votre mise à jour d’abonnement à notre liste de diffusion %LISTNAME% Vous vous êtes désabonné pour ne plus recevoir d’e-mails.”,
“html”: "body”
“htmlfetch”: “now”,
“textfetch”: “now”,
“hidden”: “0”,
“preview_mime”: “”,
“preview_data”: null,
“has_predictive_content”: “0”,
“links”: {
“user”: "
},
“id”: “1”,
“user”: “1”
},
{
“userid”: “1”,
“ed_instanceid”: “0”,
“ed_version”: “1”,
“cdate”: “2023-07-26T04:32:46-05:00”,
“mdate”: “2023-07-26T04:32:46-05:00”,
“name”: “”,
“fromname”: "Pierre ",
“fromemail”: “”,
“reply2”: “”,
“priority”: “3”,
“charset”: “utf-8”,
“encoding”: “quoted-printable”,
“format”: “mime”,
“subject”: “Mettez à jour votre abonnement vers %LISTNAME%”,
“preheader_text”: “”,
“text”: " Mettre à jour vos informations d’abonnement à %LISTNAME%
“htmlfetch”: “now”,
“textfetch”: “now”,
“hidden”: “0”,
“preview_mime”: “”,
“preview_data”: null,
“has_predictive_content”: “0”,
“links”: {
“user”: “”
},
“id”: “2”,
“user”: “1”
},
And this is only the first 2 “messages”, there’s 854 of them + my goal is that the automation runs once every day to retrieve new campaigns data.
So I’m wondering if there’s a way that I can only filters the “id”, “fromname” and “subject” fields for each campaigns so it’s the only data imported in my google sheets.
I can’t seem to make it works…
Thank you very much,