All URIs are relative to https://api.sendinblue.com/v3
Method | HTTP request | Description |
---|---|---|
create_smtp_template | POST /smtp/templates | Create an smtp template |
delete_hardbounces | POST /smtp/deleteHardbounces | Delete hardbounces |
delete_smtp_template | DELETE /smtp/templates/{templateId} | Delete an inactive smtp template |
get_aggregated_smtp_report | GET /smtp/statistics/aggregatedReport | Get your SMTP activity aggregated over a period of time |
get_email_event_report | GET /smtp/statistics/events | Get all your SMTP activity (unaggregated events) |
get_smtp_report | GET /smtp/statistics/reports | Get your SMTP activity aggregated per day |
get_smtp_template | GET /smtp/templates/{templateId} | Returns the template informations |
get_smtp_templates | GET /smtp/templates | Get the list of SMTP templates |
send_template | POST /smtp/templates/{templateId}/send | Send a template |
send_test_template | POST /smtp/templates/{templateId}/sendTest | Send a template to your test list |
send_transac_email | POST /smtp/email | Send a transactional email |
update_smtp_template | PUT /smtp/templates/{templateId} | Updates an smtp templates |
CreateModel create_smtp_template(smtp_template)
Create an smtp template
from __future__ import print_function
import time
import sib_api_v3_sdk
from sib_api_v3_sdk.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = sib_api_v3_sdk.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 = sib_api_v3_sdk.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 = sib_api_v3_sdk.SMTPApi(sib_api_v3_sdk.ApiClient(configuration))
smtp_template = sib_api_v3_sdk.CreateSmtpTemplate() # CreateSmtpTemplate | values to update in smtp template
try:
# Create an smtp template
api_response = api_instance.create_smtp_template(smtp_template)
pprint(api_response)
except ApiException as e:
print("Exception when calling SMTPApi->create_smtp_template: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
smtp_template | CreateSmtpTemplate | values to update in smtp template |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
delete_hardbounces(delete_hardbounces=delete_hardbounces)
Delete hardbounces
Delete hardbounces. To use carefully (e.g. in case of temporary ISP failures)
from __future__ import print_function
import time
import sib_api_v3_sdk
from sib_api_v3_sdk.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = sib_api_v3_sdk.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 = sib_api_v3_sdk.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 = sib_api_v3_sdk.SMTPApi(sib_api_v3_sdk.ApiClient(configuration))
delete_hardbounces = sib_api_v3_sdk.DeleteHardbounces() # DeleteHardbounces | values to delete hardbounces (optional)
try:
# Delete hardbounces
api_instance.delete_hardbounces(delete_hardbounces=delete_hardbounces)
except ApiException as e:
print("Exception when calling SMTPApi->delete_hardbounces: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
delete_hardbounces | DeleteHardbounces | values to delete hardbounces | [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_smtp_template(template_id)
Delete an inactive smtp template
from __future__ import print_function
import time
import sib_api_v3_sdk
from sib_api_v3_sdk.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = sib_api_v3_sdk.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 = sib_api_v3_sdk.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 = sib_api_v3_sdk.SMTPApi(sib_api_v3_sdk.ApiClient(configuration))
template_id = 789 # int | id of the template
try:
# Delete an inactive smtp template
api_instance.delete_smtp_template(template_id)
except ApiException as e:
print("Exception when calling SMTPApi->delete_smtp_template: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
template_id | int | id of the template |
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]
GetAggregatedReport get_aggregated_smtp_report(start_date=start_date, end_date=end_date, days=days, tag=tag)
Get your SMTP activity aggregated over a period of time
from __future__ import print_function
import time
import sib_api_v3_sdk
from sib_api_v3_sdk.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = sib_api_v3_sdk.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 = sib_api_v3_sdk.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 = sib_api_v3_sdk.SMTPApi(sib_api_v3_sdk.ApiClient(configuration))
start_date = 'start_date_example' # str | Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional)
end_date = 'end_date_example' # str | Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional)
days = 56 # int | Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional)
tag = 'tag_example' # str | Tag of the emails (optional)
try:
# Get your SMTP activity aggregated over a period of time
api_response = api_instance.get_aggregated_smtp_report(start_date=start_date, end_date=end_date, days=days, tag=tag)
pprint(api_response)
except ApiException as e:
print("Exception when calling SMTPApi->get_aggregated_smtp_report: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
start_date | str | Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate | [optional] |
end_date | str | Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate | [optional] |
days | int | Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' | [optional] |
tag | str | Tag of the emails | [optional] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetEmailEventReport get_email_event_report(limit=limit, offset=offset, start_date=start_date, end_date=end_date, days=days, email=email, event=event, tags=tags, message_id=message_id, template_id=template_id)
Get all your SMTP activity (unaggregated events)
from __future__ import print_function
import time
import sib_api_v3_sdk
from sib_api_v3_sdk.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = sib_api_v3_sdk.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 = sib_api_v3_sdk.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 = sib_api_v3_sdk.SMTPApi(sib_api_v3_sdk.ApiClient(configuration))
limit = 50 # int | Number limitation for the result returned (optional) (default to 50)
offset = 0 # int | Beginning point in the list to retrieve from. (optional) (default to 0)
start_date = 'start_date_example' # str | Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional)
end_date = 'end_date_example' # str | Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional)
days = 56 # int | Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional)
email = 'email_example' # str | Filter the report for a specific email addresses (optional)
event = 'event_example' # str | Filter the report for a specific event type (optional)
tags = 'tags_example' # str | Filter the report for tags (serialized and urlencoded array) (optional)
message_id = 'message_id_example' # str | Filter on a specific message id (optional)
template_id = 789 # int | Filter on a specific template id (optional)
try:
# Get all your SMTP activity (unaggregated events)
api_response = api_instance.get_email_event_report(limit=limit, offset=offset, start_date=start_date, end_date=end_date, days=days, email=email, event=event, tags=tags, message_id=message_id, template_id=template_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling SMTPApi->get_email_event_report: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
limit | int | Number limitation for the result returned | [optional] [default to 50] |
offset | int | Beginning point in the list to retrieve from. | [optional] [default to 0] |
start_date | str | Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate | [optional] |
end_date | str | Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate | [optional] |
days | int | Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' | [optional] |
str | Filter the report for a specific email addresses | [optional] | |
event | str | Filter the report for a specific event type | [optional] |
tags | str | Filter the report for tags (serialized and urlencoded array) | [optional] |
message_id | str | Filter on a specific message id | [optional] |
template_id | int | Filter on a specific template id | [optional] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetReports get_smtp_report(limit=limit, offset=offset, start_date=start_date, end_date=end_date, days=days, tag=tag)
Get your SMTP activity aggregated per day
from __future__ import print_function
import time
import sib_api_v3_sdk
from sib_api_v3_sdk.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = sib_api_v3_sdk.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 = sib_api_v3_sdk.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 = sib_api_v3_sdk.SMTPApi(sib_api_v3_sdk.ApiClient(configuration))
limit = 50 # int | Number of documents returned per page (optional) (default to 50)
offset = 0 # int | Index of the first document on the page (optional) (default to 0)
start_date = 'start_date_example' # str | Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) (optional)
end_date = 'end_date_example' # str | Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) (optional)
days = 56 # int | Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional)
tag = 'tag_example' # str | Tag of the emails (optional)
try:
# Get your SMTP activity aggregated per day
api_response = api_instance.get_smtp_report(limit=limit, offset=offset, start_date=start_date, end_date=end_date, days=days, tag=tag)
pprint(api_response)
except ApiException as e:
print("Exception when calling SMTPApi->get_smtp_report: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
limit | int | Number of documents returned per page | [optional] [default to 50] |
offset | int | Index of the first document on the page | [optional] [default to 0] |
start_date | str | Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) | [optional] |
end_date | str | Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) | [optional] |
days | int | Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' | [optional] |
tag | str | Tag of the emails | [optional] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetSmtpTemplateOverview get_smtp_template(template_id)
Returns the template informations
from __future__ import print_function
import time
import sib_api_v3_sdk
from sib_api_v3_sdk.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = sib_api_v3_sdk.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 = sib_api_v3_sdk.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 = sib_api_v3_sdk.SMTPApi(sib_api_v3_sdk.ApiClient(configuration))
template_id = 789 # int | id of the template
try:
# Returns the template informations
api_response = api_instance.get_smtp_template(template_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling SMTPApi->get_smtp_template: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
template_id | int | id of the template |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetSmtpTemplates get_smtp_templates(template_status=template_status, limit=limit, offset=offset)
Get the list of SMTP templates
from __future__ import print_function
import time
import sib_api_v3_sdk
from sib_api_v3_sdk.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = sib_api_v3_sdk.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 = sib_api_v3_sdk.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 = sib_api_v3_sdk.SMTPApi(sib_api_v3_sdk.ApiClient(configuration))
template_status = true # bool | Filter on the status of the template. Active = true, inactive = false (optional)
limit = 50 # int | Number of documents returned per page (optional) (default to 50)
offset = 0 # int | Index of the first document in the page (optional) (default to 0)
try:
# Get the list of SMTP templates
api_response = api_instance.get_smtp_templates(template_status=template_status, limit=limit, offset=offset)
pprint(api_response)
except ApiException as e:
print("Exception when calling SMTPApi->get_smtp_templates: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
template_status | bool | Filter on the status of the template. Active = true, inactive = false | [optional] |
limit | int | Number of documents returned per page | [optional] [default to 50] |
offset | int | Index of the first document in the page | [optional] [default to 0] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SendTemplateEmail send_template(template_id, send_email)
Send a template
This endpoint is deprecated. Prefer v3/smtp/email instead.
from __future__ import print_function
import time
import sib_api_v3_sdk
from sib_api_v3_sdk.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = sib_api_v3_sdk.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 = sib_api_v3_sdk.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 = sib_api_v3_sdk.SMTPApi(sib_api_v3_sdk.ApiClient(configuration))
template_id = 789 # int | Id of the template
send_email = sib_api_v3_sdk.SendEmail() # SendEmail |
try:
# Send a template
api_response = api_instance.send_template(template_id, send_email)
pprint(api_response)
except ApiException as e:
print("Exception when calling SMTPApi->send_template: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
template_id | int | Id of the template | |
send_email | SendEmail |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
send_test_template(template_id, send_test_email)
Send a template to your test list
from __future__ import print_function
import time
import sib_api_v3_sdk
from sib_api_v3_sdk.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = sib_api_v3_sdk.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 = sib_api_v3_sdk.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 = sib_api_v3_sdk.SMTPApi(sib_api_v3_sdk.ApiClient(configuration))
template_id = 789 # int | Id of the template
send_test_email = sib_api_v3_sdk.SendTestEmail() # SendTestEmail |
try:
# Send a template to your test list
api_instance.send_test_template(template_id, send_test_email)
except ApiException as e:
print("Exception when calling SMTPApi->send_test_template: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
template_id | int | Id of the template | |
send_test_email | SendTestEmail |
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]
CreateSmtpEmail send_transac_email(send_smtp_email)
Send a transactional email
from __future__ import print_function
import time
import sib_api_v3_sdk
from sib_api_v3_sdk.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = sib_api_v3_sdk.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 = sib_api_v3_sdk.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 = sib_api_v3_sdk.SMTPApi(sib_api_v3_sdk.ApiClient(configuration))
send_smtp_email = sib_api_v3_sdk.SendSmtpEmail() # SendSmtpEmail | Values to send a transactional email
try:
# Send a transactional email
api_response = api_instance.send_transac_email(send_smtp_email)
pprint(api_response)
except ApiException as e:
print("Exception when calling SMTPApi->send_transac_email: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
send_smtp_email | SendSmtpEmail | Values to send a transactional email |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
update_smtp_template(template_id, smtp_template)
Updates an smtp templates
from __future__ import print_function
import time
import sib_api_v3_sdk
from sib_api_v3_sdk.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = sib_api_v3_sdk.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 = sib_api_v3_sdk.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 = sib_api_v3_sdk.SMTPApi(sib_api_v3_sdk.ApiClient(configuration))
template_id = 789 # int | id of the template
smtp_template = sib_api_v3_sdk.UpdateSmtpTemplate() # UpdateSmtpTemplate | values to update in smtp template
try:
# Updates an smtp templates
api_instance.update_smtp_template(template_id, smtp_template)
except ApiException as e:
print("Exception when calling SMTPApi->update_smtp_template: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
template_id | int | id of the template | |
smtp_template | UpdateSmtpTemplate | values to update in smtp template |
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]