Class EmailCampaignsApi

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

public class EmailCampaignsApi extends BaseApi
  • Constructor Details

    • EmailCampaignsApi

      public EmailCampaignsApi()
    • EmailCampaignsApi

      public EmailCampaignsApi(ApiClient apiClient)
  • 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 ApiException
      Create 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

      public void deleteEmailCampaign(@Nonnull Long campaignId) throws ApiException
      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 ApiException
      Delete 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 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)
      additionalHeaders - additionalHeaders for this call
      Returns:
      CreatedProcessId
      Throws:
      ApiException - if fails to make API call
    • getAbTestCampaignResult

      public AbTestCampaignResult getAbTestCampaignResult(@Nonnull Long campaignId) throws ApiException
      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 ApiException
      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)
      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 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)
      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 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)
      additionalHeaders - additionalHeaders for this call
      Returns:
      GetEmailCampaigns
      Throws:
      ApiException - if fails to make API call
    • getSharedTemplateUrl

      public GetSharedTemplateUrl getSharedTemplateUrl(@Nonnull Long campaignId) throws ApiException
      Get a shared template url Get a unique URL to share & import an email template from one Brevo account to another.
      Parameters:
      campaignId - Id of the campaign or template (required)
      Returns:
      GetSharedTemplateUrl
      Throws:
      ApiException - if fails to make API call
    • getSharedTemplateUrl

      public GetSharedTemplateUrl getSharedTemplateUrl(@Nonnull Long campaignId, Map<String,String> additionalHeaders) throws ApiException
      Get a shared template url Get a unique URL to share & import an email template from one Brevo account to another.
      Parameters:
      campaignId - Id of the campaign or template (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      GetSharedTemplateUrl
      Throws:
      ApiException - if fails to make API call
    • sendEmailCampaignNow

      public void sendEmailCampaignNow(@Nonnull Long campaignId) throws ApiException
      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 ApiException
      Send 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 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)
      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 ApiException
      Send 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 ApiException
      Update 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 ApiException
      Update 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 ApiException
      Upload 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 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.