Skip to content

Latest commit

 

History

History
426 lines (331 loc) · 13.6 KB

File metadata and controls

426 lines (331 loc) · 13.6 KB

brevo_csharp.Api.WebhooksApi

All URIs are relative to https://api.brevo.com/v3

Method HTTP request Description
CreateWebhook POST /webhooks Create a webhook
DeleteWebhook DELETE /webhooks/{webhookId} Delete a webhook
ExportWebhooksHistory POST /webhooks/export Export all webhook events
GetWebhook GET /webhooks/{webhookId} Get a webhook details
GetWebhooks GET /webhooks Get all webhooks
UpdateWebhook PUT /webhooks/{webhookId} Update a webhook

CreateWebhook

CreateModel CreateWebhook (CreateWebhook createWebhook)

Create a webhook

Example

using System;
using System.Diagnostics;
using brevo_csharp.Api;
using brevo_csharp.Client;
using brevo_csharp.Model;

namespace Example
{
    public class CreateWebhookExample
    {
        public void main()
        {
            // Configure API key authorization: api-key
            Configuration.Default.AddApiKey("api-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("api-key", "Bearer");
            // Configure API key authorization: partner-key
            Configuration.Default.AddApiKey("partner-key", "YOUR_PARTNER_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("partner-key", "Bearer");

            var apiInstance = new WebhooksApi();
            var createWebhook = new CreateWebhook(); // CreateWebhook | Values to create a webhook

            try
            {
                // Create a webhook
                CreateModel result = apiInstance.CreateWebhook(createWebhook);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling WebhooksApi.CreateWebhook: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
createWebhook CreateWebhook Values to create a webhook

Return type

CreateModel

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeleteWebhook

void DeleteWebhook (long? webhookId)

Delete a webhook

Example

using System;
using System.Diagnostics;
using brevo_csharp.Api;
using brevo_csharp.Client;
using brevo_csharp.Model;

namespace Example
{
    public class DeleteWebhookExample
    {
        public void main()
        {
            // Configure API key authorization: api-key
            Configuration.Default.AddApiKey("api-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("api-key", "Bearer");
            // Configure API key authorization: partner-key
            Configuration.Default.AddApiKey("partner-key", "YOUR_PARTNER_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("partner-key", "Bearer");

            var apiInstance = new WebhooksApi();
            var webhookId = 789;  // long? | Id of the webhook

            try
            {
                // Delete a webhook
                apiInstance.DeleteWebhook(webhookId);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling WebhooksApi.DeleteWebhook: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
webhookId long? Id of the webhook

Return type

void (empty response body)

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ExportWebhooksHistory

CreatedProcessId ExportWebhooksHistory (ExportWebhooksHistory exportWebhookHistory)

Export all webhook events

This endpoint will submit a request to get the history of webhooks in the CSV file. The link to download the CSV file will be sent to the webhook that was provided in the notifyURL.

Example

using System;
using System.Diagnostics;
using brevo_csharp.Api;
using brevo_csharp.Client;
using brevo_csharp.Model;

namespace Example
{
    public class ExportWebhooksHistoryExample
    {
        public void main()
        {
            // Configure API key authorization: api-key
            Configuration.Default.AddApiKey("api-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("api-key", "Bearer");
            // Configure API key authorization: partner-key
            Configuration.Default.AddApiKey("partner-key", "YOUR_PARTNER_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("partner-key", "Bearer");

            var apiInstance = new WebhooksApi();
            var exportWebhookHistory = new ExportWebhooksHistory(); // ExportWebhooksHistory | Values to submit for webhooks history

            try
            {
                // Export all webhook events
                CreatedProcessId result = apiInstance.ExportWebhooksHistory(exportWebhookHistory);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling WebhooksApi.ExportWebhooksHistory: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
exportWebhookHistory ExportWebhooksHistory Values to submit for webhooks history

Return type

CreatedProcessId

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetWebhook

GetWebhook GetWebhook (long? webhookId)

Get a webhook details

Example

using System;
using System.Diagnostics;
using brevo_csharp.Api;
using brevo_csharp.Client;
using brevo_csharp.Model;

namespace Example
{
    public class GetWebhookExample
    {
        public void main()
        {
            // Configure API key authorization: api-key
            Configuration.Default.AddApiKey("api-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("api-key", "Bearer");
            // Configure API key authorization: partner-key
            Configuration.Default.AddApiKey("partner-key", "YOUR_PARTNER_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("partner-key", "Bearer");

            var apiInstance = new WebhooksApi();
            var webhookId = 789;  // long? | Id of the webhook

            try
            {
                // Get a webhook details
                GetWebhook result = apiInstance.GetWebhook(webhookId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling WebhooksApi.GetWebhook: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
webhookId long? Id of the webhook

Return type

GetWebhook

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetWebhooks

GetWebhooks GetWebhooks (string type = null, string sort = null)

Get all webhooks

Example

using System;
using System.Diagnostics;
using brevo_csharp.Api;
using brevo_csharp.Client;
using brevo_csharp.Model;

namespace Example
{
    public class GetWebhooksExample
    {
        public void main()
        {
            // Configure API key authorization: api-key
            Configuration.Default.AddApiKey("api-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("api-key", "Bearer");
            // Configure API key authorization: partner-key
            Configuration.Default.AddApiKey("partner-key", "YOUR_PARTNER_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("partner-key", "Bearer");

            var apiInstance = new WebhooksApi();
            var type = type_example;  // string | Filter on webhook type (optional)  (default to transactional)
            var sort = sort_example;  // string | Sort the results in the ascending/descending order of webhook creation (optional)  (default to desc)

            try
            {
                // Get all webhooks
                GetWebhooks result = apiInstance.GetWebhooks(type, sort);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling WebhooksApi.GetWebhooks: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
type string Filter on webhook type [optional] [default to transactional]
sort string Sort the results in the ascending/descending order of webhook creation [optional] [default to desc]

Return type

GetWebhooks

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UpdateWebhook

void UpdateWebhook (long? webhookId, UpdateWebhook updateWebhook)

Update a webhook

Example

using System;
using System.Diagnostics;
using brevo_csharp.Api;
using brevo_csharp.Client;
using brevo_csharp.Model;

namespace Example
{
    public class UpdateWebhookExample
    {
        public void main()
        {
            // Configure API key authorization: api-key
            Configuration.Default.AddApiKey("api-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("api-key", "Bearer");
            // Configure API key authorization: partner-key
            Configuration.Default.AddApiKey("partner-key", "YOUR_PARTNER_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("partner-key", "Bearer");

            var apiInstance = new WebhooksApi();
            var webhookId = 789;  // long? | Id of the webhook
            var updateWebhook = new UpdateWebhook(); // UpdateWebhook | Values to update a webhook

            try
            {
                // Update a webhook
                apiInstance.UpdateWebhook(webhookId, updateWebhook);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling WebhooksApi.UpdateWebhook: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
webhookId long? Id of the webhook
updateWebhook UpdateWebhook Values to update a webhook

Return type

void (empty response body)

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]