This is a Node.js + Express REST API that allows users to connect to and retrieve data from their Mailchimp and GetResponse accounts. It also integrates MongoDB for storing user ESP API keys.
- Save & validate ESP API keys (Mailchimp / GetResponse)
- Verify connection to ESPs
- Fetch lists / audiences from ESPs
- Error handling for invalid credentials, network issues, and rate limits
- MongoDB integration for persistence
esp-integration-api/
│── src/
│ ├── app.js # Main entry point
│ ├── routes/ # API routes
│ ├── controllers/ # Business logic
│ ├── services/ # Mailchimp / GetResponse API handling
│ └── models/ # MongoDB schemas
│── .env # Environment variables
│── package.json
│── README.md
-
Clone the repository:
git clone https://github.com/<your-username>/esp-integration-api.git cd esp-integration-api
-
Install dependencies:
npm install
-
Create a
.envfile in the root directory:PORT=5000 MONGO_URI=mongodb+srv://<username>:<password>@cluster0.mongodb.net/
-
Start the server:
npm start
The API will be running at: 👉
http://localhost:5000
POST /api/integrations/esp
Request body:
{
"userId": "12345",
"esp": "mailchimp",
"apiKey": "your-mailchimp-api-key"
}GET /api/integrations/esp/lists?userId=12345&esp=mailchimp
Response:
{
"lists": [
{
"id": "34ab60ee42",
"name": "techsolve",
"member_count": 1
}
]
}- Node.js + Express
- MongoDB (Mongoose)
- Mailchimp API
- GetResponse API
- dotenv for env configs