Class WebhooksApi

java.lang.Object
software.xdev.brevo.client.BaseApi
software.xdev.brevo.api.WebhooksApi

public class WebhooksApi extends BaseApi
  • Constructor Details

    • WebhooksApi

      public WebhooksApi()
    • WebhooksApi

      public WebhooksApi(ApiClient apiClient)
  • Method Details

    • createWebhook

      public CreateModel createWebhook(@Nonnull CreateWebhook createWebhook) throws ApiException
      Create a webhook
      Parameters:
      createWebhook - Values to create a webhook (required)
      Returns:
      CreateModel
      Throws:
      ApiException - if fails to make API call
    • createWebhook

      public CreateModel createWebhook(@Nonnull CreateWebhook createWebhook, Map<String,String> additionalHeaders) throws ApiException
      Create a webhook
      Parameters:
      createWebhook - Values to create a webhook (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      CreateModel
      Throws:
      ApiException - if fails to make API call
    • deleteWebhook

      public void deleteWebhook(@Nonnull Long webhookId) throws ApiException
      Delete a webhook
      Parameters:
      webhookId - Id of the webhook (required)
      Throws:
      ApiException - if fails to make API call
    • deleteWebhook

      public void deleteWebhook(@Nonnull Long webhookId, Map<String,String> additionalHeaders) throws ApiException
      Delete a webhook
      Parameters:
      webhookId - Id of the webhook (required)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • exportWebhooksHistory

      public CreatedProcessId exportWebhooksHistory(@Nonnull ExportWebhooksHistory exportWebhooksHistory) throws ApiException
      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.
      Parameters:
      exportWebhooksHistory - Values to submit for webhooks history (required)
      Returns:
      CreatedProcessId
      Throws:
      ApiException - if fails to make API call
    • exportWebhooksHistory

      public CreatedProcessId exportWebhooksHistory(@Nonnull ExportWebhooksHistory exportWebhooksHistory, Map<String,String> additionalHeaders) throws ApiException
      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.
      Parameters:
      exportWebhooksHistory - Values to submit for webhooks history (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      CreatedProcessId
      Throws:
      ApiException - if fails to make API call
    • getWebhook

      public GetWebhook getWebhook(@Nonnull Long webhookId) throws ApiException
      Get a webhook details
      Parameters:
      webhookId - Id of the webhook (required)
      Returns:
      GetWebhook
      Throws:
      ApiException - if fails to make API call
    • getWebhook

      public GetWebhook getWebhook(@Nonnull Long webhookId, Map<String,String> additionalHeaders) throws ApiException
      Get a webhook details
      Parameters:
      webhookId - Id of the webhook (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      GetWebhook
      Throws:
      ApiException - if fails to make API call
    • getWebhooks

      public GetWebhooks getWebhooks(@Nullable String type, @Nullable String sort) throws ApiException
      Get all webhooks
      Parameters:
      type - Filter on webhook type (optional, default to transactional)
      sort - Sort the results in the ascending/descending order of webhook creation (optional, default to desc)
      Returns:
      GetWebhooks
      Throws:
      ApiException - if fails to make API call
    • getWebhooks

      public GetWebhooks getWebhooks(@Nullable String type, @Nullable String sort, Map<String,String> additionalHeaders) throws ApiException
      Get all webhooks
      Parameters:
      type - Filter on webhook type (optional, default to transactional)
      sort - Sort the results in the ascending/descending order of webhook creation (optional, default to desc)
      additionalHeaders - additionalHeaders for this call
      Returns:
      GetWebhooks
      Throws:
      ApiException - if fails to make API call
    • updateWebhook

      public void updateWebhook(@Nonnull Long webhookId, @Nonnull UpdateWebhook updateWebhook) throws ApiException
      Update a webhook
      Parameters:
      webhookId - Id of the webhook (required)
      updateWebhook - Values to update a webhook (required)
      Throws:
      ApiException - if fails to make API call
    • updateWebhook

      public void updateWebhook(@Nonnull Long webhookId, @Nonnull UpdateWebhook updateWebhook, Map<String,String> additionalHeaders) throws ApiException
      Update a webhook
      Parameters:
      webhookId - Id of the webhook (required)
      updateWebhook - Values to update a webhook (required)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • invokeAPI

      public <T> T invokeAPI(String url, String method, Object request, com.fasterxml.jackson.core.type.TypeReference<T> returnType, Map<String,String> additionalHeaders) throws ApiException
      Description copied from class: BaseApi
      Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests.
      Specified by:
      invokeAPI in class BaseApi
      Parameters:
      url - The URL for the request, either full URL or only the path.
      method - The HTTP method for the request.
      request - The request object.
      returnType - The return type.
      additionalHeaders - Additional headers for the request.
      Returns:
      The API response in the specified type.
      Throws:
      ApiException - if fails to make API call.