Skip to content

Latest commit

 

History

History
351 lines (237 loc) · 15 KB

File metadata and controls

351 lines (237 loc) · 15 KB

SDKWebhooksV1

(webhooks.v1)

Overview

Available Operations

activate_config

Activate a webhooks config by ID, to start receiving webhooks to its endpoint.

Example Usage

import sdk
from sdk.models import operations, shared

s = sdk.SDK(
    security=shared.Security(
        client_id="<YOUR_CLIENT_ID_HERE>",
        client_secret="<YOUR_CLIENT_SECRET_HERE>",
    ),
)


res = s.webhooks.v1.activate_config(request=operations.ActivateConfigRequest(
    id='4997257d-dfb6-445b-929c-cbe2ab182818',
))

if res.config_response is not None:
    # handle response
    pass

Parameters

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

Response

operations.ActivateConfigResponse

Errors

Error Type Status Code Content Type
errors.WebhooksErrorResponse default application/json
errors.SDKError 4XX, 5XX */*

change_config_secret

Change the signing secret of the endpoint of a webhooks config.

If not passed or empty, a secret is automatically generated. The format is a random string of bytes of size 24, base64 encoded. (larger size after encoding)

Example Usage

import sdk
from sdk.models import operations, shared

s = sdk.SDK(
    security=shared.Security(
        client_id="<YOUR_CLIENT_ID_HERE>",
        client_secret="<YOUR_CLIENT_SECRET_HERE>",
    ),
)


res = s.webhooks.v1.change_config_secret(request=operations.ChangeConfigSecretRequest(
    id='4997257d-dfb6-445b-929c-cbe2ab182818',
    config_change_secret=shared.ConfigChangeSecret(
        secret='V0bivxRWveaoz08afqjU6Ko/jwO0Cb+3',
    ),
))

if res.config_response is not None:
    # handle response
    pass

Parameters

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

Response

operations.ChangeConfigSecretResponse

Errors

Error Type Status Code Content Type
errors.WebhooksErrorResponse default application/json
errors.SDKError 4XX, 5XX */*

deactivate_config

Deactivate a webhooks config by ID, to stop receiving webhooks to its endpoint.

Example Usage

import sdk
from sdk.models import operations, shared

s = sdk.SDK(
    security=shared.Security(
        client_id="<YOUR_CLIENT_ID_HERE>",
        client_secret="<YOUR_CLIENT_SECRET_HERE>",
    ),
)


res = s.webhooks.v1.deactivate_config(request=operations.DeactivateConfigRequest(
    id='4997257d-dfb6-445b-929c-cbe2ab182818',
))

if res.config_response is not None:
    # handle response
    pass

Parameters

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

Response

operations.DeactivateConfigResponse

Errors

Error Type Status Code Content Type
errors.WebhooksErrorResponse default application/json
errors.SDKError 4XX, 5XX */*

delete_config

Delete a webhooks config by ID.

Example Usage

import sdk
from sdk.models import operations, shared

s = sdk.SDK(
    security=shared.Security(
        client_id="<YOUR_CLIENT_ID_HERE>",
        client_secret="<YOUR_CLIENT_SECRET_HERE>",
    ),
)


res = s.webhooks.v1.delete_config(request=operations.DeleteConfigRequest(
    id='4997257d-dfb6-445b-929c-cbe2ab182818',
))

if res is not None:
    # handle response
    pass

Parameters

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

Response

operations.DeleteConfigResponse

Errors

Error Type Status Code Content Type
errors.WebhooksErrorResponse default application/json
errors.SDKError 4XX, 5XX */*

get_many_configs

Sorted by updated date descending

Example Usage

import sdk
from sdk.models import operations, shared

s = sdk.SDK(
    security=shared.Security(
        client_id="<YOUR_CLIENT_ID_HERE>",
        client_secret="<YOUR_CLIENT_SECRET_HERE>",
    ),
)


res = s.webhooks.v1.get_many_configs(request=operations.GetManyConfigsRequest(
    endpoint='https://example.com',
    id='4997257d-dfb6-445b-929c-cbe2ab182818',
))

if res.configs_response is not None:
    # handle response
    pass

Parameters

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

Response

operations.GetManyConfigsResponse

Errors

Error Type Status Code Content Type
errors.WebhooksErrorResponse default application/json
errors.SDKError 4XX, 5XX */*

insert_config

Insert a new webhooks config.

The endpoint should be a valid https URL and be unique.

The secret is the endpoint's verification secret. If not passed or empty, a secret is automatically generated. The format is a random string of bytes of size 24, base64 encoded. (larger size after encoding)

All eventTypes are converted to lower-case when inserted.

Example Usage

import sdk
from sdk.models import shared

s = sdk.SDK(
    security=shared.Security(
        client_id="<YOUR_CLIENT_ID_HERE>",
        client_secret="<YOUR_CLIENT_SECRET_HERE>",
    ),
)


res = s.webhooks.v1.insert_config(request=shared.ConfigUser(
    endpoint='https://example.com',
    event_types=[
        'TYPE1',
    ],
    name='customer_payment',
    secret='V0bivxRWveaoz08afqjU6Ko/jwO0Cb+3',
))

if res.config_response is not None:
    # handle response
    pass

Parameters

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

Response

operations.InsertConfigResponse

Errors

Error Type Status Code Content Type
errors.WebhooksErrorResponse default application/json
errors.SDKError 4XX, 5XX */*

test_config

Test a config by sending a webhook to its endpoint.

Example Usage

import sdk
from sdk.models import operations, shared

s = sdk.SDK(
    security=shared.Security(
        client_id="<YOUR_CLIENT_ID_HERE>",
        client_secret="<YOUR_CLIENT_SECRET_HERE>",
    ),
)


res = s.webhooks.v1.test_config(request=operations.TestConfigRequest(
    id='4997257d-dfb6-445b-929c-cbe2ab182818',
))

if res.attempt_response is not None:
    # handle response
    pass

Parameters

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

Response

operations.TestConfigResponse

Errors

Error Type Status Code Content Type
errors.WebhooksErrorResponse default application/json
errors.SDKError 4XX, 5XX */*