Skip to content

Latest commit

 

History

History
303 lines (225 loc) · 9.02 KB

DomainsApi.md

File metadata and controls

303 lines (225 loc) · 9.02 KB

DomainsApi

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

Method HTTP request Description
authenticateDomain PUT /senders/domains/{domainName}/authenticate Authenticate a domain
createDomain POST /senders/domains Create a new domain
deleteDomain DELETE /senders/domains/{domainName} Delete a domain
getDomainConfiguration GET /senders/domains/{domainName} Validate domain configuration
getDomains GET /senders/domains Get the list of all your domains

authenticateDomain

AuthenticateDomainModel authenticateDomain(domainName)

Authenticate a domain

Example

// Import classes:
//import brevo.ApiClient;
//import brevo.ApiException;
//import brevo.Configuration;
//import brevo.auth.*;
//import brevoApi.DomainsApi;

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");

DomainsApi apiInstance = new DomainsApi();
String domainName = "domainName_example"; // String | Domain name
try {
    AuthenticateDomainModel result = apiInstance.authenticateDomain(domainName);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling DomainsApi#authenticateDomain");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
domainName String Domain name

Return type

AuthenticateDomainModel

Authorization

api-key, partner-key

HTTP request headers

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

createDomain

CreateDomainModel createDomain(domainName)

Create a new domain

Example

// Import classes:
//import brevo.ApiClient;
//import brevo.ApiException;
//import brevo.Configuration;
//import brevo.auth.*;
//import brevoApi.DomainsApi;

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");

DomainsApi apiInstance = new DomainsApi();
CreateDomain domainName = new CreateDomain(); // CreateDomain | domain's name
try {
    CreateDomainModel result = apiInstance.createDomain(domainName);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling DomainsApi#createDomain");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
domainName CreateDomain domain's name [optional]

Return type

CreateDomainModel

Authorization

api-key, partner-key

HTTP request headers

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

deleteDomain

deleteDomain(domainName)

Delete a domain

Example

// Import classes:
//import brevo.ApiClient;
//import brevo.ApiException;
//import brevo.Configuration;
//import brevo.auth.*;
//import brevoApi.DomainsApi;

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");

DomainsApi apiInstance = new DomainsApi();
String domainName = "domainName_example"; // String | Domain name
try {
    apiInstance.deleteDomain(domainName);
} catch (ApiException e) {
    System.err.println("Exception when calling DomainsApi#deleteDomain");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
domainName String Domain name

Return type

null (empty response body)

Authorization

api-key, partner-key

HTTP request headers

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

getDomainConfiguration

GetDomainConfigurationModel getDomainConfiguration(domainName)

Validate domain configuration

Example

// Import classes:
//import brevo.ApiClient;
//import brevo.ApiException;
//import brevo.Configuration;
//import brevo.auth.*;
//import brevoApi.DomainsApi;

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");

DomainsApi apiInstance = new DomainsApi();
String domainName = "domainName_example"; // String | Domain name
try {
    GetDomainConfigurationModel result = apiInstance.getDomainConfiguration(domainName);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling DomainsApi#getDomainConfiguration");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
domainName String Domain name

Return type

GetDomainConfigurationModel

Authorization

api-key, partner-key

HTTP request headers

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

getDomains

GetDomainsList getDomains()

Get the list of all your domains

Example

// Import classes:
//import brevo.ApiClient;
//import brevo.ApiException;
//import brevo.Configuration;
//import brevo.auth.*;
//import brevoApi.DomainsApi;

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");

DomainsApi apiInstance = new DomainsApi();
try {
    GetDomainsList result = apiInstance.getDomains();
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling DomainsApi#getDomains");
    e.printStackTrace();
}

Parameters

This endpoint does not need any parameter.

Return type

GetDomainsList

Authorization

api-key, partner-key

HTTP request headers

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