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";
}
});
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: