Skip to content

Latest commit

 

History

History
239 lines (170 loc) · 16.2 KB

File metadata and controls

239 lines (170 loc) · 16.2 KB

ChannelEndpoints

Overview

Available Operations

  • List - List all channel endpoints
  • Create - Create a channel endpoint
  • Retrieve - Retrieve a channel endpoint
  • Update - Update a channel endpoint
  • Delete - Delete a channel endpoint

List

List all channel endpoints for a resource based on query filters.

Example Usage

using Novu;
using Novu.Models.Components;
using Novu.Models.Requests;
using System.Collections.Generic;

var sdk = new NovuSDK(secretKey: "YOUR_SECRET_KEY_HERE");

ChannelEndpointsControllerListChannelEndpointsRequest req = new ChannelEndpointsControllerListChannelEndpointsRequest() {
    Limit = 10D,
    SubscriberId = "subscriber-123",
    ContextKeys = new List<string>() {
        "tenant:org-123",
        "region:us-east-1",
    },
    ProviderId = ProvidersIdEnum.Slack,
    IntegrationIdentifier = "slack-prod",
    ConnectionIdentifier = "slack-connection-abc123",
};

var res = await sdk.ChannelEndpoints.ListAsync(req);

// handle response

Parameters

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

Response

ChannelEndpointsControllerListChannelEndpointsResponse

Errors

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

Create

Create a new channel endpoint for a resource.

Example Usage

using Novu;
using Novu.Models.Components;
using Novu.Models.Requests;

var sdk = new NovuSDK(secretKey: "YOUR_SECRET_KEY_HERE");

var res = await sdk.ChannelEndpoints.CreateAsync(requestBody: ChannelEndpointsControllerCreateChannelEndpointRequestBody.CreateSlackChannel(
    new CreateSlackChannelEndpointDto() {
        SubscriberId = "subscriber-123",
        IntegrationIdentifier = "slack-prod",
        Type = CreateSlackChannelEndpointDtoType.SlackChannel,
        Endpoint = new SlackChannelEndpointDto() {
            ChannelId = "C123456789",
        },
    }
));

// handle response

Parameters

Parameter Type Required Description
RequestBody ChannelEndpointsControllerCreateChannelEndpointRequestBody ✔️ Channel endpoint creation request. The structure varies based on the type field.
IdempotencyKey string A header for idempotency purposes

Response

ChannelEndpointsControllerCreateChannelEndpointResponse

Errors

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

Retrieve

Retrieve a specific channel endpoint by its unique identifier.

Example Usage

using Novu;
using Novu.Models.Components;

var sdk = new NovuSDK(secretKey: "YOUR_SECRET_KEY_HERE");

var res = await sdk.ChannelEndpoints.RetrieveAsync(identifier: "<value>");

// handle response

Parameters

Parameter Type Required Description
Identifier string ✔️ The unique identifier of the channel endpoint
IdempotencyKey string A header for idempotency purposes

Response

ChannelEndpointsControllerGetChannelEndpointResponse

Errors

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

Update

Update an existing channel endpoint by its unique identifier.

Example Usage

using Novu;
using Novu.Models.Components;

var sdk = new NovuSDK(secretKey: "YOUR_SECRET_KEY_HERE");

var res = await sdk.ChannelEndpoints.UpdateAsync(
    identifier: "<value>",
    updateChannelEndpointRequestDto: new UpdateChannelEndpointRequestDto() {
        Endpoint = UpdateChannelEndpointRequestDtoEndpoint.CreateSlackUserEndpointDto(
            new SlackUserEndpointDto() {
                UserId = "U123456789",
            }
        ),
    }
);

// handle response

Parameters

Parameter Type Required Description
Identifier string ✔️ The unique identifier of the channel endpoint
UpdateChannelEndpointRequestDto UpdateChannelEndpointRequestDto ✔️ N/A
IdempotencyKey string A header for idempotency purposes

Response

ChannelEndpointsControllerUpdateChannelEndpointResponse

Errors

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

Delete

Delete a specific channel endpoint by its unique identifier.

Example Usage

using Novu;
using Novu.Models.Components;

var sdk = new NovuSDK(secretKey: "YOUR_SECRET_KEY_HERE");

var res = await sdk.ChannelEndpoints.DeleteAsync(identifier: "<value>");

// handle response

Parameters

Parameter Type Required Description
Identifier string ✔️ The unique identifier of the channel endpoint
IdempotencyKey string A header for idempotency purposes

Response

ChannelEndpointsControllerDeleteChannelEndpointResponse

Errors

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