Skip to content

Latest commit

 

History

History
335 lines (227 loc) · 15.2 KB

README.md

File metadata and controls

335 lines (227 loc) · 15.2 KB

Integrations

(integrations)

Overview

With the help of the Integration Store, you can easily integrate your favorite delivery provider. During the runtime of the API, the Integrations Store is responsible for storing the configurations of all the providers. https://docs.novu.co/channels-and-providers/integration-store

Available Operations

create

Create an integration for the current environment the user is based on the API key provided

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use novu;
use novu\Models\Components;

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

$createIntegrationRequestDto = new Components\CreateIntegrationRequestDto(
    providerId: '<id>',
    channel: Components\CreateIntegrationRequestDtoChannel::Sms,
);

$response = $sdk->integrations->create(
    createIntegrationRequestDto: $createIntegrationRequestDto,
    idempotencyKey: '<value>'

);

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

Parameters

Parameter Type Required Description
createIntegrationRequestDto Components\CreateIntegrationRequestDto ✔️ N/A
idempotencyKey ?string A header for idempotency purposes

Response

?Operations\IntegrationsControllerCreateIntegrationResponse

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

listActive

Return all the active integrations the user has created for that organization. Review v.0.17.0 changelog for a breaking change

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use novu;

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



$response = $sdk->integrations->listActive(
    idempotencyKey: '<value>'
);

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

Parameters

Parameter Type Required Description
idempotencyKey ?string A header for idempotency purposes

Response

?Operations\IntegrationsControllerGetActiveIntegrationsResponse

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

list

Return all the integrations the user has created for that organization. Review v.0.17.0 changelog for a breaking change

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use novu;

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



$response = $sdk->integrations->list(
    idempotencyKey: '<value>'
);

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

Parameters

Parameter Type Required Description
idempotencyKey ?string A header for idempotency purposes

Response

?Operations\IntegrationsControllerListIntegrationsResponse

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

delete

Delete integration

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use novu;

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



$response = $sdk->integrations->delete(
    integrationId: '<id>',
    idempotencyKey: '<value>'

);

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

Parameters

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

Response

?Operations\IntegrationsControllerRemoveIntegrationResponse

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

setAsPrimary

Set integration as primary

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use novu;

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



$response = $sdk->integrations->setAsPrimary(
    integrationId: '<id>',
    idempotencyKey: '<value>'

);

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

Parameters

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

Response

?Operations\IntegrationsControllerSetIntegrationAsPrimaryResponse

Errors

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

update

Update integration

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use novu;
use novu\Models\Components;

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

$updateIntegrationRequestDto = new Components\UpdateIntegrationRequestDto();

$response = $sdk->integrations->update(
    integrationId: '<id>',
    updateIntegrationRequestDto: $updateIntegrationRequestDto,
    idempotencyKey: '<value>'

);

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

Parameters

Parameter Type Required Description
integrationId string ✔️ N/A
updateIntegrationRequestDto Components\UpdateIntegrationRequestDto ✔️ N/A
idempotencyKey ?string A header for idempotency purposes

Response

?Operations\IntegrationsControllerUpdateIntegrationByIdResponse

Errors

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