This project is a Java libray to consume the Curated API. It is built with Micronaut and you can use it in a Micronaut app or as a standalone library.

The library exposes methods to consume the endpoints described in the Curated API documentation:

1. Dependency snippet

To use it with Gradle:

implementation 'groovycalamari.curated:curated:0.0.8'

To use it with Maven:

<dependency><groupId>groovycalamari.curated</groupId><artifactId>curated</artifactId><version>0.0.8</version><type>pom</type></dependency>

2. Configuration

If you want to use the library in Micronaut application, you will need to configure your Curated’s publication and api key in the configuration file of your application:

application.yml
curated:
  publication-key: 'XXXX'
  api-key: 'YYYY'

Once, you have the configuration in place, the library registers a bean of type CuratedApi in the Micronaut’s application context.

You can use the library without a Micronaut Application Context. In that case, to obtain a CuratedApi do:

CuratedApi curatedApi = new ManualCuratedApi(new CuratedConfiguration() {
    @Override
    public String getPublicationKey() {
        return "XXXX";
    }

    @Override
    public String getApiKey() {
        return "YYYY";
    }
});

3. Fetch issues

CuratedApi curatedApi;

....

Single<Issues> issues = curatedApi.issues();

4. Fetch single Issue

CuratedApi curatedApi;

....

Single<Issue> issues = curatedApi.issue(1);

5. Add email subscriber

CuratedApi curatedApi;

....

 Single<AddEmailSubscriberResponse> response = curatedApi.addEmailSubscriber(new AddEmailSubscriber("steve@apple.com"));

6. Build

This library uses Gradle. It uses the plugins: