{"id":21177426,"url":"https://github.com/betsol/node-activecampaign-api","last_synced_at":"2025-07-09T22:30:42.987Z","repository":{"id":57172873,"uuid":"71982952","full_name":"betsol/node-activecampaign-api","owner":"betsol","description":"Node.js client for ActiveCampaign API","archived":false,"fork":false,"pushed_at":"2016-10-28T19:38:41.000Z","size":6,"stargazers_count":4,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-23T06:27:19.916Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/betsol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-26T08:33:59.000Z","updated_at":"2018-10-02T19:52:16.000Z","dependencies_parsed_at":"2022-08-24T14:41:07.887Z","dependency_job_id":null,"html_url":"https://github.com/betsol/node-activecampaign-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/betsol/node-activecampaign-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/betsol%2Fnode-activecampaign-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/betsol%2Fnode-activecampaign-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/betsol%2Fnode-activecampaign-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/betsol%2Fnode-activecampaign-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/betsol","download_url":"https://codeload.github.com/betsol/node-activecampaign-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/betsol%2Fnode-activecampaign-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261449958,"owners_count":23159817,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-20T17:16:01.895Z","updated_at":"2025-07-09T22:30:42.746Z","avatar_url":"https://github.com/betsol.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ActiveCampaign API Client for Node.js\n\n[![npm version](https://badge.fury.io/js/activecampaign-api.svg)](http://badge.fury.io/js/activecampaign-api)\n\n\nThis Node.js module provides lightweight client for ActiveCampaign API with\nconvenient Promise interface as well as API helper with useful functions.\n\n\n## Features\n\n- Integrates ActiveCampaign API to Node.js\n- Provides Promise interface out of the box\n- Has useful convenient helper functions\n- Throws sensible errors\n- Minimum dependencies\n\n\n## Installation\n\n### Install library with *npm*\n\n`npm i -S activecampaign-api`\n\n\n## Usage\n\n### Using API client directly\n\n```js\n\n// Require the module.\nconst activeCampaignApi = require('activecampaign-api');\n\n// Instantiate a new client.\nconst activeCampaignApiClient = new activeCampaignApi.ApiClient({\n  // Pass your account name and secret key\n  accountName: 'myaccountname',\n  key: '6ad3...835d'\n});\n\n// Listing all active contacts from the list.\nactiveCampaignApiClient\n  .call('contact_list', {\n    filters: {\n      listid: 4,\n      status: 1  // 1 = active\n    }\n  }, 'GET')\n  .then(response =\u003e {\n    // Handle the response...\n    console.log(response);\n  })\n;\n\n// Adding contact to the list.\nactiveCampaignApiClient\n  .call('contact_add', {}, 'POST', {\n    email: 'email@example.com',\n    first_name: 'Jack',\n    last_name: 'Bauer',\n    'p[4]': '4' // List ID\n  })\n  .then(response =\u003e {\n    // Handle the response...\n    console.log(response);\n  })\n;\n\n```\n\n### Using API helper functions\n\n```js\n\n// Require the module.\nconst activeCampaignApi = require('activecampaign-api');\n\n// Instantiate a new client.\nconst activeCampaignApiClient = new activeCampaignApi.ApiClient({\n  // See example above for details\n});\n\n// Instantiate a helper instance, pass API client instance to it.\nconst activeCampaignApiHelper = new activeCampaignApi.ApiHelper(activeCampaignApiClient);\n\nactiveCampaignApiHelper\n  .subscribe({\n    email: 'email@example.com',\n    first_name: 'Jack',\n    last_name: 'Bauer'\n  }, {\n    listIds: [4], // You can pass multiple list IDs here\n    \n    // Passing custom fields\n    customFields: {\n      company_name: 'CTU',\n      utm_campaign: 'campaign-name'\n    }\n  })\n  .then(response =\u003e {\n    // Handle the response...\n    console.log(response);\n  })\n  .catch(error =\u003e {\n    \n    if (error instanceof activeCampaignApi.Errors.EmailAlreadyUsed) {\n      // E-Mail is already subscribed to the specified list\n    } else {\n      // Some other error\n    }\n    \n    // Alternative syntax:\n    if ('EmailAlreadyUsed' == error.name) {\n    }\n    \n  })\n;\n```\n\nPlease see the source code for more details and helper functions.\n\n\n## Feedback\n\nIf you have found a bug or have another issue with the library —\nplease [create an issue][new-issue].\n\nIf you have a question regarding the library or it's integration with your project —\nconsider asking a question at [StackOverflow][so-ask] and sending me a\nlink via [E-Mail][email]. I will be glad to help.\n\nHave any ideas or propositions? Feel free to contact me by [E-Mail][email].\n\nCheers!\n\n\n## Support\n\nIf you like this library consider to add star on [GitHub repository][repo-gh].\n\nThank you!\n\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 Slava Fomin II, BETTER SOLUTIONS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n  [so-ask]:        http://stackoverflow.com/questions/ask?tags=node.js,javascript\n  [email]:         mailto:s.fomin@betsol.ru\n  [new-issue]:     https://github.com/betsol/node-activecampaign-api/issues/new\n  [repo-gh]:       https://github.com/betsol/node-activecampaign-api\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbetsol%2Fnode-activecampaign-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbetsol%2Fnode-activecampaign-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbetsol%2Fnode-activecampaign-api/lists"}