ActiveCampaign / activecampaign-api-nodejs

Node.js wrapper for the ActiveCampaign API
MIT License
39 stars 36 forks source link

Can't add tags #10

Closed adityabansod closed 9 years ago

adityabansod commented 9 years ago

This code fires a Invalid API method error:

        var eventdata = {
            tag: 'somesampletag',
            email: 'example@example.com'
        };

        ac.api('contact/tag/add', eventdata).then(function(result) {
            console.log('success', result);
        }, function(result) {
            console.log('failure', redirect);
        });     

the contact has been created earlier by calling ac.api('contact/add').

mthommes commented 9 years ago

Hi, thanks for pointing this out. This should be fixed now (Github and NPM have been updated).

Here is a working example (I included multiple tags just for demonstration):

var eventdata = {
    tags: 'somesampletag,somesampletag2',
    email: 'example@example.com'
};

ac.api('contact/tag/add', eventdata);

Let us know of any problems or questions! :+1: