# mailchimp-api-3

> Mailchimp api wrapper for v3 of the mailchimp api

Latest version **0.0.9** (published 2017-08-09) · ISC license · 0 weekly downloads

## Install

```sh
npm install mailchimp-api-3
pnpm add mailchimp-api-3
yarn add mailchimp-api-3
bun add mailchimp-api-3
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.9 |
| Published | 2017-08-09 |
| First published | 2017-01-13 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | Volodymyr Paskiv |
| Maintainers | art2cool |

## Links

- npm: https://www.npmjs.com/package/mailchimp-api-3
- Repository: https://github.com/art2cool/mailchimp-api-3
- Homepage: https://github.com/art2cool/mailchimp-api-3#readme
- Issues: https://github.com/art2cool/mailchimp-api-3/issues
- npm.io page: https://npm.io/package/mailchimp-api-3

## Dependencies (1)

- [md5](https://npm.io/package/md5.md) ^2.2.1

## Recent versions

- 0.0.9 (latest) — 2017-08-09
- 0.0.8 — 2017-02-21
- 0.0.7 — 2017-01-16
- 0.0.5 — 2017-01-13
- 0.0.3 — 2017-01-13
- 0.0.2 — 2017-01-13
- 0.0.1 — 2017-01-13

## README

# mailchimp-api-3
Mailchimp api wrapper for v3 of the mailchimp api, with batch handling.

## install
```sh
npm i mailchimp-api-3
```
## use
```javascript
let Mailchimp = require('mailchimp-api-3');
let mailchimp = new Mailchimp(<api-key>);
```

## Members
#### CREATE
```javascript
mailchimp.members.create(<list_id>, {
    email_address: <user_email>,
    merge_fields: {
       EMAIL: <user_email>,
       USERNAME: <user_name>
    },
    status: 'subscribed',
        ....
    })
    .then( user => {
        // result user
    })
    .catch( e => {
        // result e
    })
```
#### GET
```javascript
//get user by email
mailchimp.members.get(<list_id>, <user_email>)
  .then( user => {
    // result user
  })
  .catch( e => {
    // result e
  })

//get all users from list
mailchimp.members.getAll(<list_id>)
  .then( user => {
    // result user
  })
  .catch( e => {
    // result e
  })
```
#### UPDATE
```javascript
let body = {
    merge_fields: {
        EMAIL: <user_email>,
    },
    interests: {<interests_id>: true}
    .....
};
mailchimp.members.update(<list_id>, <user_email>, body)
    .then( user => {
        // result user
    })
    .catch( e => {
        // result e
    })
```

#### REMOVE
```javascript
mailchimp.members.remove(<list_id>, <user_email>)
    .then( response => {
        // result response
    })
    .catch( e => {
        // result e
    })
```

## Lists

#### GET
```javascript
//get list by list_id
mailchimp.lists.get(<list_id>)
  .then( list => {
    // result list
  })
  .catch( e => {
    // result e
  })

//get all lists
mailchimp.lists.getAll()
  .then( lists => {
    // result lists
  })
  .catch( e => {
    // result e
  })
```

#### CREATE
```javascript
mailchimp.lists.create({
    name: <list_name>,
    contact: <contact>,
        ....
    })
    .then( list => {
        // result list
    })
    .catch( e => {
        // result e
    })
```
#### UPDATE
```javascript
let body = {
    name: <list_name>
    campaign_defaults: <campaign_defaults>
    .....
};
mailchimp.lists.update(<list_id>, body)
    .then( list => {
        // result lists
    })
    .catch( e => {
        // result e
    })
```

#### REMOVE
```javascript
mailchimp.lists.remove(<list_id>)
    .then( response => {
        // result response
    })
    .catch( e => {
        // result e
    })
```


## Interests

#### GET
```javascript
// Get information about a list’s interest categories
mailchimp.interests.getAll(<list_id>)
  .then( interests => {
    // result interests
  })
  .catch( e => {
    // result e
  })

//Get information about a specific interest category
mailchimp.interests.get(<list_id>, <interests_id>)
  .then( interest => {
    // result interest
  })
  .catch( e => {
    // result e
  })

```

#### UPDATE
```javascript
let body = {
    title: <interests_title>
    .....
};
mailchimp.interests.update(<list_id>, <interests_id>, body)
    .then( interest => {
        // result interest
    })
    .catch( e => {
        // result e
    })
```

#### REMOVE
```javascript
mailchimp.interests.remove(<list_id>, <interests_id>)
    .then( response => {
        // result response
    })
    .catch( e => {
        // result e
    })
```

---
_Source: https://npm.io/package/mailchimp-api-3 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
