Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Extending API

basiliscus edited this page Oct 25, 2013 · 10 revisions

Currently Ecwid-mailchimp itself has wrappers for a limited number of MailChimp API methods only. However, it is very easy to extend the API and add support for any method you need:

  1. Create a subclass of MailChimpMethod.

  2. Mark the class with the MailChimpMethod.Method annotation. The annotation specifies the corresponding MailChimp API method name and the API version to be used to execute the method.

  3. Add necessary fields to your class and mark them with the MailChimpObject.Field annotation.

To understand it better, have a look at an existing method implementation, for example lists/batch-subscribe.

Contributions are welcome!

Integration tests

Contributors are encouraged (not required though) to write integration tests proving that the API methods they implement work as expected.

In order to run the existing tests it should be enough to do the following:

  1. Add the following properties to '~/.m2/settings.xml':

                     <properties>
                             <mailchimp.test.apikey>*******</mailchimp.test.apikey>
                             <mailchimp.test.listid>*******</mailchimp.test.listid>
                     </properties>
    
  2. Run the tests using the following command line:

    mvn test

Clone this wiki locally