- list - List all channel connections
- create - Create a channel connection
- retrieve - Retrieve a channel connection
- update - Update a channel connection
- delete - Delete a channel connection
List all channel connections for a resource.
declare(strict_types=1);
require 'vendor/autoload.php';
use novu;
use novu\Models\Components;
use novu\Models\Operations;
$sdk = novu\Novu::builder()
->setSecurity(
'YOUR_SECRET_KEY_HERE'
)
->build();
$request = new Operations\ChannelConnectionsControllerListChannelConnectionsRequest(
limit: 10,
subscriberId: 'subscriber-123',
channel: Operations\Channel::Chat,
providerId: Components\ProvidersIdEnum::Slack,
integrationIdentifier: 'slack-prod',
contextKeys: [
'tenant:org-123',
'region:us-east-1',
],
);
$response = $sdk->channelConnections->list(
request: $request
);
if ($response->listChannelConnectionsResponseDto !== null) {
// handle response
}| Parameter | Type | Required | Description |
|---|---|---|---|
$request |
Operations\ChannelConnectionsControllerListChannelConnectionsRequest | ✔️ | The request object to use for the request. |
?Operations\ChannelConnectionsControllerListChannelConnectionsResponse
| 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 | */* |
Create a new channel connection for a resource for given integration. Only one channel connection is allowed per resource and integration.
declare(strict_types=1);
require 'vendor/autoload.php';
use novu;
use novu\Models\Components;
$sdk = novu\Novu::builder()
->setSecurity(
'YOUR_SECRET_KEY_HERE'
)
->build();
$createChannelConnectionRequestDto = new Components\CreateChannelConnectionRequestDto(
identifier: 'slack-prod-user123-abc4',
subscriberId: 'subscriber-123',
context: [
'key' => 'org-acme',
],
connectionMode: Components\ConnectionMode::Shared,
integrationIdentifier: 'slack-prod',
workspace: new Components\WorkspaceDto(
id: 'T123456',
name: 'Acme HQ',
),
auth: new Components\AuthDto(
accessToken: 'Workspace access token',
),
);
$response = $sdk->channelConnections->create(
createChannelConnectionRequestDto: $createChannelConnectionRequestDto
);
if ($response->getChannelConnectionResponseDto !== null) {
// handle response
}| Parameter | Type | Required | Description |
|---|---|---|---|
createChannelConnectionRequestDto |
Components\CreateChannelConnectionRequestDto | ✔️ | N/A |
idempotencyKey |
?string | ➖ | A header for idempotency purposes |
?Operations\ChannelConnectionsControllerCreateChannelConnectionResponse
| 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 | */* |
Retrieve a specific channel connection by its unique identifier.
declare(strict_types=1);
require 'vendor/autoload.php';
use novu;
$sdk = novu\Novu::builder()
->setSecurity(
'YOUR_SECRET_KEY_HERE'
)
->build();
$response = $sdk->channelConnections->retrieve(
identifier: '<value>'
);
if ($response->getChannelConnectionResponseDto !== null) {
// handle response
}| Parameter | Type | Required | Description |
|---|---|---|---|
identifier |
string | ✔️ | The unique identifier of the channel connection |
idempotencyKey |
?string | ➖ | A header for idempotency purposes |
?Operations\ChannelConnectionsControllerGetChannelConnectionByIdentifierResponse
| 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 | */* |
Update an existing channel connection by its unique identifier.
declare(strict_types=1);
require 'vendor/autoload.php';
use novu;
use novu\Models\Components;
$sdk = novu\Novu::builder()
->setSecurity(
'YOUR_SECRET_KEY_HERE'
)
->build();
$updateChannelConnectionRequestDto = new Components\UpdateChannelConnectionRequestDto(
workspace: new Components\WorkspaceDto(
id: 'T123456',
name: 'Acme HQ',
),
auth: new Components\AuthDto(
accessToken: 'Workspace access token',
),
);
$response = $sdk->channelConnections->update(
identifier: '<value>',
updateChannelConnectionRequestDto: $updateChannelConnectionRequestDto
);
if ($response->getChannelConnectionResponseDto !== null) {
// handle response
}| Parameter | Type | Required | Description |
|---|---|---|---|
identifier |
string | ✔️ | The unique identifier of the channel connection |
updateChannelConnectionRequestDto |
Components\UpdateChannelConnectionRequestDto | ✔️ | N/A |
idempotencyKey |
?string | ➖ | A header for idempotency purposes |
?Operations\ChannelConnectionsControllerUpdateChannelConnectionResponse
| 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 | */* |
Delete a specific channel connection by its unique identifier.
declare(strict_types=1);
require 'vendor/autoload.php';
use novu;
$sdk = novu\Novu::builder()
->setSecurity(
'YOUR_SECRET_KEY_HERE'
)
->build();
$response = $sdk->channelConnections->delete(
identifier: '<value>'
);
if ($response->statusCode === 200) {
// handle response
}| Parameter | Type | Required | Description |
|---|---|---|---|
identifier |
string | ✔️ | The unique identifier of the channel connection |
idempotencyKey |
?string | ➖ | A header for idempotency purposes |
?Operations\ChannelConnectionsControllerDeleteChannelConnectionResponse
| 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 | */* |