(subscribers->credentials)
- delete - Delete subscriber credentials by providerId
- append - Modify subscriber credentials
- update - Update subscriber credentials
Delete subscriber credentials such as slack and expo tokens.
declare(strict_types=1);
require 'vendor/autoload.php';
use novu;
$sdk = novu\Novu::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
$response = $sdk->subscribers->credentials->delete(
subscriberId: '<id>',
providerId: '<id>'
);
if ($response->statusCode === 200) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
subscriberId |
string | ✔️ | N/A |
providerId |
string | ✔️ | N/A |
?Operations\SubscribersControllerDeleteSubscriberCredentialsResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\ErrorDto | 400, 404, 409 | application/json |
Errors\ValidationErrorDto | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
Subscriber credentials associated to the delivery methods such as slack and push tokens.
This endpoint appends provided credentials and deviceTokens to the existing ones.
declare(strict_types=1);
require 'vendor/autoload.php';
use novu;
use novu\Models\Components;
$sdk = novu\Novu::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
$updateSubscriberChannelRequestDto = new Components\UpdateSubscriberChannelRequestDto(
providerId: Components\UpdateSubscriberChannelRequestDtoProviderId::Zulip,
credentials: new Components\ChannelCredentials(
webhookUrl: 'https://example.com/webhook',
channel: 'general',
deviceTokens: [
'token1',
'token2',
'token3',
],
alertUid: '12345-abcde',
title: 'Critical Alert',
imageUrl: 'https://example.com/image.png',
state: 'resolved',
externalUrl: 'https://example.com/details',
),
);
$response = $sdk->subscribers->credentials->append(
subscriberId: '<id>',
updateSubscriberChannelRequestDto: $updateSubscriberChannelRequestDto
);
if ($response->subscriberResponseDto !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
subscriberId |
string | ✔️ | N/A |
updateSubscriberChannelRequestDto |
Components\UpdateSubscriberChannelRequestDto | ✔️ | N/A |
?Operations\SubscribersControllerModifySubscriberChannelResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\ErrorDto | 400, 404, 409 | application/json |
Errors\ValidationErrorDto | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
Subscriber credentials associated to the delivery methods such as slack and push tokens.
declare(strict_types=1);
require 'vendor/autoload.php';
use novu;
use novu\Models\Components;
$sdk = novu\Novu::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
$updateSubscriberChannelRequestDto = new Components\UpdateSubscriberChannelRequestDto(
providerId: Components\UpdateSubscriberChannelRequestDtoProviderId::Pushpad,
credentials: new Components\ChannelCredentials(
webhookUrl: 'https://example.com/webhook',
channel: 'general',
deviceTokens: [
'token1',
'token2',
'token3',
],
alertUid: '12345-abcde',
title: 'Critical Alert',
imageUrl: 'https://example.com/image.png',
state: 'resolved',
externalUrl: 'https://example.com/details',
),
);
$response = $sdk->subscribers->credentials->update(
subscriberId: '<id>',
updateSubscriberChannelRequestDto: $updateSubscriberChannelRequestDto
);
if ($response->subscriberResponseDto !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
subscriberId |
string | ✔️ | N/A |
updateSubscriberChannelRequestDto |
Components\UpdateSubscriberChannelRequestDto | ✔️ | N/A |
?Operations\SubscribersControllerUpdateSubscriberChannelResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\ErrorDto | 400, 404, 409 | application/json |
Errors\ValidationErrorDto | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |