ActiveCampaign / activecampaign-api-nodejs

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

Unable to GET all contacts using contact_list #2

Closed selipso closed 10 years ago

selipso commented 10 years ago

Here is the code I wrote so far:

var contact_list = ac.api("contact/list", {}, function(response) {
  console.log(response);
});

This is the error it gives:

/Users/Thakkery/Sites/omninox-local/node_modules/activecampaign/lib/ActiveCampaign.js:71
                throw new Error("Invalid API method.");
                      ^
Error: Invalid API method.
    at Object.api (/Users/Thakkery/Sites/omninox-local/node_modules/activecampaign/lib/ActiveCampaign.js:71:11)
mthommes commented 10 years ago

Hi, found some more bugs. I've updated our GitHub repo and NPM. Here is what the syntax should look like:

var contact_list = ac.api("contact/list?ids=all&sort=id&sort_direction=ASC&page=1", {}, function(response) {
        console.log(response);
});

(You'll need to specify some parameters with this particular method. You can find documentation here.)

Let us know if you have any problems, or anything else you might find.

Thanks!