Skip to content

Latest commit

 

History

History
67 lines (48 loc) · 3.43 KB

File metadata and controls

67 lines (48 loc) · 3.43 KB

Subscribers.Notifications

Overview

Available Operations

getUnseenCount

Retrieve unseen in-app (inbox) notifications count for a subscriber by its unique key identifier subscriberId.

Example Usage

package hello.world;

import co.novu.Novu;
import co.novu.models.errors.ErrorDto;
import co.novu.models.errors.ValidationErrorDto;
import co.novu.models.operations.SubscribersV1ControllerGetUnseenCountResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws ErrorDto, ValidationErrorDto, Exception {

        Novu sdk = Novu.builder()
                .secretKey("YOUR_SECRET_KEY_HERE")
            .build();

        SubscribersV1ControllerGetUnseenCountResponse res = sdk.subscribers().notifications().getUnseenCount()
                .subscriberId("<id>")
                .seen(false)
                .limit(100d)
                .call();

        if (res.unseenCountResponse().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description
subscriberId String ✔️ N/A
seen Optional<Boolean> Indicates whether to count seen notifications.
limit Optional<Double> The maximum number of notifications to return.
idempotencyKey Optional<String> A header for idempotency purposes

Response

SubscribersV1ControllerGetUnseenCountResponse

Errors

Error Type Status Code Content Type
models/errors/ErrorDto 414 application/json
models/errors/ErrorDto 400, 401, 403, 404, 405, 409, 413, 415 application/json
models/errors/ValidationErrorDto 422 application/json
models/errors/ErrorDto 500 application/json
models/errors/APIException 4XX, 5XX */*