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 |
CreateModel createWebhook(createWebhook)
Create a webhook
// Import classes:
//import brevo.ApiClient;
//import brevo.ApiException;
//import brevo.Configuration;
//import brevo.auth.*;
//import brevoApi.WebhooksApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");
// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");
WebhooksApi apiInstance = new WebhooksApi();
CreateWebhook createWebhook = new CreateWebhook(); // CreateWebhook | Values to create a webhook
try {
CreateModel result = apiInstance.createWebhook(createWebhook);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling WebhooksApi#createWebhook");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
createWebhook | CreateWebhook | Values to create a webhook |
- Content-Type: application/json
- Accept: application/json
deleteWebhook(webhookId)
Delete a webhook
// Import classes:
//import brevo.ApiClient;
//import brevo.ApiException;
//import brevo.Configuration;
//import brevo.auth.*;
//import brevoApi.WebhooksApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");
// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");
WebhooksApi apiInstance = new WebhooksApi();
Long webhookId = 789L; // Long | Id of the webhook
try {
apiInstance.deleteWebhook(webhookId);
} catch (ApiException e) {
System.err.println("Exception when calling WebhooksApi#deleteWebhook");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
webhookId | Long | Id of the webhook |
null (empty response body)
- Content-Type: application/json
- Accept: application/json
CreatedProcessId 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.
// Import classes:
//import brevo.ApiClient;
//import brevo.ApiException;
//import brevo.Configuration;
//import brevo.auth.*;
//import brevoApi.WebhooksApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");
// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");
WebhooksApi apiInstance = new WebhooksApi();
ExportWebhooksHistory exportWebhookHistory = new ExportWebhooksHistory(); // ExportWebhooksHistory | Values to submit for webhooks history
try {
CreatedProcessId result = apiInstance.exportWebhooksHistory(exportWebhookHistory);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling WebhooksApi#exportWebhooksHistory");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
exportWebhookHistory | ExportWebhooksHistory | Values to submit for webhooks history |
- Content-Type: application/json
- Accept: application/json
GetWebhook getWebhook(webhookId)
Get a webhook details
// Import classes:
//import brevo.ApiClient;
//import brevo.ApiException;
//import brevo.Configuration;
//import brevo.auth.*;
//import brevoApi.WebhooksApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");
// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");
WebhooksApi apiInstance = new WebhooksApi();
Long webhookId = 789L; // Long | Id of the webhook
try {
GetWebhook result = apiInstance.getWebhook(webhookId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling WebhooksApi#getWebhook");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
webhookId | Long | Id of the webhook |
- Content-Type: application/json
- Accept: application/json
GetWebhooks getWebhooks(type, sort)
Get all webhooks
// Import classes:
//import brevo.ApiClient;
//import brevo.ApiException;
//import brevo.Configuration;
//import brevo.auth.*;
//import brevoApi.WebhooksApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");
// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");
WebhooksApi apiInstance = new WebhooksApi();
String type = "transactional"; // String | Filter on webhook type
String sort = "desc"; // String | Sort the results in the ascending/descending order of webhook creation
try {
GetWebhooks result = apiInstance.getWebhooks(type, sort);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling WebhooksApi#getWebhooks");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
type | String | Filter on webhook type | [optional] [default to transactional] [enum: marketing, transactional, inbound] |
sort | String | Sort the results in the ascending/descending order of webhook creation | [optional] [default to desc] [enum: asc, desc] |
- Content-Type: application/json
- Accept: application/json
updateWebhook(webhookId, updateWebhook)
Update a webhook
// Import classes:
//import brevo.ApiClient;
//import brevo.ApiException;
//import brevo.Configuration;
//import brevo.auth.*;
//import brevoApi.WebhooksApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");
// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");
WebhooksApi apiInstance = new WebhooksApi();
Long webhookId = 789L; // Long | Id of the webhook
UpdateWebhook updateWebhook = new UpdateWebhook(); // UpdateWebhook | Values to update a webhook
try {
apiInstance.updateWebhook(webhookId, updateWebhook);
} catch (ApiException e) {
System.err.println("Exception when calling WebhooksApi#updateWebhook");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
webhookId | Long | Id of the webhook | |
updateWebhook | UpdateWebhook | Values to update a webhook |
null (empty response body)
- Content-Type: application/json
- Accept: application/json