Skip to content

Latest commit

 

History

History
69 lines (49 loc) · 4.19 KB

File metadata and controls

69 lines (49 loc) · 4.19 KB

SubscribersNotifications

Overview

Available Operations

  • getFeed - Retrieve subscriber notifications

getFeed

Retrieve subscriber in-app (inbox) notifications 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.SubscribersV1ControllerGetNotificationsFeedRequest;
import co.novu.models.operations.SubscribersV1ControllerGetNotificationsFeedResponse;
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();

        SubscribersV1ControllerGetNotificationsFeedRequest req = SubscribersV1ControllerGetNotificationsFeedRequest.builder()
                .subscriberId("<id>")
                .page(0d)
                .payload("btoa(JSON.stringify({ foo: 123 })) results in base64 encoded string like eyJmb28iOjEyM30=")
                .build();

        SubscribersV1ControllerGetNotificationsFeedResponse res = sdk.subscribersNotifications().getFeed()
                .request(req)
                .call();

        if (res.feedResponseDto().isPresent()) {
            System.out.println(res.feedResponseDto().get());
        }
    }
}

Parameters

Parameter Type Required Description
request SubscribersV1ControllerGetNotificationsFeedRequest ✔️ The request object to use for the request.

Response

SubscribersV1ControllerGetNotificationsFeedResponse

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 */*