Package software.xdev.brevo.api
Class EmailCampaignsApi
java.lang.Object
software.xdev.brevo.client.BaseApi
software.xdev.brevo.api.EmailCampaignsApi
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateEmailCampaign(CreateEmailCampaign createEmailCampaign) Create an email campaigncreateEmailCampaign(CreateEmailCampaign createEmailCampaign, Map<String, String> additionalHeaders) Create an email campaignvoiddeleteEmailCampaign(Long campaignId) Delete an email campaignvoiddeleteEmailCampaign(Long campaignId, Map<String, String> additionalHeaders) Delete an email campaignemailExportRecipients(Long campaignId, EmailExportRecipients emailExportRecipients) Export the recipients of an email campaignemailExportRecipients(Long campaignId, EmailExportRecipients emailExportRecipients, Map<String, String> additionalHeaders) Export the recipients of an email campaigngetAbTestCampaignResult(Long campaignId) Get an A/B test email campaign results Obtain winning version of an A/B test email campaigngetAbTestCampaignResult(Long campaignId, Map<String, String> additionalHeaders) Get an A/B test email campaign results Obtain winning version of an A/B test email campaigngetEmailCampaign(Long campaignId, String statistics) Get an email campaign reportGet an email campaign reportgetEmailCampaigns(String type, String status, String statistics, String startDate, String endDate, Long limit, Long offset, String sort, Boolean excludeHtmlContent) Return all your created email campaignsgetEmailCampaigns(String type, String status, String statistics, String startDate, String endDate, Long limit, Long offset, String sort, Boolean excludeHtmlContent, Map<String, String> additionalHeaders) Return all your created email campaignsgetSharedTemplateUrl(Long campaignId) Get a shared template url Get a unique URL to share & import an email template from one Brevo account to another.getSharedTemplateUrl(Long campaignId, Map<String, String> additionalHeaders) Get a shared template url Get a unique URL to share & import an email template from one Brevo account to another.<T> TinvokeAPI(String url, String method, Object request, com.fasterxml.jackson.core.type.TypeReference<T> returnType, Map<String, String> additionalHeaders) Directly invoke the API for the given URL.voidsendEmailCampaignNow(Long campaignId) Send an email campaign immediately, based on campaignIdvoidsendEmailCampaignNow(Long campaignId, Map<String, String> additionalHeaders) Send an email campaign immediately, based on campaignIdvoidsendReport(Long campaignId, SendReport sendReport) Send the report of a campaign A PDF will be sent to the specified email addressesvoidsendReport(Long campaignId, SendReport sendReport, Map<String, String> additionalHeaders) Send the report of a campaign A PDF will be sent to the specified email addressesvoidsendTestEmail(Long campaignId, SendTestEmail sendTestEmail) Send an email campaign to your test listvoidsendTestEmail(Long campaignId, SendTestEmail sendTestEmail, Map<String, String> additionalHeaders) Send an email campaign to your test listvoidupdateCampaignStatus(Long campaignId, UpdateCampaignStatus updateCampaignStatus) Update an email campaign statusvoidupdateCampaignStatus(Long campaignId, UpdateCampaignStatus updateCampaignStatus, Map<String, String> additionalHeaders) Update an email campaign statusvoidupdateEmailCampaign(Long campaignId, UpdateEmailCampaign updateEmailCampaign) Update an email campaignvoidupdateEmailCampaign(Long campaignId, UpdateEmailCampaign updateEmailCampaign, Map<String, String> additionalHeaders) Update an email campaignuploadImageToGallery(UploadImageToGallery uploadImageToGallery) Upload an image to your account's image galleryuploadImageToGallery(UploadImageToGallery uploadImageToGallery, Map<String, String> additionalHeaders) Upload an image to your account's image galleryMethods inherited from class software.xdev.brevo.client.BaseApi
getApiClient, invokeAPI, invokeAPI, invokeAPI, invokeAPI, invokeAPI, invokeAPI, setApiClient
-
Constructor Details
-
EmailCampaignsApi
public EmailCampaignsApi() -
EmailCampaignsApi
-
-
Method Details
-
createEmailCampaign
public CreateModel createEmailCampaign(@Nonnull CreateEmailCampaign createEmailCampaign) throws ApiException Create an email campaign- Parameters:
createEmailCampaign- Values to create a campaign (required)- Returns:
- CreateModel
- Throws:
ApiException- if fails to make API call
-
createEmailCampaign
public CreateModel createEmailCampaign(@Nonnull CreateEmailCampaign createEmailCampaign, Map<String, String> additionalHeaders) throws ApiExceptionCreate an email campaign- Parameters:
createEmailCampaign- Values to create a campaign (required)additionalHeaders- additionalHeaders for this call- Returns:
- CreateModel
- Throws:
ApiException- if fails to make API call
-
deleteEmailCampaign
Delete an email campaign- Parameters:
campaignId- id of the campaign (required)- Throws:
ApiException- if fails to make API call
-
deleteEmailCampaign
public void deleteEmailCampaign(@Nonnull Long campaignId, Map<String, String> additionalHeaders) throws ApiExceptionDelete an email campaign- Parameters:
campaignId- id of the campaign (required)additionalHeaders- additionalHeaders for this call- Throws:
ApiException- if fails to make API call
-
emailExportRecipients
public CreatedProcessId emailExportRecipients(@Nonnull Long campaignId, @Nullable EmailExportRecipients emailExportRecipients) throws ApiException Export the recipients of an email campaign- Parameters:
campaignId- Id of the campaign (required)emailExportRecipients- Values to send for a recipient export request (optional)- Returns:
- CreatedProcessId
- Throws:
ApiException- if fails to make API call
-
emailExportRecipients
public CreatedProcessId emailExportRecipients(@Nonnull Long campaignId, @Nullable EmailExportRecipients emailExportRecipients, Map<String, String> additionalHeaders) throws ApiExceptionExport the recipients of an email campaign- Parameters:
campaignId- Id of the campaign (required)emailExportRecipients- Values to send for a recipient export request (optional)additionalHeaders- additionalHeaders for this call- Returns:
- CreatedProcessId
- Throws:
ApiException- if fails to make API call
-
getAbTestCampaignResult
Get an A/B test email campaign results Obtain winning version of an A/B test email campaign- Parameters:
campaignId- Id of the A/B test campaign (required)- Returns:
- AbTestCampaignResult
- Throws:
ApiException- if fails to make API call
-
getAbTestCampaignResult
public AbTestCampaignResult getAbTestCampaignResult(@Nonnull Long campaignId, Map<String, String> additionalHeaders) throws ApiExceptionGet an A/B test email campaign results Obtain winning version of an A/B test email campaign- Parameters:
campaignId- Id of the A/B test campaign (required)additionalHeaders- additionalHeaders for this call- Returns:
- AbTestCampaignResult
- Throws:
ApiException- if fails to make API call
-
getEmailCampaign
public GetEmailCampaign getEmailCampaign(@Nonnull Long campaignId, @Nullable String statistics) throws ApiException Get an email campaign report- Parameters:
campaignId- Id of the campaign (required)statistics- Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional)- Returns:
- GetEmailCampaign
- Throws:
ApiException- if fails to make API call
-
getEmailCampaign
public GetEmailCampaign getEmailCampaign(@Nonnull Long campaignId, @Nullable String statistics, Map<String, String> additionalHeaders) throws ApiExceptionGet an email campaign report- Parameters:
campaignId- Id of the campaign (required)statistics- Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional)additionalHeaders- additionalHeaders for this call- Returns:
- GetEmailCampaign
- Throws:
ApiException- if fails to make API call
-
getEmailCampaigns
public GetEmailCampaigns getEmailCampaigns(@Nullable String type, @Nullable String status, @Nullable String statistics, @Nullable String startDate, @Nullable String endDate, @Nullable Long limit, @Nullable Long offset, @Nullable String sort, @Nullable Boolean excludeHtmlContent) throws ApiException Return all your created email campaigns- Parameters:
type- Filter on the type of the campaigns (optional)status- Filter on the status of the campaign (optional)statistics- Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response.This option only returns data for events occurred in the last 6 months.For older campaigns, it’s advisable to use the **Get Campaign Report** endpoint. (optional)startDate- **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)endDate- **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)limit- Number of documents per page (optional, default to 50)offset- Index of the first document in the page (optional, default to 0)sort- Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)excludeHtmlContent- Use this flag to exclude htmlContent from the response body. If set to **true**, htmlContent field will be returned as empty string in the response body (optional)- Returns:
- GetEmailCampaigns
- Throws:
ApiException- if fails to make API call
-
getEmailCampaigns
public GetEmailCampaigns getEmailCampaigns(@Nullable String type, @Nullable String status, @Nullable String statistics, @Nullable String startDate, @Nullable String endDate, @Nullable Long limit, @Nullable Long offset, @Nullable String sort, @Nullable Boolean excludeHtmlContent, Map<String, String> additionalHeaders) throws ApiExceptionReturn all your created email campaigns- Parameters:
type- Filter on the type of the campaigns (optional)status- Filter on the status of the campaign (optional)statistics- Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response.This option only returns data for events occurred in the last 6 months.For older campaigns, it’s advisable to use the **Get Campaign Report** endpoint. (optional)startDate- **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)endDate- **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)limit- Number of documents per page (optional, default to 50)offset- Index of the first document in the page (optional, default to 0)sort- Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)excludeHtmlContent- Use this flag to exclude htmlContent from the response body. If set to **true**, htmlContent field will be returned as empty string in the response body (optional)additionalHeaders- additionalHeaders for this call- Returns:
- GetEmailCampaigns
- Throws:
ApiException- if fails to make API call
-
sendEmailCampaignNow
Send an email campaign immediately, based on campaignId- Parameters:
campaignId- Id of the campaign (required)- Throws:
ApiException- if fails to make API call
-
sendEmailCampaignNow
public void sendEmailCampaignNow(@Nonnull Long campaignId, Map<String, String> additionalHeaders) throws ApiExceptionSend an email campaign immediately, based on campaignId- Parameters:
campaignId- Id of the campaign (required)additionalHeaders- additionalHeaders for this call- Throws:
ApiException- if fails to make API call
-
sendReport
public void sendReport(@Nonnull Long campaignId, @Nonnull SendReport sendReport) throws ApiException Send the report of a campaign A PDF will be sent to the specified email addresses- Parameters:
campaignId- Id of the campaign (required)sendReport- Values for send a report (required)- Throws:
ApiException- if fails to make API call
-
sendReport
public void sendReport(@Nonnull Long campaignId, @Nonnull SendReport sendReport, Map<String, String> additionalHeaders) throws ApiExceptionSend the report of a campaign A PDF will be sent to the specified email addresses- Parameters:
campaignId- Id of the campaign (required)sendReport- Values for send a report (required)additionalHeaders- additionalHeaders for this call- Throws:
ApiException- if fails to make API call
-
sendTestEmail
public void sendTestEmail(@Nonnull Long campaignId, @Nonnull SendTestEmail sendTestEmail) throws ApiException Send an email campaign to your test list- Parameters:
campaignId- Id of the campaign (required)sendTestEmail- (required)- Throws:
ApiException- if fails to make API call
-
sendTestEmail
public void sendTestEmail(@Nonnull Long campaignId, @Nonnull SendTestEmail sendTestEmail, Map<String, String> additionalHeaders) throws ApiExceptionSend an email campaign to your test list- Parameters:
campaignId- Id of the campaign (required)sendTestEmail- (required)additionalHeaders- additionalHeaders for this call- Throws:
ApiException- if fails to make API call
-
updateCampaignStatus
public void updateCampaignStatus(@Nonnull Long campaignId, @Nonnull UpdateCampaignStatus updateCampaignStatus) throws ApiException Update an email campaign status- Parameters:
campaignId- Id of the campaign (required)updateCampaignStatus- Status of the campaign (required)- Throws:
ApiException- if fails to make API call
-
updateCampaignStatus
public void updateCampaignStatus(@Nonnull Long campaignId, @Nonnull UpdateCampaignStatus updateCampaignStatus, Map<String, String> additionalHeaders) throws ApiExceptionUpdate an email campaign status- Parameters:
campaignId- Id of the campaign (required)updateCampaignStatus- Status of the campaign (required)additionalHeaders- additionalHeaders for this call- Throws:
ApiException- if fails to make API call
-
updateEmailCampaign
public void updateEmailCampaign(@Nonnull Long campaignId, @Nonnull UpdateEmailCampaign updateEmailCampaign) throws ApiException Update an email campaign- Parameters:
campaignId- Id of the campaign (required)updateEmailCampaign- Values to update a campaign (required)- Throws:
ApiException- if fails to make API call
-
updateEmailCampaign
public void updateEmailCampaign(@Nonnull Long campaignId, @Nonnull UpdateEmailCampaign updateEmailCampaign, Map<String, String> additionalHeaders) throws ApiExceptionUpdate an email campaign- Parameters:
campaignId- Id of the campaign (required)updateEmailCampaign- Values to update a campaign (required)additionalHeaders- additionalHeaders for this call- Throws:
ApiException- if fails to make API call
-
uploadImageToGallery
public UploadImageModel uploadImageToGallery(@Nonnull UploadImageToGallery uploadImageToGallery) throws ApiException Upload an image to your account's image gallery- Parameters:
uploadImageToGallery- Parameters to upload an image (required)- Returns:
- UploadImageModel
- Throws:
ApiException- if fails to make API call
-
uploadImageToGallery
public UploadImageModel uploadImageToGallery(@Nonnull UploadImageToGallery uploadImageToGallery, Map<String, String> additionalHeaders) throws ApiExceptionUpload an image to your account's image gallery- Parameters:
uploadImageToGallery- Parameters to upload an image (required)additionalHeaders- additionalHeaders for this call- Returns:
- UploadImageModel
- 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 ApiExceptionDescription copied from class:BaseApiDirectly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests.- Specified by:
invokeAPIin classBaseApi- 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.
-