Class ContactsApi

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

public class ContactsApi extends BaseApi
  • Constructor Details

    • ContactsApi

      public ContactsApi()
    • ContactsApi

      public ContactsApi(ApiClient apiClient)
  • Method Details

    • addContactToList

      public PostContactInfo addContactToList(@Nonnull Long listId, @Nonnull AddContactToListRequest addContactToListRequest) throws ApiException
      Add existing contacts to a list
      Parameters:
      listId - Id of the list (required)
      addContactToListRequest - Emails addresses OR IDs OR EXT_ID attributes of the contacts (required)
      Returns:
      PostContactInfo
      Throws:
      ApiException - if fails to make API call
    • addContactToList

      public PostContactInfo addContactToList(@Nonnull Long listId, @Nonnull AddContactToListRequest addContactToListRequest, Map<String,String> additionalHeaders) throws ApiException
      Add existing contacts to a list
      Parameters:
      listId - Id of the list (required)
      addContactToListRequest - Emails addresses OR IDs OR EXT_ID attributes of the contacts (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      PostContactInfo
      Throws:
      ApiException - if fails to make API call
    • createAttribute

      public void createAttribute(@Nonnull String attributeCategory, @Nonnull String attributeName, @Nonnull CreateAttribute createAttribute) throws ApiException
      Create contact attribute
      Parameters:
      attributeCategory - Category of the attribute (required)
      attributeName - Name of the attribute (required)
      createAttribute - Values to create an attribute (required)
      Throws:
      ApiException - if fails to make API call
    • createAttribute

      public void createAttribute(@Nonnull String attributeCategory, @Nonnull String attributeName, @Nonnull CreateAttribute createAttribute, Map<String,String> additionalHeaders) throws ApiException
      Create contact attribute
      Parameters:
      attributeCategory - Category of the attribute (required)
      attributeName - Name of the attribute (required)
      createAttribute - Values to create an attribute (required)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • createContact

      public CreateUpdateContactModel createContact(@Nonnull CreateContact createContact) throws ApiException
      Create a contact Creates new contacts on Brevo. Contacts can be created by passing either - <br><br> 1. email address of the contact (email_id), <br> 2. phone number of the contact (to be passed as \"SMS\" field in \"attributes\" along with proper country code), For example- {\"SMS\":\"+91xxxxxxxxxx\"} or {\"SMS\":\"0091xxxxxxxxxx\"} <br> 3. ext_id <br>
      Parameters:
      createContact - Values to create a contact (required)
      Returns:
      CreateUpdateContactModel
      Throws:
      ApiException - if fails to make API call
    • createContact

      public CreateUpdateContactModel createContact(@Nonnull CreateContact createContact, Map<String,String> additionalHeaders) throws ApiException
      Create a contact Creates new contacts on Brevo. Contacts can be created by passing either - <br><br> 1. email address of the contact (email_id), <br> 2. phone number of the contact (to be passed as \"SMS\" field in \"attributes\" along with proper country code), For example- {\"SMS\":\"+91xxxxxxxxxx\"} or {\"SMS\":\"0091xxxxxxxxxx\"} <br> 3. ext_id <br>
      Parameters:
      createContact - Values to create a contact (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      CreateUpdateContactModel
      Throws:
      ApiException - if fails to make API call
    • createDoiContact

      public void createDoiContact(@Nonnull CreateDoiContact createDoiContact) throws ApiException
      Create Contact via DOI (Double-Opt-In) Flow
      Parameters:
      createDoiContact - Values to create the Double opt-in (DOI) contact (required)
      Throws:
      ApiException - if fails to make API call
    • createDoiContact

      public void createDoiContact(@Nonnull CreateDoiContact createDoiContact, Map<String,String> additionalHeaders) throws ApiException
      Create Contact via DOI (Double-Opt-In) Flow
      Parameters:
      createDoiContact - Values to create the Double opt-in (DOI) contact (required)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • createFolder

      public CreateModel createFolder(@Nonnull CreateUpdateFolder createFolder) throws ApiException
      Create a folder
      Parameters:
      createFolder - Name of the folder (required)
      Returns:
      CreateModel
      Throws:
      ApiException - if fails to make API call
    • createFolder

      public CreateModel createFolder(@Nonnull CreateUpdateFolder createFolder, Map<String,String> additionalHeaders) throws ApiException
      Create a folder
      Parameters:
      createFolder - Name of the folder (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      CreateModel
      Throws:
      ApiException - if fails to make API call
    • createList

      public CreateModel createList(@Nonnull CreateList createList) throws ApiException
      Create a list
      Parameters:
      createList - Values to create a list (required)
      Returns:
      CreateModel
      Throws:
      ApiException - if fails to make API call
    • createList

      public CreateModel createList(@Nonnull CreateList createList, Map<String,String> additionalHeaders) throws ApiException
      Create a list
      Parameters:
      createList - Values to create a list (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      CreateModel
      Throws:
      ApiException - if fails to make API call
    • deleteAttribute

      public void deleteAttribute(@Nonnull String attributeCategory, @Nonnull String attributeName) throws ApiException
      Delete an attribute
      Parameters:
      attributeCategory - Category of the attribute (required)
      attributeName - Name of the existing attribute (required)
      Throws:
      ApiException - if fails to make API call
    • deleteAttribute

      public void deleteAttribute(@Nonnull String attributeCategory, @Nonnull String attributeName, Map<String,String> additionalHeaders) throws ApiException
      Delete an attribute
      Parameters:
      attributeCategory - Category of the attribute (required)
      attributeName - Name of the existing attribute (required)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • deleteContact

      public void deleteContact(@Nonnull GetContactInfoIdentifierParameter identifier, @Nullable String identifierType) throws ApiException
      Delete a contact There are 2 ways to delete a contact <br><br> Option 1- https://api.brevo.com/v3/contacts/{identifier} <br><br> Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={} <br> <br> Option 1 only works if identifierType is email_id (for EMAIL) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL and ID of the contact. <br><br> Option 2 works for all identifierType, use email_id for EMAIL attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute.
      Parameters:
      identifier - Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) (required)
      identifierType - email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute (optional)
      Throws:
      ApiException - if fails to make API call
    • deleteContact

      public void deleteContact(@Nonnull GetContactInfoIdentifierParameter identifier, @Nullable String identifierType, Map<String,String> additionalHeaders) throws ApiException
      Delete a contact There are 2 ways to delete a contact <br><br> Option 1- https://api.brevo.com/v3/contacts/{identifier} <br><br> Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={} <br> <br> Option 1 only works if identifierType is email_id (for EMAIL) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL and ID of the contact. <br><br> Option 2 works for all identifierType, use email_id for EMAIL attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute.
      Parameters:
      identifier - Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) (required)
      identifierType - email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute (optional)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • deleteFolder

      public void deleteFolder(@Nonnull Long folderId) throws ApiException
      Delete a folder (and all its lists)
      Parameters:
      folderId - Id of the folder (required)
      Throws:
      ApiException - if fails to make API call
    • deleteFolder

      public void deleteFolder(@Nonnull Long folderId, Map<String,String> additionalHeaders) throws ApiException
      Delete a folder (and all its lists)
      Parameters:
      folderId - Id of the folder (required)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • deleteList

      public void deleteList(@Nonnull Long listId) throws ApiException
      Delete a list
      Parameters:
      listId - Id of the list (required)
      Throws:
      ApiException - if fails to make API call
    • deleteList

      public void deleteList(@Nonnull Long listId, Map<String,String> additionalHeaders) throws ApiException
      Delete a list
      Parameters:
      listId - Id of the list (required)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • deleteMultiAttributeOptions

      public void deleteMultiAttributeOptions(@Nonnull String attributeType, @Nonnull String multipleChoiceAttribute, @Nonnull String multipleChoiceAttributeOption) throws ApiException
      Delete a multiple-choice attribute option
      Parameters:
      attributeType - Type of the attribute (required)
      multipleChoiceAttribute - Name of the existing muliple-choice attribute (required)
      multipleChoiceAttributeOption - Name of the existing multiple-choice attribute option that you want to delete (required)
      Throws:
      ApiException - if fails to make API call
    • deleteMultiAttributeOptions

      public void deleteMultiAttributeOptions(@Nonnull String attributeType, @Nonnull String multipleChoiceAttribute, @Nonnull String multipleChoiceAttributeOption, Map<String,String> additionalHeaders) throws ApiException
      Delete a multiple-choice attribute option
      Parameters:
      attributeType - Type of the attribute (required)
      multipleChoiceAttribute - Name of the existing muliple-choice attribute (required)
      multipleChoiceAttributeOption - Name of the existing multiple-choice attribute option that you want to delete (required)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • getAttributes

      public GetAttributes getAttributes() throws ApiException
      List all attributes
      Returns:
      GetAttributes
      Throws:
      ApiException - if fails to make API call
    • getAttributes

      public GetAttributes getAttributes(Map<String,String> additionalHeaders) throws ApiException
      List all attributes
      Parameters:
      additionalHeaders - additionalHeaders for this call
      Returns:
      GetAttributes
      Throws:
      ApiException - if fails to make API call
    • getContactInfo

      public GetExtendedContactDetails getContactInfo(@Nonnull GetContactInfoIdentifierParameter identifier, @Nullable String identifierType, @Nullable String startDate, @Nullable String endDate) throws ApiException
      Get a contact's details There are 2 ways to get a contact <br><br> Option 1- https://api.brevo.com/v3/contacts/{identifier} <br><br> Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={} <br> <br> Option 1 only works if identifierType is email_id (for EMAIL), phone_id (for SMS) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL, SMS and ID of the contact. <br><br> Option 2 works for all identifierType, use email_id for EMAIL attribute, phone_id for SMS attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute <br><br>Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats ``https://developers.brevo.com/reference/contacts-7#getcontactstats`` endpoint with the appropriate date ranges.
      Parameters:
      identifier - Email (urlencoded) OR ID of the contact OR its SMS attribute value OR EXT_ID attribute (urlencoded) (required)
      identifierType - email_id for Email, phone_id for SMS attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute (optional)
      startDate - **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional)
      endDate - **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. (optional)
      Returns:
      GetExtendedContactDetails
      Throws:
      ApiException - if fails to make API call
    • getContactInfo

      public GetExtendedContactDetails getContactInfo(@Nonnull GetContactInfoIdentifierParameter identifier, @Nullable String identifierType, @Nullable String startDate, @Nullable String endDate, Map<String,String> additionalHeaders) throws ApiException
      Get a contact's details There are 2 ways to get a contact <br><br> Option 1- https://api.brevo.com/v3/contacts/{identifier} <br><br> Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={} <br> <br> Option 1 only works if identifierType is email_id (for EMAIL), phone_id (for SMS) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL, SMS and ID of the contact. <br><br> Option 2 works for all identifierType, use email_id for EMAIL attribute, phone_id for SMS attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute <br><br>Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats ``https://developers.brevo.com/reference/contacts-7#getcontactstats`` endpoint with the appropriate date ranges.
      Parameters:
      identifier - Email (urlencoded) OR ID of the contact OR its SMS attribute value OR EXT_ID attribute (urlencoded) (required)
      identifierType - email_id for Email, phone_id for SMS attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute (optional)
      startDate - **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional)
      endDate - **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. (optional)
      additionalHeaders - additionalHeaders for this call
      Returns:
      GetExtendedContactDetails
      Throws:
      ApiException - if fails to make API call
    • getContactStats

      public GetContactCampaignStats getContactStats(@Nonnull GetContactInfoIdentifierParameter identifier, @Nullable String startDate, @Nullable String endDate) throws ApiException
      Get email campaigns' statistics for a contact
      Parameters:
      identifier - Email (urlencoded) OR ID of the contact (required)
      startDate - **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional)
      endDate - **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days (optional)
      Returns:
      GetContactCampaignStats
      Throws:
      ApiException - if fails to make API call
    • getContactStats

      public GetContactCampaignStats getContactStats(@Nonnull GetContactInfoIdentifierParameter identifier, @Nullable String startDate, @Nullable String endDate, Map<String,String> additionalHeaders) throws ApiException
      Get email campaigns' statistics for a contact
      Parameters:
      identifier - Email (urlencoded) OR ID of the contact (required)
      startDate - **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional)
      endDate - **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days (optional)
      additionalHeaders - additionalHeaders for this call
      Returns:
      GetContactCampaignStats
      Throws:
      ApiException - if fails to make API call
    • getContacts

      public GetContacts getContacts(@Nullable Long limit, @Nullable Long offset, @Nullable String modifiedSince, @Nullable String createdSince, @Nullable String sort, @Nullable Long segmentId, @Nullable List<Long> listIds, @Nullable String filter) throws ApiException
      Get all the contacts
      Parameters:
      limit - Number of documents per page (optional, default to 50)
      offset - Index of the first document of the page (optional, default to 0)
      modifiedSince - Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
      createdSince - Filter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
      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)
      segmentId - Id of the segment. **Either listIds or segmentId can be passed.** (optional)
      listIds - Ids of the list. **Either listIds or segmentId can be passed.** (optional)
      filter - Filter the contacts on the basis of attributes. **Allowed operator: equals. For multiple-choice options, the filter will apply an AND condition between the options. For category attributes, the filter will work with both id and value. (e.g. filter=equals(FIRSTNAME,\"Antoine\"), filter=equals(B1, true), filter=equals(DOB, \"1989-11-23\"), filter=equals(GENDER, \"1\"), filter=equals(GENDER, \"MALE\"), filter=equals(COUNTRY,\"USA, INDIA\")** (optional)
      Returns:
      GetContacts
      Throws:
      ApiException - if fails to make API call
    • getContacts

      public GetContacts getContacts(@Nullable Long limit, @Nullable Long offset, @Nullable String modifiedSince, @Nullable String createdSince, @Nullable String sort, @Nullable Long segmentId, @Nullable List<Long> listIds, @Nullable String filter, Map<String,String> additionalHeaders) throws ApiException
      Get all the contacts
      Parameters:
      limit - Number of documents per page (optional, default to 50)
      offset - Index of the first document of the page (optional, default to 0)
      modifiedSince - Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
      createdSince - Filter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
      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)
      segmentId - Id of the segment. **Either listIds or segmentId can be passed.** (optional)
      listIds - Ids of the list. **Either listIds or segmentId can be passed.** (optional)
      filter - Filter the contacts on the basis of attributes. **Allowed operator: equals. For multiple-choice options, the filter will apply an AND condition between the options. For category attributes, the filter will work with both id and value. (e.g. filter=equals(FIRSTNAME,\"Antoine\"), filter=equals(B1, true), filter=equals(DOB, \"1989-11-23\"), filter=equals(GENDER, \"1\"), filter=equals(GENDER, \"MALE\"), filter=equals(COUNTRY,\"USA, INDIA\")** (optional)
      additionalHeaders - additionalHeaders for this call
      Returns:
      GetContacts
      Throws:
      ApiException - if fails to make API call
    • getContactsFromList

      public GetContacts getContactsFromList(@Nonnull Long listId, @Nullable String modifiedSince, @Nullable Long limit, @Nullable Long offset, @Nullable String sort) throws ApiException
      Get contacts in a list
      Parameters:
      listId - Id of the list (required)
      modifiedSince - Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
      limit - Number of documents per page (optional, default to 50)
      offset - Index of the first document of 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)
      Returns:
      GetContacts
      Throws:
      ApiException - if fails to make API call
    • getContactsFromList

      public GetContacts getContactsFromList(@Nonnull Long listId, @Nullable String modifiedSince, @Nullable Long limit, @Nullable Long offset, @Nullable String sort, Map<String,String> additionalHeaders) throws ApiException
      Get contacts in a list
      Parameters:
      listId - Id of the list (required)
      modifiedSince - Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
      limit - Number of documents per page (optional, default to 50)
      offset - Index of the first document of 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)
      additionalHeaders - additionalHeaders for this call
      Returns:
      GetContacts
      Throws:
      ApiException - if fails to make API call
    • getFolder

      public GetFolder getFolder(@Nonnull Long folderId) throws ApiException
      Returns a folder's details
      Parameters:
      folderId - id of the folder (required)
      Returns:
      GetFolder
      Throws:
      ApiException - if fails to make API call
    • getFolder

      public GetFolder getFolder(@Nonnull Long folderId, Map<String,String> additionalHeaders) throws ApiException
      Returns a folder's details
      Parameters:
      folderId - id of the folder (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      GetFolder
      Throws:
      ApiException - if fails to make API call
    • getFolderLists

      public GetFolderLists getFolderLists(@Nonnull Long folderId, @Nullable Long limit, @Nullable Long offset, @Nullable String sort) throws ApiException
      Get lists in a folder
      Parameters:
      folderId - Id of the folder (required)
      limit - Number of documents per page (optional, default to 10)
      offset - Index of the first document of 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)
      Returns:
      GetFolderLists
      Throws:
      ApiException - if fails to make API call
    • getFolderLists

      public GetFolderLists getFolderLists(@Nonnull Long folderId, @Nullable Long limit, @Nullable Long offset, @Nullable String sort, Map<String,String> additionalHeaders) throws ApiException
      Get lists in a folder
      Parameters:
      folderId - Id of the folder (required)
      limit - Number of documents per page (optional, default to 10)
      offset - Index of the first document of 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)
      additionalHeaders - additionalHeaders for this call
      Returns:
      GetFolderLists
      Throws:
      ApiException - if fails to make API call
    • getFolders

      public GetFolders getFolders(@Nullable Long limit, @Nullable Long offset, @Nullable String sort) throws ApiException
      Get all folders
      Parameters:
      limit - Number of documents per page (optional, default to 10)
      offset - Index of the first document of 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)
      Returns:
      GetFolders
      Throws:
      ApiException - if fails to make API call
    • getFolders

      public GetFolders getFolders(@Nullable Long limit, @Nullable Long offset, @Nullable String sort, Map<String,String> additionalHeaders) throws ApiException
      Get all folders
      Parameters:
      limit - Number of documents per page (optional, default to 10)
      offset - Index of the first document of 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)
      additionalHeaders - additionalHeaders for this call
      Returns:
      GetFolders
      Throws:
      ApiException - if fails to make API call
    • getList

      public GetExtendedList getList(@Nonnull Long listId, @Nullable String startDate, @Nullable String endDate) throws ApiException
      Get a list's details
      Parameters:
      listId - Id of the list (required)
      startDate - **Mandatory if endDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id. **Prefer to pass your timezone in date-time format for accurate result** (optional)
      endDate - **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id. **Prefer to pass your timezone in date-time format for accurate result** (optional)
      Returns:
      GetExtendedList
      Throws:
      ApiException - if fails to make API call
    • getList

      public GetExtendedList getList(@Nonnull Long listId, @Nullable String startDate, @Nullable String endDate, Map<String,String> additionalHeaders) throws ApiException
      Get a list's details
      Parameters:
      listId - Id of the list (required)
      startDate - **Mandatory if endDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id. **Prefer to pass your timezone in date-time format for accurate result** (optional)
      endDate - **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id. **Prefer to pass your timezone in date-time format for accurate result** (optional)
      additionalHeaders - additionalHeaders for this call
      Returns:
      GetExtendedList
      Throws:
      ApiException - if fails to make API call
    • getLists

      public GetLists getLists(@Nullable Long limit, @Nullable Long offset, @Nullable String sort) throws ApiException
      Get all the lists
      Parameters:
      limit - Number of documents per page (optional, default to 10)
      offset - Index of the first document of 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)
      Returns:
      GetLists
      Throws:
      ApiException - if fails to make API call
    • getLists

      public GetLists getLists(@Nullable Long limit, @Nullable Long offset, @Nullable String sort, Map<String,String> additionalHeaders) throws ApiException
      Get all the lists
      Parameters:
      limit - Number of documents per page (optional, default to 10)
      offset - Index of the first document of 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)
      additionalHeaders - additionalHeaders for this call
      Returns:
      GetLists
      Throws:
      ApiException - if fails to make API call
    • getSegments

      public GetSegments getSegments(@Nullable Long limit, @Nullable Long offset, @Nullable String sort) throws ApiException
      Get all the segments
      Parameters:
      limit - Number of documents per page (optional, default to 10)
      offset - Index of the first document of 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)
      Returns:
      GetSegments
      Throws:
      ApiException - if fails to make API call
    • getSegments

      public GetSegments getSegments(@Nullable Long limit, @Nullable Long offset, @Nullable String sort, Map<String,String> additionalHeaders) throws ApiException
      Get all the segments
      Parameters:
      limit - Number of documents per page (optional, default to 10)
      offset - Index of the first document of 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)
      additionalHeaders - additionalHeaders for this call
      Returns:
      GetSegments
      Throws:
      ApiException - if fails to make API call
    • importContacts

      public CreatedProcessId importContacts(@Nonnull RequestContactImport requestContactImport) throws ApiException
      Import contacts It returns the background process ID which on completion calls the notify URL that you have set in the input. **Note**: - Any contact attribute that doesn't exist in your account will be ignored at import end.
      Parameters:
      requestContactImport - Values to import contacts in Brevo. To know more about the expected format, please have a look at ``https://help.brevo.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` (required)
      Returns:
      CreatedProcessId
      Throws:
      ApiException - if fails to make API call
    • importContacts

      public CreatedProcessId importContacts(@Nonnull RequestContactImport requestContactImport, Map<String,String> additionalHeaders) throws ApiException
      Import contacts It returns the background process ID which on completion calls the notify URL that you have set in the input. **Note**: - Any contact attribute that doesn't exist in your account will be ignored at import end.
      Parameters:
      requestContactImport - Values to import contacts in Brevo. To know more about the expected format, please have a look at ``https://help.brevo.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      CreatedProcessId
      Throws:
      ApiException - if fails to make API call
    • removeContactFromList

      public PostContactInfo removeContactFromList(@Nonnull Long listId, @Nonnull RemoveContactFromListRequest contactEmails) throws ApiException
      Delete a contact from a list
      Parameters:
      listId - Id of the list (required)
      contactEmails - Emails adresses OR IDs OR EXT_ID attributes of the contacts OR 'all' true (required)
      Returns:
      PostContactInfo
      Throws:
      ApiException - if fails to make API call
    • removeContactFromList

      public PostContactInfo removeContactFromList(@Nonnull Long listId, @Nonnull RemoveContactFromListRequest contactEmails, Map<String,String> additionalHeaders) throws ApiException
      Delete a contact from a list
      Parameters:
      listId - Id of the list (required)
      contactEmails - Emails adresses OR IDs OR EXT_ID attributes of the contacts OR 'all' true (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      PostContactInfo
      Throws:
      ApiException - if fails to make API call
    • requestContactExport

      public CreatedProcessId requestContactExport(@Nonnull RequestContactExport requestContactExport) throws ApiException
      Export contacts It returns the background process ID which on completion calls the notify URL that you have set in the input. File will be available in csv.
      Parameters:
      requestContactExport - Values to request a contact export (required)
      Returns:
      CreatedProcessId
      Throws:
      ApiException - if fails to make API call
    • requestContactExport

      public CreatedProcessId requestContactExport(@Nonnull RequestContactExport requestContactExport, Map<String,String> additionalHeaders) throws ApiException
      Export contacts It returns the background process ID which on completion calls the notify URL that you have set in the input. File will be available in csv.
      Parameters:
      requestContactExport - Values to request a contact export (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      CreatedProcessId
      Throws:
      ApiException - if fails to make API call
    • updateAttribute

      public void updateAttribute(@Nonnull String attributeCategory, @Nonnull String attributeName, @Nonnull UpdateAttribute updateAttribute) throws ApiException
      Update contact attribute
      Parameters:
      attributeCategory - Category of the attribute (required)
      attributeName - Name of the existing attribute (required)
      updateAttribute - Values to update an attribute (required)
      Throws:
      ApiException - if fails to make API call
    • updateAttribute

      public void updateAttribute(@Nonnull String attributeCategory, @Nonnull String attributeName, @Nonnull UpdateAttribute updateAttribute, Map<String,String> additionalHeaders) throws ApiException
      Update contact attribute
      Parameters:
      attributeCategory - Category of the attribute (required)
      attributeName - Name of the existing attribute (required)
      updateAttribute - Values to update an attribute (required)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • updateBatchContacts

      public void updateBatchContacts(@Nonnull UpdateBatchContacts updateBatchContacts) throws ApiException
      Update multiple contacts
      Parameters:
      updateBatchContacts - Values to update multiple contacts (required)
      Throws:
      ApiException - if fails to make API call
    • updateBatchContacts

      public void updateBatchContacts(@Nonnull UpdateBatchContacts updateBatchContacts, Map<String,String> additionalHeaders) throws ApiException
      Update multiple contacts
      Parameters:
      updateBatchContacts - Values to update multiple contacts (required)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • updateContact

      public void updateContact(@Nonnull GetContactInfoIdentifierParameter identifier, @Nonnull UpdateContact updateContact, @Nullable String identifierType) throws ApiException
      Update a contact There are 2 ways to update a contact <br><br> Option 1- https://api.brevo.com/v3/contacts/{identifier} <br><br> Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={} <br> <br> Option 1 only works if identifierType is email_id (for EMAIL) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL and ID of the contact. <br><br> Option 2 works for all identifierType, use email_id for EMAIL attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE attribute
      Parameters:
      identifier - Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) OR its SMS attribute value OR its WHATSAPP attribute value OR its LANDLINE attribute value (required)
      updateContact - Values to update a contact (required)
      identifierType - email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE attribute (optional)
      Throws:
      ApiException - if fails to make API call
    • updateContact

      public void updateContact(@Nonnull GetContactInfoIdentifierParameter identifier, @Nonnull UpdateContact updateContact, @Nullable String identifierType, Map<String,String> additionalHeaders) throws ApiException
      Update a contact There are 2 ways to update a contact <br><br> Option 1- https://api.brevo.com/v3/contacts/{identifier} <br><br> Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={} <br> <br> Option 1 only works if identifierType is email_id (for EMAIL) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL and ID of the contact. <br><br> Option 2 works for all identifierType, use email_id for EMAIL attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE attribute
      Parameters:
      identifier - Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) OR its SMS attribute value OR its WHATSAPP attribute value OR its LANDLINE attribute value (required)
      updateContact - Values to update a contact (required)
      identifierType - email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE attribute (optional)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • updateFolder

      public void updateFolder(@Nonnull Long folderId, @Nonnull CreateUpdateFolder updateFolder) throws ApiException
      Update a folder
      Parameters:
      folderId - Id of the folder (required)
      updateFolder - Name of the folder (required)
      Throws:
      ApiException - if fails to make API call
    • updateFolder

      public void updateFolder(@Nonnull Long folderId, @Nonnull CreateUpdateFolder updateFolder, Map<String,String> additionalHeaders) throws ApiException
      Update a folder
      Parameters:
      folderId - Id of the folder (required)
      updateFolder - Name of the folder (required)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • updateList

      public void updateList(@Nonnull Long listId, @Nonnull UpdateList updateList) throws ApiException
      Update a list
      Parameters:
      listId - Id of the list (required)
      updateList - Values to update a list (required)
      Throws:
      ApiException - if fails to make API call
    • updateList

      public void updateList(@Nonnull Long listId, @Nonnull UpdateList updateList, Map<String,String> additionalHeaders) throws ApiException
      Update a list
      Parameters:
      listId - Id of the list (required)
      updateList - Values to update a list (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.