Skip to content

Latest commit

 

History

History
259 lines (171 loc) · 12.9 KB

README.md

File metadata and controls

259 lines (171 loc) · 12.9 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

list

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

Example Usage

from novu_py import Novu
import os

with Novu(
    api_key=os.getenv("NOVU_API_KEY", ""),
) as novu:

    res = novu.integrations.list()

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.IntegrationsControllerListIntegrationsResponse

Errors

Error Type Status Code Content Type
models.ErrorDto 400, 404, 409 application/json
models.ValidationErrorDto 422 application/json
models.APIError 4XX, 5XX */*

create

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

Example Usage

import novu_py
from novu_py import Novu
import os

with Novu(
    api_key=os.getenv("NOVU_API_KEY", ""),
) as novu:

    res = novu.integrations.create(request={
        "provider_id": "<id>",
        "channel": novu_py.CreateIntegrationRequestDtoChannel.SMS,
    })

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request models.CreateIntegrationRequestDto ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.IntegrationsControllerCreateIntegrationResponse

Errors

Error Type Status Code Content Type
models.ErrorDto 400, 404, 409 application/json
models.ValidationErrorDto 422 application/json
models.APIError 4XX, 5XX */*

list_active

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

Example Usage

from novu_py import Novu
import os

with Novu(
    api_key=os.getenv("NOVU_API_KEY", ""),
) as novu:

    res = novu.integrations.list_active()

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.IntegrationsControllerGetActiveIntegrationsResponse

Errors

Error Type Status Code Content Type
models.ErrorDto 400, 404, 409 application/json
models.ValidationErrorDto 422 application/json
models.APIError 4XX, 5XX */*

update

Update integration

Example Usage

from novu_py import Novu
import os

with Novu(
    api_key=os.getenv("NOVU_API_KEY", ""),
) as novu:

    res = novu.integrations.update(integration_id="<id>", update_integration_request_dto={})

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
integration_id str ✔️ N/A
update_integration_request_dto models.UpdateIntegrationRequestDto ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.IntegrationsControllerUpdateIntegrationByIDResponse

Errors

Error Type Status Code Content Type
models.ErrorDto 400, 409 application/json
models.ValidationErrorDto 422 application/json
models.APIError 4XX, 5XX */*

delete

Delete integration

Example Usage

from novu_py import Novu
import os

with Novu(
    api_key=os.getenv("NOVU_API_KEY", ""),
) as novu:

    res = novu.integrations.delete(integration_id="<id>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
integration_id str ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.IntegrationsControllerRemoveIntegrationResponse

Errors

Error Type Status Code Content Type
models.ErrorDto 400, 404, 409 application/json
models.ValidationErrorDto 422 application/json
models.APIError 4XX, 5XX */*

set_as_primary

Set integration as primary

Example Usage

from novu_py import Novu
import os

with Novu(
    api_key=os.getenv("NOVU_API_KEY", ""),
) as novu:

    res = novu.integrations.set_as_primary(integration_id="<id>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
integration_id str ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.IntegrationsControllerSetIntegrationAsPrimaryResponse

Errors

Error Type Status Code Content Type
models.ErrorDto 400, 409 application/json
models.ValidationErrorDto 422 application/json
models.APIError 4XX, 5XX */*