Skip to content

Latest commit

 

History

History
176 lines (119 loc) · 10.8 KB

File metadata and controls

176 lines (119 loc) · 10.8 KB

SubscribersPreferences

(subscribersPreferences)

Overview

Available Operations

retrieve

Get subscriber global and workflow specific preferences

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use novu;

$sdk = novu\Novu::builder()
    ->setSecurity(
        '<YOUR_API_KEY_HERE>'
    )
    ->build();



$response = $sdk->subscribersPreferences->retrieve(
    subscriberId: '<id>',
    idempotencyKey: '<value>'

);

if ($response->getSubscriberPreferencesDto !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
subscriberId string ✔️ N/A
idempotencyKey ?string A header for idempotency purposes

Response

?Operations\SubscribersControllerGetSubscriberPreferencesResponse

Errors

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

listLegacy

Get subscriber preferences

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use novu;

$sdk = novu\Novu::builder()
    ->setSecurity(
        '<YOUR_API_KEY_HERE>'
    )
    ->build();



$response = $sdk->subscribersPreferences->listLegacy(
    subscriberId: '<id>',
    includeInactiveChannels: false,
    idempotencyKey: '<value>'

);

if ($response->updateSubscriberPreferenceResponseDtos !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
subscriberId string ✔️ N/A
includeInactiveChannels ?bool A flag which specifies if the inactive workflow channels should be included in the retrieved preferences. Default is true
idempotencyKey ?string A header for idempotency purposes

Response

?Operations\SubscribersV1ControllerListSubscriberPreferencesResponse

Errors

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

updateGlobal

Update subscriber global preferences

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use novu;
use novu\Models\Components;

$sdk = novu\Novu::builder()
    ->setSecurity(
        '<YOUR_API_KEY_HERE>'
    )
    ->build();

$updateSubscriberGlobalPreferencesRequestDto = new Components\UpdateSubscriberGlobalPreferencesRequestDto();

$response = $sdk->subscribersPreferences->updateGlobal(
    subscriberId: '<id>',
    updateSubscriberGlobalPreferencesRequestDto: $updateSubscriberGlobalPreferencesRequestDto,
    idempotencyKey: '<value>'

);

if ($response->updateSubscriberPreferenceGlobalResponseDto !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
subscriberId string ✔️ N/A
updateSubscriberGlobalPreferencesRequestDto Components\UpdateSubscriberGlobalPreferencesRequestDto ✔️ N/A
idempotencyKey ?string A header for idempotency purposes

Response

?Operations\SubscribersV1ControllerUpdateSubscriberGlobalPreferencesResponse

Errors

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