All URIs are relative to https://api.brevo.com/v3
| Method | HTTP request | Description |
|---|---|---|
| add_contact_to_list | POST /contacts/lists/{listId}/contacts/add | Add existing contacts to a list |
| create_attribute | POST /contacts/attributes/{attributeCategory}/{attributeName} | Create contact attribute |
| create_contact | POST /contacts | Create a contact |
| create_doi_contact | POST /contacts/doubleOptinConfirmation | Create Contact via DOI (Double-Opt-In) Flow |
| create_folder | POST /contacts/folders | Create a folder |
| create_list | POST /contacts/lists | Create a list |
| delete_attribute | DELETE /contacts/attributes/{attributeCategory}/{attributeName} | Delete an attribute |
| delete_contact | DELETE /contacts/{identifier} | Delete a contact |
| delete_folder | DELETE /contacts/folders/{folderId} | Delete a folder (and all its lists) |
| delete_list | DELETE /contacts/lists/{listId} | Delete a list |
| delete_multi_attribute_options | DELETE /contacts/attributes/{attributeType}/{multipleChoiceAttribute}/{multipleChoiceAttributeOption} | Delete a multiple-choice attribute option |
| get_attributes | GET /contacts/attributes | List all attributes |
| get_contact_info | GET /contacts/{identifier} | Get a contact's details |
| get_contact_stats | GET /contacts/{identifier}/campaignStats | Get email campaigns' statistics for a contact |
| get_contacts | GET /contacts | Get all the contacts |
| get_contacts_from_list | GET /contacts/lists/{listId}/contacts | Get contacts in a list |
| get_folder | GET /contacts/folders/{folderId} | Returns a folder's details |
| get_folder_lists | GET /contacts/folders/{folderId}/lists | Get lists in a folder |
| get_folders | GET /contacts/folders | Get all folders |
| get_list | GET /contacts/lists/{listId} | Get a list's details |
| get_lists | GET /contacts/lists | Get all the lists |
| get_segments | GET /contacts/segments | Get all the Segments |
| import_contacts | POST /contacts/import | Import contacts |
| remove_contact_from_list | POST /contacts/lists/{listId}/contacts/remove | Delete a contact from a list |
| request_contact_export | POST /contacts/export | Export contacts |
| update_attribute | PUT /contacts/attributes/{attributeCategory}/{attributeName} | Update contact attribute |
| update_batch_contacts | POST /contacts/batch | Update multiple contacts |
| update_contact | PUT /contacts/{identifier} | Update a contact |
| update_folder | PUT /contacts/folders/{folderId} | Update a folder |
| update_list | PUT /contacts/lists/{listId} | Update a list |
PostContactInfo add_contact_to_list(list_id, contact_emails)
Add existing contacts to a list
from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'
# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
list_id = 789 # int | Id of the list
contact_emails = brevo_python.AddContactToList() # AddContactToList | Emails addresses OR IDs OR EXT_ID attributes of the contacts
try:
# Add existing contacts to a list
api_response = api_instance.add_contact_to_list(list_id, contact_emails)
pprint(api_response)
except ApiException as e:
print("Exception when calling ContactsApi->add_contact_to_list: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| list_id | int | Id of the list | |
| contact_emails | AddContactToList | Emails addresses OR IDs OR EXT_ID attributes of the contacts |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
create_attribute(attribute_category, attribute_name, create_attribute)
Create contact attribute
from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'
# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
attribute_category = 'attribute_category_example' # str | Category of the attribute
attribute_name = 'attribute_name_example' # str | Name of the attribute
create_attribute = brevo_python.CreateAttribute() # CreateAttribute | Values to create an attribute
try:
# Create contact attribute
api_instance.create_attribute(attribute_category, attribute_name, create_attribute)
except ApiException as e:
print("Exception when calling ContactsApi->create_attribute: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| attribute_category | str | Category of the attribute | |
| attribute_name | str | Name of the attribute | |
| create_attribute | CreateAttribute | Values to create an attribute |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreateUpdateContactModel create_contact(create_contact)
Create a contact
Creates new contacts on Brevo. Contacts can be created by passing either -
1. email address of the contact (email_id),
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"}
3. ext_id
from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'
# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
create_contact = brevo_python.CreateContact() # CreateContact | Values to create a contact
try:
# Create a contact
api_response = api_instance.create_contact(create_contact)
pprint(api_response)
except ApiException as e:
print("Exception when calling ContactsApi->create_contact: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| create_contact | CreateContact | Values to create a contact |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
create_doi_contact(create_doi_contact)
Create Contact via DOI (Double-Opt-In) Flow
from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'
# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
create_doi_contact = brevo_python.CreateDoiContact() # CreateDoiContact | Values to create the Double opt-in (DOI) contact
try:
# Create Contact via DOI (Double-Opt-In) Flow
api_instance.create_doi_contact(create_doi_contact)
except ApiException as e:
print("Exception when calling ContactsApi->create_doi_contact: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| create_doi_contact | CreateDoiContact | Values to create the Double opt-in (DOI) contact |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreateModel create_folder(create_folder)
Create a folder
from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'
# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
create_folder = brevo_python.CreateUpdateFolder() # CreateUpdateFolder | Name of the folder
try:
# Create a folder
api_response = api_instance.create_folder(create_folder)
pprint(api_response)
except ApiException as e:
print("Exception when calling ContactsApi->create_folder: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| create_folder | CreateUpdateFolder | Name of the folder |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreateModel create_list(create_list)
Create a list
from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'
# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
create_list = brevo_python.CreateList() # CreateList | Values to create a list
try:
# Create a list
api_response = api_instance.create_list(create_list)
pprint(api_response)
except ApiException as e:
print("Exception when calling ContactsApi->create_list: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| create_list | CreateList | Values to create a list |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
delete_attribute(attribute_category, attribute_name)
Delete an attribute
from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'
# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
attribute_category = 'attribute_category_example' # str | Category of the attribute
attribute_name = 'attribute_name_example' # str | Name of the existing attribute
try:
# Delete an attribute
api_instance.delete_attribute(attribute_category, attribute_name)
except ApiException as e:
print("Exception when calling ContactsApi->delete_attribute: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| attribute_category | str | Category of the attribute | |
| attribute_name | str | Name of the existing attribute |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
delete_contact(identifier, identifier_type=identifier_type)
Delete a contact
There are 2 ways to delete a contact
Option 1- https://api.brevo.com/v3/contacts/{identifier}
Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={}
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.
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.
from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'
# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
identifier = 'identifier_example' # str | Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded)
identifier_type = 'identifier_type_example' # str | 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)
try:
# Delete a contact
api_instance.delete_contact(identifier, identifier_type=identifier_type)
except ApiException as e:
print("Exception when calling ContactsApi->delete_contact: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| identifier | str | Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) | |
| identifier_type | str | 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] |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
delete_folder(folder_id)
Delete a folder (and all its lists)
from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'
# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
folder_id = 789 # int | Id of the folder
try:
# Delete a folder (and all its lists)
api_instance.delete_folder(folder_id)
except ApiException as e:
print("Exception when calling ContactsApi->delete_folder: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| folder_id | int | Id of the folder |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
delete_list(list_id)
Delete a list
from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'
# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
list_id = 789 # int | Id of the list
try:
# Delete a list
api_instance.delete_list(list_id)
except ApiException as e:
print("Exception when calling ContactsApi->delete_list: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| list_id | int | Id of the list |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
delete_multi_attribute_options(attribute_type, multiple_choice_attribute, multiple_choice_attribute_option)
Delete a multiple-choice attribute option
from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'
# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
attribute_type = 'attribute_type_example' # str | Type of the attribute
multiple_choice_attribute = 'multiple_choice_attribute_example' # str | Name of the existing multiple-choice attribute
multiple_choice_attribute_option = 'multiple_choice_attribute_option_example' # str | Name of the existing multiple-choice attribute option that you want to delete
try:
# Delete a multiple-choice attribute option
api_instance.delete_multi_attribute_options(attribute_type, multiple_choice_attribute, multiple_choice_attribute_option)
except ApiException as e:
print("Exception when calling ContactsApi->delete_multi_attribute_options: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| attribute_type | str | Type of the attribute | |
| multiple_choice_attribute | str | Name of the existing multiple-choice attribute | |
| multiple_choice_attribute_option | str | Name of the existing multiple-choice attribute option that you want to delete |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetAttributes get_attributes()
List all attributes
from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'
# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
try:
# List all attributes
api_response = api_instance.get_attributes()
pprint(api_response)
except ApiException as e:
print("Exception when calling ContactsApi->get_attributes: %s\n" % e)This endpoint does not need any parameter.
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetExtendedContactDetails get_contact_info(identifier, identifier_type=identifier_type, start_date=start_date, end_date=end_date)
Get a contact's details
There are 2 ways to get a contact
Option 1- https://api.brevo.com/v3/contacts/{identifier}
Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={}
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.
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
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.
from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'
# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
identifier = 'identifier_example' # str | Email (urlencoded) OR ID of the contact OR its SMS attribute value OR EXT_ID attribute (urlencoded)
identifier_type = 'identifier_type_example' # str | 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)
start_date = 'start_date_example' # str | **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)
end_date = 'end_date_example' # str | **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)
try:
# Get a contact's details
api_response = api_instance.get_contact_info(identifier, identifier_type=identifier_type, start_date=start_date, end_date=end_date)
pprint(api_response)
except ApiException as e:
print("Exception when calling ContactsApi->get_contact_info: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| identifier | str | Email (urlencoded) OR ID of the contact OR its SMS attribute value OR EXT_ID attribute (urlencoded) | |
| identifier_type | str | 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] |
| start_date | str | 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] |
| end_date | str | 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] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetContactCampaignStats get_contact_stats(identifier, start_date=start_date, end_date=end_date)
Get email campaigns' statistics for a contact
from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'
# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
identifier = 'identifier_example' # str | Email (urlencoded) OR ID of the contact
start_date = 'start_date_example' # str | 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)
end_date = 'end_date_example' # str | 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)
try:
# Get email campaigns' statistics for a contact
api_response = api_instance.get_contact_stats(identifier, start_date=start_date, end_date=end_date)
pprint(api_response)
except ApiException as e:
print("Exception when calling ContactsApi->get_contact_stats: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| identifier | str | Email (urlencoded) OR ID of the contact | |
| start_date | str | 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] |
| end_date | str | 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] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetContacts get_contacts(limit=limit, offset=offset, modified_since=modified_since, created_since=created_since, sort=sort, segment_id=segment_id, list_ids=list_ids, filter=filter)
Get all the contacts
from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'
# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
limit = 50 # int | Number of documents per page (optional) (default to 50)
offset = 0 # int | Index of the first document of the page (optional) (default to 0)
modified_since = 'modified_since_example' # str | 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)
created_since = 'created_since_example' # str | 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 = 'desc' # str | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional) (default to desc)
segment_id = 789 # int | Id of the segment. **Either listIds or segmentId can be passed.** (optional)
list_ids = [56] # list[int] | Ids of the list. **Either listIds or segmentId can be passed.** (optional)
filter = 'filter_example' # str | 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)
try:
# Get all the contacts
api_response = api_instance.get_contacts(limit=limit, offset=offset, modified_since=modified_since, created_since=created_since, sort=sort, segment_id=segment_id, list_ids=list_ids, filter=filter)
pprint(api_response)
except ApiException as e:
print("Exception when calling ContactsApi->get_contacts: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| limit | int | Number of documents per page | [optional] [default to 50] |
| offset | int | Index of the first document of the page | [optional] [default to 0] |
| modified_since | str | 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] |
| created_since | str | 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 | str | Sort the results in the ascending/descending order of record creation. Default order is descending if `sort` is not passed | [optional] [default to desc] |
| segment_id | int | Id of the segment. Either listIds or segmentId can be passed. | [optional] |
| list_ids | list[int] | Ids of the list. Either listIds or segmentId can be passed. | [optional] |
| filter | str | 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] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetContacts get_contacts_from_list(list_id, modified_since=modified_since, limit=limit, offset=offset, sort=sort)
Get contacts in a list
from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'
# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
list_id = 789 # int | Id of the list
modified_since = 'modified_since_example' # str | 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 = 50 # int | Number of documents per page (optional) (default to 50)
offset = 0 # int | Index of the first document of the page (optional) (default to 0)
sort = 'desc' # str | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional) (default to desc)
try:
# Get contacts in a list
api_response = api_instance.get_contacts_from_list(list_id, modified_since=modified_since, limit=limit, offset=offset, sort=sort)
pprint(api_response)
except ApiException as e:
print("Exception when calling ContactsApi->get_contacts_from_list: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| list_id | int | Id of the list | |
| modified_since | str | 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 | int | Number of documents per page | [optional] [default to 50] |
| offset | int | Index of the first document of the page | [optional] [default to 0] |
| sort | str | Sort the results in the ascending/descending order of record creation. Default order is descending if `sort` is not passed | [optional] [default to desc] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetFolder get_folder(folder_id)
Returns a folder's details
from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'
# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
folder_id = 789 # int | id of the folder
try:
# Returns a folder's details
api_response = api_instance.get_folder(folder_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling ContactsApi->get_folder: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| folder_id | int | id of the folder |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetFolderLists get_folder_lists(folder_id, limit=limit, offset=offset, sort=sort)
Get lists in a folder
from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'
# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
folder_id = 789 # int | Id of the folder
limit = 10 # int | Number of documents per page (optional) (default to 10)
offset = 0 # int | Index of the first document of the page (optional) (default to 0)
sort = 'desc' # str | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional) (default to desc)
try:
# Get lists in a folder
api_response = api_instance.get_folder_lists(folder_id, limit=limit, offset=offset, sort=sort)
pprint(api_response)
except ApiException as e:
print("Exception when calling ContactsApi->get_folder_lists: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| folder_id | int | Id of the folder | |
| limit | int | Number of documents per page | [optional] [default to 10] |
| offset | int | Index of the first document of the page | [optional] [default to 0] |
| sort | str | Sort the results in the ascending/descending order of record creation. Default order is descending if `sort` is not passed | [optional] [default to desc] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetFolders get_folders(limit=limit, offset=offset, sort=sort)
Get all folders
from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'
# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
limit = 10 # int | Number of documents per page (optional) (default to 10)
offset = 0 # int | Index of the first document of the page (optional) (default to 0)
sort = 'desc' # str | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional) (default to desc)
try:
# Get all folders
api_response = api_instance.get_folders(limit=limit, offset=offset, sort=sort)
pprint(api_response)
except ApiException as e:
print("Exception when calling ContactsApi->get_folders: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| limit | int | Number of documents per page | [optional] [default to 10] |
| offset | int | Index of the first document of the page | [optional] [default to 0] |
| sort | str | Sort the results in the ascending/descending order of record creation. Default order is descending if `sort` is not passed | [optional] [default to desc] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetExtendedList get_list(list_id, start_date=start_date, end_date=end_date)
Get a list's details
from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'
# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
list_id = 789 # int | Id of the list
start_date = 'start_date_example' # str | 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)
end_date = 'end_date_example' # str | 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)
try:
# Get a list's details
api_response = api_instance.get_list(list_id, start_date=start_date, end_date=end_date)
pprint(api_response)
except ApiException as e:
print("Exception when calling ContactsApi->get_list: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| list_id | int | Id of the list | |
| start_date | str | 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] |
| end_date | str | 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] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetLists get_lists(limit=limit, offset=offset, sort=sort)
Get all the lists
from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'
# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
limit = 10 # int | Number of documents per page (optional) (default to 10)
offset = 0 # int | Index of the first document of the page (optional) (default to 0)
sort = 'desc' # str | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional) (default to desc)
try:
# Get all the lists
api_response = api_instance.get_lists(limit=limit, offset=offset, sort=sort)
pprint(api_response)
except ApiException as e:
print("Exception when calling ContactsApi->get_lists: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| limit | int | Number of documents per page | [optional] [default to 10] |
| offset | int | Index of the first document of the page | [optional] [default to 0] |
| sort | str | Sort the results in the ascending/descending order of record creation. Default order is descending if `sort` is not passed | [optional] [default to desc] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetSegments get_segments(limit, offset, sort=sort)
Get all the Segments
from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'
# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
limit = 10 # int | Number of documents per page (default to 10)
offset = 0 # int | Index of the first document of the page (default to 0)
sort = 'desc' # str | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional) (default to desc)
try:
# Get all the Segments
api_response = api_instance.get_segments(limit, offset, sort=sort)
pprint(api_response)
except ApiException as e:
print("Exception when calling ContactsApi->get_segments: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| limit | int | Number of documents per page | [default to 10] |
| offset | int | Index of the first document of the page | [default to 0] |
| sort | str | Sort the results in the ascending/descending order of record creation. Default order is descending if `sort` is not passed | [optional] [default to desc] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreatedProcessId import_contacts(request_contact_import)
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.
from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'
# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
request_contact_import = brevo_python.RequestContactImport() # 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``
try:
# Import contacts
api_response = api_instance.import_contacts(request_contact_import)
pprint(api_response)
except ApiException as e:
print("Exception when calling ContactsApi->import_contacts: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| request_contact_import | 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`` |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PostContactInfo remove_contact_from_list(list_id, contact_emails)
Delete a contact from a list
from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'
# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
list_id = 789 # int | Id of the list
contact_emails = brevo_python.RemoveContactFromList() # RemoveContactFromList | Emails addresses OR IDs OR EXT_ID attributes of the contacts
try:
# Delete a contact from a list
api_response = api_instance.remove_contact_from_list(list_id, contact_emails)
pprint(api_response)
except ApiException as e:
print("Exception when calling ContactsApi->remove_contact_from_list: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| list_id | int | Id of the list | |
| contact_emails | RemoveContactFromList | Emails addresses OR IDs OR EXT_ID attributes of the contacts |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreatedProcessId request_contact_export(request_contact_export)
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.
from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'
# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
request_contact_export = brevo_python.RequestContactExport() # RequestContactExport | Values to request a contact export
try:
# Export contacts
api_response = api_instance.request_contact_export(request_contact_export)
pprint(api_response)
except ApiException as e:
print("Exception when calling ContactsApi->request_contact_export: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| request_contact_export | RequestContactExport | Values to request a contact export |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
update_attribute(attribute_category, attribute_name, update_attribute)
Update contact attribute
from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'
# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
attribute_category = 'attribute_category_example' # str | Category of the attribute
attribute_name = 'attribute_name_example' # str | Name of the existing attribute
update_attribute = brevo_python.UpdateAttribute() # UpdateAttribute | Values to update an attribute
try:
# Update contact attribute
api_instance.update_attribute(attribute_category, attribute_name, update_attribute)
except ApiException as e:
print("Exception when calling ContactsApi->update_attribute: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| attribute_category | str | Category of the attribute | |
| attribute_name | str | Name of the existing attribute | |
| update_attribute | UpdateAttribute | Values to update an attribute |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
update_batch_contacts(update_batch_contacts)
Update multiple contacts
from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'
# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
update_batch_contacts = brevo_python.UpdateBatchContacts() # UpdateBatchContacts | Values to update multiple contacts
try:
# Update multiple contacts
api_instance.update_batch_contacts(update_batch_contacts)
except ApiException as e:
print("Exception when calling ContactsApi->update_batch_contacts: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| update_batch_contacts | UpdateBatchContacts | Values to update multiple contacts |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
update_contact(identifier, update_contact, identifier_type=identifier_type)
Update a contact
There are 2 ways to update a contact
Option 1- https://api.brevo.com/v3/contacts/{identifier}
Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={}
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.
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
from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'
# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
identifier = 'identifier_example' # str | 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
update_contact = brevo_python.UpdateContact() # UpdateContact | Values to update a contact
identifier_type = 'identifier_type_example' # str | 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)
try:
# Update a contact
api_instance.update_contact(identifier, update_contact, identifier_type=identifier_type)
except ApiException as e:
print("Exception when calling ContactsApi->update_contact: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| identifier | str | 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 | |
| update_contact | UpdateContact | Values to update a contact | |
| identifier_type | str | 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] |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
update_folder(folder_id, update_folder)
Update a folder
from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'
# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
folder_id = 789 # int | Id of the folder
update_folder = brevo_python.CreateUpdateFolder() # CreateUpdateFolder | Name of the folder
try:
# Update a folder
api_instance.update_folder(folder_id, update_folder)
except ApiException as e:
print("Exception when calling ContactsApi->update_folder: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| folder_id | int | Id of the folder | |
| update_folder | CreateUpdateFolder | Name of the folder |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
update_list(list_id, update_list)
Update a list
from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'
# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
list_id = 789 # int | Id of the list
update_list = brevo_python.UpdateList() # UpdateList | Values to update a list
try:
# Update a list
api_instance.update_list(list_id, update_list)
except ApiException as e:
print("Exception when calling ContactsApi->update_list: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| list_id | int | Id of the list | |
| update_list | UpdateList | Values to update a list |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]