Skip to content

Latest commit

 

History

History
310 lines (231 loc) · 9.42 KB

WebhooksApi.md

File metadata and controls

310 lines (231 loc) · 9.42 KB

WebhooksApi

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

Method HTTP request Description
createWebhook POST /webhooks Create a webhook
deleteWebhook DELETE /webhooks/{webhookId} Delete a webhook
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)

Create a webhook

Example

// Import classes:
//import sendinblue.ApiClient;
//import sendinblue.ApiException;
//import sendinblue.Configuration;
//import sendinblue.auth.*;
//import sibApi.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();
}

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

deleteWebhook

deleteWebhook(webhookId)

Delete a webhook

Example

// Import classes:
//import sendinblue.ApiClient;
//import sendinblue.ApiException;
//import sendinblue.Configuration;
//import sendinblue.auth.*;
//import sibApi.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();
}

Parameters

Name Type Description Notes
webhookId Long Id of the webhook

Return type

null (empty response body)

Authorization

api-key, partner-key

HTTP request headers

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

getWebhook

GetWebhook getWebhook(webhookId)

Get a webhook details

Example

// Import classes:
//import sendinblue.ApiClient;
//import sendinblue.ApiException;
//import sendinblue.Configuration;
//import sendinblue.auth.*;
//import sibApi.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();
}

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

getWebhooks

GetWebhooks getWebhooks(type, sort)

Get all webhooks

Example

// Import classes:
//import sendinblue.ApiClient;
//import sendinblue.ApiException;
//import sendinblue.Configuration;
//import sendinblue.auth.*;
//import sibApi.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();
}

Parameters

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]

Return type

GetWebhooks

Authorization

api-key, partner-key

HTTP request headers

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

updateWebhook

updateWebhook(webhookId, updateWebhook)

Update a webhook

Example

// Import classes:
//import sendinblue.ApiClient;
//import sendinblue.ApiException;
//import sendinblue.Configuration;
//import sendinblue.auth.*;
//import sibApi.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();
}

Parameters

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

Return type

null (empty response body)

Authorization

api-key, partner-key

HTTP request headers

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