Closed MikeVerhees closed 7 years ago
Make sure the list exists in the account. Also I don't see the user
var being declared anywhere in the code. I was able to do it with the following code:
var ActiveCampaign = require("activecampaign");
var ac = new ActiveCampaign("URL", "API_KEY");
var user = {
email: 'john@example.com'
}
var contact = {
'email': user.email,
'p[2]': 2,
'status[2]': 1,
};
var contact_add = ac.api("contact/add", contact);
contact_add.then(function(result) {
console.log(result);
}, function(result) {
console.log(result);
});
Also to just add a note for any future readers, to find the list Id which is the 'p[2]': 2, part of the contact variable. You need to open the Active Campaign list in your browser and the list Id for the list is in the url.
So if you list is #46 it would look like:
var contact = { 'email': user.email, 'p[2]': 46, 'status[2]': 1, };
I need to add multiple contacts to a list, Can I do that in one call using v1 or v3? OR Do I need to call 1 API call per contact?
Hello,
I'm trying to add new members to my contacts and a specific mailing list, however all the examples I could find were for PHP. So I tried to structure it the same way as Lists are gotten from a GET request, I didn't get an error, but no success adding the user to the list:
this is what I've been trying:
I'd appreciate any help or pointers in the right direction, Thanks!