{"id":37019649,"url":"https://github.com/banana-j/bananaj","last_synced_at":"2026-01-14T02:11:21.755Z","repository":{"id":53673662,"uuid":"50570597","full_name":"banana-j/bananaj","owner":"banana-j","description":"Java API wrapper for MailChimp API 3.0","archived":false,"fork":false,"pushed_at":"2024-06-05T21:10:03.000Z","size":2651,"stargazers_count":38,"open_issues_count":4,"forks_count":33,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-07-04T19:16:15.817Z","etag":null,"topics":["api-wrapper","java","java-wrapper","mailchimp"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/banana-j.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-01-28T09:07:54.000Z","updated_at":"2024-09-12T17:46:56.000Z","dependencies_parsed_at":"2024-05-16T05:28:43.023Z","dependency_job_id":"679991bb-68cc-4c0d-8967-49b4bfbcc745","html_url":"https://github.com/banana-j/bananaj","commit_stats":null,"previous_names":["alexanderwe/bananaj"],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/banana-j/bananaj","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/banana-j%2Fbananaj","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/banana-j%2Fbananaj/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/banana-j%2Fbananaj/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/banana-j%2Fbananaj/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/banana-j","download_url":"https://codeload.github.com/banana-j/bananaj/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/banana-j%2Fbananaj/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408711,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["api-wrapper","java","java-wrapper","mailchimp"],"created_at":"2026-01-14T02:11:21.082Z","updated_at":"2026-01-14T02:11:21.733Z","avatar_url":"https://github.com/banana-j.png","language":"Java","funding_links":[],"categories":["邮件库"],"sub_categories":["文件同步"],"readme":"# bananaj\nSimple api for accessing Mailchimp - Work in progess\n\n[![GitHub license](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://raw.githubusercontent.com/gr4h4n/bananaj/master/LICENSE.md)\n\n# Introduction\n\nbananaj provides a Java wrapper for the MailChimp API 3.0. It is possible programmatically access most MailChimp features such as managing audiences, generate campaigns, and get report data.\n\n# How to use\n\n## Add to your project \nThis is still in alpha. Some of the methods and models are subject to change in future builds. If you encounter some bugs or issues, please feel free to report them to the [Issues section](https://github.com/banana-j/bananaj/issues).\n\nAdd this dependency to your pom.xml to use **bananaj** in your project.\n```\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.banana-j\u003c/groupId\u003e\n  \u003cartifactId\u003ebananaj\u003c/artifactId\u003e\n  \u003cversion\u003e0.7.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\nor with Gradle\n\n``` \nrepositories {\n    maven { url \"http://repo.maven.apache.org/maven2\" }\n}\n\ndependencies {\n    compile group: 'com.github.banana-j', name: 'bananaj', version: '0.7.0'\n}\n```\n\nIf you are not using Maven or Gradle you can download the latest `fat jar` from the [releases section](https://github.com/banana-j/bananaj/releases).\n\n## Obtain an API key\nLogin to your Mailchimp account and access you account information. Navigate to API keys located under extras and create a key.\n\n## Connect to Mailchimp\nFirst establish a connection with the Mailchimp server.\n\n```\nMailChimpConnection con = new MailChimpConnection(\"yourAPIkey\");\n\n// Test connection\nboolean ping = con.ping();\nSystem.out.println(\"API Ping: \" + (ping ? \"succeed\" : \"failed\"));\n```\n\n## Access your campaigns\n\n```\n// Print info for all campaigns with report and feedback\n    System.out.println(\"Mailchimp Campaigns:\");\n    con.getCampaigns().forEach(campaign -\u003e {\n        System.out.println(campaign.toString());\n\n        Report report = campaign.getReport();\n        System.out.println(report.toString());\n\n        List\u003cCampaignFeedback\u003e feedback = campaign.getFeedback().forEach(feedback -\u003e {\n            System.out.println(feedback.toString());\n        });;\n        \n        System.out.println(\"\");\n    });\n    System.out.println(\"\");\n```\n\n## Access your audiences\n```\n// Print info for all audiences. Note that in the API an audience is called a list.\n    System.out.println(\"Mailchimp audiences:\");\n    con.getLists().forEach(audiance -\u003e {\n        System.out.println(audiance.toString());\n        System.out.println(\"\");\n    });\n    System.out.println(\"\");\n\n// Get a single audience\n    MailChimpList yourList = con.getList(\"ListID\");\n\n// Add a member to an audience\n\n```\n\n## Get Members\n```\n// Get all members from a specific mailChimpList\n    yourList.getMembers().forEach(member -\u003e {\n        System.out.println(member.toString());\n    });\n\n// You can also get a specific member by specifying their email address or subscriber hash\n    Member memberOfList = yourList.getMember(\"name@domain.com\");\n```\n\n## Add/Update list subscriber\n```\n    Member member = new Member.Builder()\n            .connection(con)\n            .listId(yourList.getId())\n            .emailAddress(\"name@domain.com\")\n            .emailType(EmailType.HTML)\n            .status(MemberStatus.SUBSCRIBED)\n            .mergeField(\"FNAME\", \"John\")\n            .mergeField(\"LNAME\", \"Smith\")\n            .language(\"en\")\n            .vip(false)\n            .build();\n    member.addOrUpdate();\n```\n\n\n## Create campaign\nTo create an email template simply specify a template name and the upload the pure html code to MailChimp\n```\n    CampaignRecipients mailRecipients = new CampaignRecipients.Builder()\n        .listId(yourList.getId())\n        .build();\n    // -or- use new CampaignRecipients(Segment) to target by tag or interest group\n    CampaignSettings settings = new CampaignSettings.Builder()\n            .title(\"myTitle\")\n            .subjectLine(\"mySubject\")\n            .toName(\"*|FNAME|*\")\n            .fromName(\"myRobot\")\n            .replyTo(\"myEmail@my.domain.com\")\n            .templateId(12345)\n            .folderId(\"12345\")\n            .build();\n    Campaign campaign = con.createCampaign(CampaignType.REGULAR, myList, settings);\n    // campaign.getContent().changeHTMLContent(htmlContent);  // if we don't use a template specify our own HTML content\n    campaign.send();\n    \n    // TODO: show how to create campaign targeted to a tag segment.\n```\n\n\n## Upload a file to FileManager\nMailChimp offers the opportunity to insert images and other files to your emails. To upload a file to MailChimp create a FileManager and specify the file you want to upload.\n```\n// Upload a file\n    FileManagerFile myFile = con.getFileManager().upload(\"filename\", myFile);\n  \n// Upload a file to a folder\n    FileManagerFile myFile = con.getFileManager().upload(\"folder_id\", \"filename\", myFile);\n```\n\n## Example programs\n* [chimpexcel](https://github.com/gscriver/chimpexcel) A sample Java program to export Mailchimp audiences to file (XLS).\n\n\n## Methods\nEvery endpoint supports GET, POST, and DELETE requests. So it is possible to fully control your MailChimp objects with this wrapper. \n\n### Endpoints used\n\n- **\"https://\"+server+\".api.mailchimp.com/3.0/\"**\n- **\"https://\"+server+\".api.mailchimp.com/3.0/automations\"**\n- **\"https://\"+server+\".api.mailchimp.com/3.0/batches\"**\n- **\"https://\"+server+\".api.mailchimp.com/3.0/campaign-folders\"**\n- **\"https://\"+server+\".api.mailchimp.com/3.0/campaigns\"**\n- **\"https://\"+server+\".api.mailchimp.com/3.0/file-manager/files\"**\n- **\"https://\"+server+\".api.mailchimp.com/3.0/file-manager/folders\"**\n- **\"https://\"+server+\".api.mailchimp.com/3.0/file-manager/reports\"**\n- **\"https://\"+server+\".api.mailchimp.com/3.0/lists\"**\n- **\"https://\"+server+\".api.mailchimp.com/3.0/reports\"**\n- **\"https://\"+server+\".api.mailchimp.com/3.0/template-folders\"**\n- **\"https://\"+server+\".api.mailchimp.com/3.0/templates\"**\n\n# To do \n- Add missing edit function to the different endpoints \n\n# Contributors\n \nThanks a lot to all contributors:\n\n* [alexanderwe](https://github.com/alexanderwe)\n* [gscriver](https://github.com/gscriver)\n* [bphilipnyc](https://github.com/bphilipnyc)\n* [icu222much](https://github.com/icu222much)\n\n# License\nThe MIT License (MIT)\n\nCopyright (c) 2015 - 2020 Alexander Weiß\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 all\ncopies 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 THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbanana-j%2Fbananaj","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbanana-j%2Fbananaj","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbanana-j%2Fbananaj/lists"}