Skip to content

Latest commit

 

History

History
313 lines (212 loc) · 14.2 KB

File metadata and controls

313 lines (212 loc) · 14.2 KB

FormanceWebhooksV1

(Webhooks.V1)

Overview

Available Operations

GetManyConfigs

Sorted by updated date descending

Example Usage

using formance;
using formance.Models.Requests;
using formance.Models.Components;

var sdk = new Formance(security: new Security() {
    ClientID = "<YOUR_CLIENT_ID_HERE>",
    ClientSecret = "<YOUR_CLIENT_SECRET_HERE>",
});

var res = await sdk.Webhooks.V1.GetManyConfigsAsync(
    id: "4997257d-dfb6-445b-929c-cbe2ab182818",
    endpoint: "https://example.com"
);

// handle response

Parameters

Parameter Type Required Description Example
Id string Optional filter by Config ID 4997257d-dfb6-445b-929c-cbe2ab182818
Endpoint string Optional filter by endpoint URL https://example.com

Response

GetManyConfigsResponse

Errors

Error Type Status Code Content Type
formance.Models.Errors.WebhooksErrorResponse default application/json
formance.Models.Errors.SDKException 4XX, 5XX */*

InsertConfig

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

using formance;
using formance.Models.Components;
using System.Collections.Generic;

var sdk = new Formance(security: new Security() {
    ClientID = "<YOUR_CLIENT_ID_HERE>",
    ClientSecret = "<YOUR_CLIENT_SECRET_HERE>",
});

ConfigUser req = new ConfigUser() {
    Name = "customer_payment",
    Endpoint = "https://example.com",
    Secret = "V0bivxRWveaoz08afqjU6Ko/jwO0Cb+3",
    EventTypes = new List<string>() {
        "TYPE1",
        "TYPE2",
    },
};

var res = await sdk.Webhooks.V1.InsertConfigAsync(req);

// handle response

Parameters

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

Response

InsertConfigResponse

Errors

Error Type Status Code Content Type
formance.Models.Errors.WebhooksErrorResponse default application/json
formance.Models.Errors.SDKException 4XX, 5XX */*

DeleteConfig

Delete a webhooks config by ID.

Example Usage

using formance;
using formance.Models.Requests;
using formance.Models.Components;

var sdk = new Formance(security: new Security() {
    ClientID = "<YOUR_CLIENT_ID_HERE>",
    ClientSecret = "<YOUR_CLIENT_SECRET_HERE>",
});

var res = await sdk.Webhooks.V1.DeleteConfigAsync(id: "4997257d-dfb6-445b-929c-cbe2ab182818");

// handle response

Parameters

Parameter Type Required Description Example
Id string ✔️ Config ID 4997257d-dfb6-445b-929c-cbe2ab182818

Response

DeleteConfigResponse

Errors

Error Type Status Code Content Type
formance.Models.Errors.WebhooksErrorResponse default application/json
formance.Models.Errors.SDKException 4XX, 5XX */*

TestConfig

Test a config by sending a webhook to its endpoint.

Example Usage

using formance;
using formance.Models.Requests;
using formance.Models.Components;

var sdk = new Formance(security: new Security() {
    ClientID = "<YOUR_CLIENT_ID_HERE>",
    ClientSecret = "<YOUR_CLIENT_SECRET_HERE>",
});

var res = await sdk.Webhooks.V1.TestConfigAsync(id: "4997257d-dfb6-445b-929c-cbe2ab182818");

// handle response

Parameters

Parameter Type Required Description Example
Id string ✔️ Config ID 4997257d-dfb6-445b-929c-cbe2ab182818

Response

TestConfigResponse

Errors

Error Type Status Code Content Type
formance.Models.Errors.WebhooksErrorResponse default application/json
formance.Models.Errors.SDKException 4XX, 5XX */*

ActivateConfig

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

Example Usage

using formance;
using formance.Models.Requests;
using formance.Models.Components;

var sdk = new Formance(security: new Security() {
    ClientID = "<YOUR_CLIENT_ID_HERE>",
    ClientSecret = "<YOUR_CLIENT_SECRET_HERE>",
});

var res = await sdk.Webhooks.V1.ActivateConfigAsync(id: "4997257d-dfb6-445b-929c-cbe2ab182818");

// handle response

Parameters

Parameter Type Required Description Example
Id string ✔️ Config ID 4997257d-dfb6-445b-929c-cbe2ab182818

Response

ActivateConfigResponse

Errors

Error Type Status Code Content Type
formance.Models.Errors.WebhooksErrorResponse default application/json
formance.Models.Errors.SDKException 4XX, 5XX */*

DeactivateConfig

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

Example Usage

using formance;
using formance.Models.Requests;
using formance.Models.Components;

var sdk = new Formance(security: new Security() {
    ClientID = "<YOUR_CLIENT_ID_HERE>",
    ClientSecret = "<YOUR_CLIENT_SECRET_HERE>",
});

var res = await sdk.Webhooks.V1.DeactivateConfigAsync(id: "4997257d-dfb6-445b-929c-cbe2ab182818");

// handle response

Parameters

Parameter Type Required Description Example
Id string ✔️ Config ID 4997257d-dfb6-445b-929c-cbe2ab182818

Response

DeactivateConfigResponse

Errors

Error Type Status Code Content Type
formance.Models.Errors.WebhooksErrorResponse default application/json
formance.Models.Errors.SDKException 4XX, 5XX */*

ChangeConfigSecret

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

using formance;
using formance.Models.Requests;
using formance.Models.Components;

var sdk = new Formance(security: new Security() {
    ClientID = "<YOUR_CLIENT_ID_HERE>",
    ClientSecret = "<YOUR_CLIENT_SECRET_HERE>",
});

var res = await sdk.Webhooks.V1.ChangeConfigSecretAsync(
    id: "4997257d-dfb6-445b-929c-cbe2ab182818",
    configChangeSecret: new ConfigChangeSecret() {
        Secret = "V0bivxRWveaoz08afqjU6Ko/jwO0Cb+3",
    }
);

// handle response

Parameters

Parameter Type Required Description Example
Id string ✔️ Config ID 4997257d-dfb6-445b-929c-cbe2ab182818
ConfigChangeSecret ConfigChangeSecret N/A

Response

ChangeConfigSecretResponse

Errors

Error Type Status Code Content Type
formance.Models.Errors.WebhooksErrorResponse default application/json
formance.Models.Errors.SDKException 4XX, 5XX */*