Package software.xdev.brevo.api
Class ContactsApi
java.lang.Object
software.xdev.brevo.client.BaseApi
software.xdev.brevo.api.ContactsApi
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddContactToList(Long listId, AddContactToListRequest addContactToListRequest) Add existing contacts to a listaddContactToList(Long listId, AddContactToListRequest addContactToListRequest, Map<String, String> additionalHeaders) Add existing contacts to a listvoidcreateAttribute(String attributeCategory, String attributeName, CreateAttribute createAttribute) Create contact attributevoidcreateAttribute(String attributeCategory, String attributeName, CreateAttribute createAttribute, Map<String, String> additionalHeaders) Create contact attributecreateContact(CreateContact createContact) Create a contact Creates new contacts on Brevo.createContact(CreateContact createContact, Map<String, String> additionalHeaders) Create a contact Creates new contacts on Brevo.voidcreateDoiContact(CreateDoiContact createDoiContact) Create Contact via DOI (Double-Opt-In) FlowvoidcreateDoiContact(CreateDoiContact createDoiContact, Map<String, String> additionalHeaders) Create Contact via DOI (Double-Opt-In) FlowcreateFolder(CreateUpdateFolder createFolder) Create a foldercreateFolder(CreateUpdateFolder createFolder, Map<String, String> additionalHeaders) Create a foldercreateList(CreateList createList) Create a listcreateList(CreateList createList, Map<String, String> additionalHeaders) Create a listvoiddeleteAttribute(String attributeCategory, String attributeName) Delete an attributevoiddeleteAttribute(String attributeCategory, String attributeName, Map<String, String> additionalHeaders) Delete an attributevoiddeleteContact(GetContactInfoIdentifierParameter identifier, String identifierType) 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}?voiddeleteContact(GetContactInfoIdentifierParameter identifier, String identifierType, Map<String, String> additionalHeaders) 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}?voiddeleteFolder(Long folderId) Delete a folder (and all its lists)voiddeleteFolder(Long folderId, Map<String, String> additionalHeaders) Delete a folder (and all its lists)voiddeleteList(Long listId) Delete a listvoiddeleteList(Long listId, Map<String, String> additionalHeaders) Delete a listvoiddeleteMultiAttributeOptions(String attributeType, String multipleChoiceAttribute, String multipleChoiceAttributeOption) Delete a multiple-choice attribute optionvoiddeleteMultiAttributeOptions(String attributeType, String multipleChoiceAttribute, String multipleChoiceAttributeOption, Map<String, String> additionalHeaders) Delete a multiple-choice attribute optionList all attributesgetAttributes(Map<String, String> additionalHeaders) List all attributesgetContactInfo(GetContactInfoIdentifierParameter identifier, String identifierType, String startDate, String endDate) 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}?getContactInfo(GetContactInfoIdentifierParameter identifier, String identifierType, String startDate, String endDate, Map<String, String> additionalHeaders) 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}?getContacts(Long limit, Long offset, String modifiedSince, String createdSince, String sort, Long segmentId, List<Long> listIds, String filter) Get all the contactsgetContacts(Long limit, Long offset, String modifiedSince, String createdSince, String sort, Long segmentId, List<Long> listIds, String filter, Map<String, String> additionalHeaders) Get all the contactsGet contacts in a listgetContactsFromList(Long listId, String modifiedSince, Long limit, Long offset, String sort, Map<String, String> additionalHeaders) Get contacts in a listgetContactStats(GetContactInfoIdentifierParameter identifier, String startDate, String endDate) Get email campaigns' statistics for a contactgetContactStats(GetContactInfoIdentifierParameter identifier, String startDate, String endDate, Map<String, String> additionalHeaders) Get email campaigns' statistics for a contactReturns a folder's detailsReturns a folder's detailsgetFolderLists(Long folderId, Long limit, Long offset, String sort) Get lists in a foldergetFolderLists(Long folderId, Long limit, Long offset, String sort, Map<String, String> additionalHeaders) Get lists in a foldergetFolders(Long limit, Long offset, String sort) Get all foldersGet all foldersGet a list's detailsGet a list's detailsGet all the listsGet all the listsgetSegments(Long limit, Long offset, String sort) Get all the segmentsGet all the segmentsimportContacts(RequestContactImport requestContactImport) Import contacts It returns the background process ID which on completion calls the notify URL that you have set in the input.importContacts(RequestContactImport requestContactImport, Map<String, String> additionalHeaders) Import contacts It returns the background process ID which on completion calls the notify URL that you have set in the input.<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.removeContactFromList(Long listId, RemoveContactFromListRequest contactEmails) Delete a contact from a listremoveContactFromList(Long listId, RemoveContactFromListRequest contactEmails, Map<String, String> additionalHeaders) Delete a contact from a listrequestContactExport(RequestContactExport requestContactExport) Export contacts It returns the background process ID which on completion calls the notify URL that you have set in the input.requestContactExport(RequestContactExport requestContactExport, Map<String, String> additionalHeaders) Export contacts It returns the background process ID which on completion calls the notify URL that you have set in the input.voidupdateAttribute(String attributeCategory, String attributeName, UpdateAttribute updateAttribute) Update contact attributevoidupdateAttribute(String attributeCategory, String attributeName, UpdateAttribute updateAttribute, Map<String, String> additionalHeaders) Update contact attributevoidupdateBatchContacts(UpdateBatchContacts updateBatchContacts) Update multiple contactsvoidupdateBatchContacts(UpdateBatchContacts updateBatchContacts, Map<String, String> additionalHeaders) Update multiple contactsvoidupdateContact(GetContactInfoIdentifierParameter identifier, UpdateContact updateContact, String identifierType) 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}?voidupdateContact(GetContactInfoIdentifierParameter identifier, UpdateContact updateContact, String identifierType, Map<String, String> additionalHeaders) 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}?voidupdateFolder(Long folderId, CreateUpdateFolder updateFolder) Update a foldervoidupdateFolder(Long folderId, CreateUpdateFolder updateFolder, Map<String, String> additionalHeaders) Update a foldervoidupdateList(Long listId, UpdateList updateList) Update a listvoidupdateList(Long listId, UpdateList updateList, Map<String, String> additionalHeaders) Update a listMethods inherited from class software.xdev.brevo.client.BaseApi
getApiClient, invokeAPI, invokeAPI, invokeAPI, invokeAPI, invokeAPI, invokeAPI, setApiClient
-
Constructor Details
-
ContactsApi
public ContactsApi() -
ContactsApi
-
-
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 ApiExceptionAdd 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 ApiExceptionCreate 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 ApiExceptionCreate 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
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 ApiExceptionCreate 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
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 ApiExceptionCreate 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
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 ApiExceptionCreate 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 ApiExceptionDelete 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 ApiExceptionDelete 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
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 ApiExceptionDelete 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
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 ApiExceptionDelete 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 ApiExceptionDelete 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
List all attributes- Returns:
- GetAttributes
- Throws:
ApiException- if fails to make API call
-
getAttributes
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 ApiExceptionGet 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 ApiExceptionGet 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 ApiExceptionGet 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 ApiExceptionGet 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
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 ApiExceptionReturns 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 ApiExceptionGet 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 ApiExceptionGet 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 ApiExceptionGet 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 ApiExceptionGet 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 ApiExceptionGet 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 ApiExceptionImport 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 ApiExceptionDelete 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 ApiExceptionExport 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 ApiExceptionUpdate 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 ApiExceptionUpdate 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 ApiExceptionUpdate 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 ApiExceptionUpdate 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
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 ApiExceptionUpdate 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 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.
-