Class SmsCampaignsApi

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

public class SmsCampaignsApi extends BaseApi
  • Constructor Details

    • SmsCampaignsApi

      public SmsCampaignsApi()
    • SmsCampaignsApi

      public SmsCampaignsApi(ApiClient apiClient)
  • Method Details

    • createSmsCampaign

      public CreateModel createSmsCampaign(@Nonnull CreateSmsCampaign createSmsCampaign) throws ApiException
      Creates an SMS campaign
      Parameters:
      createSmsCampaign - Values to create an SMS Campaign (required)
      Returns:
      CreateModel
      Throws:
      ApiException - if fails to make API call
    • createSmsCampaign

      public CreateModel createSmsCampaign(@Nonnull CreateSmsCampaign createSmsCampaign, Map<String,String> additionalHeaders) throws ApiException
      Creates an SMS campaign
      Parameters:
      createSmsCampaign - Values to create an SMS Campaign (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      CreateModel
      Throws:
      ApiException - if fails to make API call
    • deleteSmsCampaign

      public void deleteSmsCampaign(@Nonnull Long campaignId) throws ApiException
      Delete an SMS campaign
      Parameters:
      campaignId - id of the SMS campaign (required)
      Throws:
      ApiException - if fails to make API call
    • deleteSmsCampaign

      public void deleteSmsCampaign(@Nonnull Long campaignId, Map<String,String> additionalHeaders) throws ApiException
      Delete an SMS campaign
      Parameters:
      campaignId - id of the SMS campaign (required)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • getSmsCampaign

      public GetSmsCampaign getSmsCampaign(@Nonnull Long campaignId) throws ApiException
      Get an SMS campaign
      Parameters:
      campaignId - id of the SMS campaign (required)
      Returns:
      GetSmsCampaign
      Throws:
      ApiException - if fails to make API call
    • getSmsCampaign

      public GetSmsCampaign getSmsCampaign(@Nonnull Long campaignId, Map<String,String> additionalHeaders) throws ApiException
      Get an SMS campaign
      Parameters:
      campaignId - id of the SMS campaign (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      GetSmsCampaign
      Throws:
      ApiException - if fails to make API call
    • getSmsCampaigns

      public GetSmsCampaigns getSmsCampaigns(@Nullable String status, @Nullable String startDate, @Nullable String endDate, @Nullable Long limit, @Nullable Long offset, @Nullable String sort) throws ApiException
      Returns the information for all your created SMS campaigns
      Parameters:
      status - Status of campaign. (optional)
      startDate - **Mandatory if endDate is used.** Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms 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 sms 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 limitation for the result returned (optional, default to 500)
      offset - Beginning point in the list to retrieve from. (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)
      Returns:
      GetSmsCampaigns
      Throws:
      ApiException - if fails to make API call
    • getSmsCampaigns

      public GetSmsCampaigns getSmsCampaigns(@Nullable String status, @Nullable String startDate, @Nullable String endDate, @Nullable Long limit, @Nullable Long offset, @Nullable String sort, Map<String,String> additionalHeaders) throws ApiException
      Returns the information for all your created SMS campaigns
      Parameters:
      status - Status of campaign. (optional)
      startDate - **Mandatory if endDate is used.** Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms 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 sms 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 limitation for the result returned (optional, default to 500)
      offset - Beginning point in the list to retrieve from. (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)
      additionalHeaders - additionalHeaders for this call
      Returns:
      GetSmsCampaigns
      Throws:
      ApiException - if fails to make API call
    • requestSmsRecipientExport

      public CreatedProcessId requestSmsRecipientExport(@Nonnull Long campaignId, @Nullable RequestSmsRecipientExport recipientExport) throws ApiException
      Export an SMS campaign's recipients It returns the background process ID which on completion calls the notify URL that you have set in the input.
      Parameters:
      campaignId - id of the campaign (required)
      recipientExport - Values to send for a recipient export request (optional)
      Returns:
      CreatedProcessId
      Throws:
      ApiException - if fails to make API call
    • requestSmsRecipientExport

      public CreatedProcessId requestSmsRecipientExport(@Nonnull Long campaignId, @Nullable RequestSmsRecipientExport recipientExport, Map<String,String> additionalHeaders) throws ApiException
      Export an SMS campaign's recipients It returns the background process ID which on completion calls the notify URL that you have set in the input.
      Parameters:
      campaignId - id of the campaign (required)
      recipientExport - Values to send for a recipient export request (optional)
      additionalHeaders - additionalHeaders for this call
      Returns:
      CreatedProcessId
      Throws:
      ApiException - if fails to make API call
    • sendSmsCampaignNow

      public void sendSmsCampaignNow(@Nonnull Long campaignId) throws ApiException
      Send your SMS campaign immediately
      Parameters:
      campaignId - id of the campaign (required)
      Throws:
      ApiException - if fails to make API call
    • sendSmsCampaignNow

      public void sendSmsCampaignNow(@Nonnull Long campaignId, Map<String,String> additionalHeaders) throws ApiException
      Send your SMS campaign immediately
      Parameters:
      campaignId - id of the campaign (required)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • sendSmsReport

      public void sendSmsReport(@Nonnull Long campaignId, @Nonnull SendReport sendReport) throws ApiException
      Send an SMS campaign's report Send report of Sent and Archived campaign, to the specified email addresses, with respective data and a pdf attachment in detail.
      Parameters:
      campaignId - id of the campaign (required)
      sendReport - Values for send a report (required)
      Throws:
      ApiException - if fails to make API call
    • sendSmsReport

      public void sendSmsReport(@Nonnull Long campaignId, @Nonnull SendReport sendReport, Map<String,String> additionalHeaders) throws ApiException
      Send an SMS campaign's report Send report of Sent and Archived campaign, to the specified email addresses, with respective data and a pdf attachment in detail.
      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
    • sendTestSms

      public void sendTestSms(@Nonnull Long campaignId, @Nonnull SendTestSms sendTestSms) throws ApiException
      Send a test SMS campaign
      Parameters:
      campaignId - Id of the SMS campaign (required)
      sendTestSms - Mobile number of the recipient with the country code. This number **must belong to one of your contacts in Brevo account and must not be blacklisted** (required)
      Throws:
      ApiException - if fails to make API call
    • sendTestSms

      public void sendTestSms(@Nonnull Long campaignId, @Nonnull SendTestSms sendTestSms, Map<String,String> additionalHeaders) throws ApiException
      Send a test SMS campaign
      Parameters:
      campaignId - Id of the SMS campaign (required)
      sendTestSms - Mobile number of the recipient with the country code. This number **must belong to one of your contacts in Brevo account and must not be blacklisted** (required)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • updateSmsCampaign

      public void updateSmsCampaign(@Nonnull Long campaignId, @Nonnull UpdateSmsCampaign updateSmsCampaign) throws ApiException
      Update an SMS campaign
      Parameters:
      campaignId - id of the SMS campaign (required)
      updateSmsCampaign - Values to update an SMS Campaign (required)
      Throws:
      ApiException - if fails to make API call
    • updateSmsCampaign

      public void updateSmsCampaign(@Nonnull Long campaignId, @Nonnull UpdateSmsCampaign updateSmsCampaign, Map<String,String> additionalHeaders) throws ApiException
      Update an SMS campaign
      Parameters:
      campaignId - id of the SMS campaign (required)
      updateSmsCampaign - Values to update an SMS Campaign (required)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • updateSmsCampaignStatus

      public void updateSmsCampaignStatus(@Nonnull Long campaignId, @Nonnull UpdateCampaignStatus status) throws ApiException
      Update a campaign's status
      Parameters:
      campaignId - id of the campaign (required)
      status - Status of the campaign. (required)
      Throws:
      ApiException - if fails to make API call
    • updateSmsCampaignStatus

      public void updateSmsCampaignStatus(@Nonnull Long campaignId, @Nonnull UpdateCampaignStatus status, Map<String,String> additionalHeaders) throws ApiException
      Update a campaign's status
      Parameters:
      campaignId - id of the campaign (required)
      status - Status of the campaign. (required)
      additionalHeaders - additionalHeaders for this call
      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.