(feeds())
Novu provides a notification activity feed that monitors every outgoing message associated with its relevant metadata. This can be used to monitor activity and discover potential issues with a specific provider or a channel type.
https://docs.novu.co/activity-feed
Create feed
package hello.world;
import co.novu.co.novu.sdk.Novu;
import co.novu.co.novu.sdk.models.components.*;
import co.novu.co.novu.sdk.models.components.Security;
import co.novu.co.novu.sdk.models.operations.*;
import co.novu.co.novu.sdk.utils.EventStream;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.Optional;
import org.openapitools.jackson.nullable.JsonNullable;
import static java.util.Map.entry;
public class Application {
public static void main(String[] args) throws Exception {
try {
Novu sdk = Novu.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build();
CreateFeedRequestDto req = CreateFeedRequestDto.builder()
.name("<value>")
.build();
FeedsControllerCreateFeedResponse res = sdk.feeds().create()
.request(req)
.call();
if (res.feedResponseDto().isPresent()) {
// handle response
}
} catch (co.novu.co.novu.sdk.models.errors.SDKError e) {
// handle exception
throw e;
} catch (Exception e) {
// handle exception
throw e;
}
}
}
Parameter | Type | Required | Description |
---|---|---|---|
request |
co.novu.co.novu.sdk.models.components.CreateFeedRequestDto | ✔️ | The request object to use for the request. |
Optional<? extends co.novu.co.novu.sdk.models.operations.FeedsControllerCreateFeedResponse>
Error Object | Status Code | Content Type |
---|---|---|
models/errors/SDKError | 4xx-5xx | / |
Delete feed
package hello.world;
import co.novu.co.novu.sdk.Novu;
import co.novu.co.novu.sdk.models.components.*;
import co.novu.co.novu.sdk.models.components.Security;
import co.novu.co.novu.sdk.models.operations.*;
import co.novu.co.novu.sdk.utils.EventStream;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.Optional;
import org.openapitools.jackson.nullable.JsonNullable;
import static java.util.Map.entry;
public class Application {
public static void main(String[] args) throws Exception {
try {
Novu sdk = Novu.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build();
FeedsControllerDeleteFeedByIdResponse res = sdk.feeds().delete()
.feedId("<value>")
.call();
if (res.feedResponseDtos().isPresent()) {
// handle response
}
} catch (co.novu.co.novu.sdk.models.errors.SDKError e) {
// handle exception
throw e;
} catch (Exception e) {
// handle exception
throw e;
}
}
}
Parameter | Type | Required | Description |
---|---|---|---|
feedId |
String | ✔️ | N/A |
Optional<? extends co.novu.co.novu.sdk.models.operations.FeedsControllerDeleteFeedByIdResponse>
Error Object | Status Code | Content Type |
---|---|---|
models/errors/SDKError | 4xx-5xx | / |
Get feeds
package hello.world;
import co.novu.co.novu.sdk.Novu;
import co.novu.co.novu.sdk.models.components.*;
import co.novu.co.novu.sdk.models.components.Security;
import co.novu.co.novu.sdk.models.operations.*;
import co.novu.co.novu.sdk.utils.EventStream;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.Optional;
import org.openapitools.jackson.nullable.JsonNullable;
import static java.util.Map.entry;
public class Application {
public static void main(String[] args) throws Exception {
try {
Novu sdk = Novu.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build();
FeedsControllerGetFeedsResponse res = sdk.feeds().retrieve()
.call();
if (res.feedResponseDtos().isPresent()) {
// handle response
}
} catch (co.novu.co.novu.sdk.models.errors.SDKError e) {
// handle exception
throw e;
} catch (Exception e) {
// handle exception
throw e;
}
}
}
Optional<? extends co.novu.co.novu.sdk.models.operations.FeedsControllerGetFeedsResponse>
Error Object | Status Code | Content Type |
---|---|---|
models/errors/SDKError | 4xx-5xx | / |