This is the SendinBlue Python library. It implements the various exposed APIs that you can read more about on https://apidocs.sendinblue.com.
SendinBlue API's use HTTP Authentication through an api key. You can create your api key from API Console, after you sign up for an account with SendinBlue. You must use latest version 2.0, access key, for accessing APIs.
You will need to install the following module
- requests
Compatibility:
- Python 2.7/ Python 3.x
Learn how to send email campaigns from your application using SendinBlue API.
You must sign up for SendinBlue account for using APIs. All our APIs require HTTP authentication using access key, which are accessible from your API Console.
The following guides give you a start and understanding of how to use our API.
-
You will need to first get the Access key from SendinBlue.
-
Our library supports a timeout value, default is 30 Secs, which you can pass as 3rd parameter in Mailin class Object.
-
Assuming that you have cloned this git repo, or downloaded mailin.py . You can use this small sample script to get started
from mailin import Mailin
m = Mailin("https://api.sendinblue.com/v2.0","access key",5) #Optional parameter: Timeout in Secs
data = { "type":"classic",
"status":"queued",
"page":1,
"page_limit":10
}
campaigns = m.get_campaigns_v2(data)
- To explore more, you should visit the SendinBlue API documentation.
Be sure to visit the SendinBlue official documentation website for additional information about our API.
If you find a bug, please submit the issue in Github directly.
As always, if you need additional assistance, drop us a note here
List of API calls that you can make, you can click to read more about it. Please do note that the order of parameters are important.
- get_account() - Get your account information
- get_smtp_details() - Get your SMTP account information
- create_child_account(data) - Create a Reseller child account
- update_child_account(data) - Update a Reseller child account
- delete_child_account(data) - Delete a Reseller child account
- get_reseller_child(data) - Get Reseller child accounts
- add_remove_child_credits(data) - Add/Remove Reseller child credits
- get_campaigns_v2(data) - Get list of all campaigns or of specific type or status or both
- get_campaign_v2(data) - Get specific campaign object
- create_campaign(data) - Create a campaign
- delete_campaign(data) - Delete a campaign
- update_campaign(data) - Update campaign information
- campaign_report_email(data) - Sending reports to specific emails
- campaign_recipients_export(data) - Export recipients of a campaign
- send_bat_email(data) - Send a test Email (bat)
- create_trigger_campaign(data) - Create a trigger campaign
- update_trigger_campaign(data) - Update trigger campaign information
- share_campaign(data) - Get campaign share link
- update_campaign_status(data) - Modify a campaign status
- get_folders(data) - Get list of all the folder details.
- get_folder(data) - Get all the folder details for folder with id
- create_folder(data) - Create a folder
- delete_folder(data) - Delete folder with folder id
- update_folder(data) - Update folder with folder id
- get_lists(data) - Get all the lists
- get_list(data) - Get information about a list
- create_list(data) - Create a list
- delete_list(data) - Delete a list
- update_list(data) - Updating a list
- add_users_list(data) - Add users to a list
- delete_users_list(data) - Delete users from a list
- get_attributes() - Listing all attributes
- get_attribute(data) - Listing a certain type attributes
- create_attribute(data) - Creating attributes
- delete_attribute(data) - Deleting attributes of the given type
- get_user(data) - Get information about a user/email
- create_update_user(data) - Create/Update a user information
- delete_user(data) - Deleting user from db is not permitted but this action will unlink him from all lists
- import_users(data) - Import users/emails
- export_users(data) - Export users/emails
- get_processes(data) - Get information about all background processes
- get_process(data) - Get information about a specific process
- get_senders(data) - Get information about all/specific senders
- create_sender(data) - Create a sender
- delete_sender(data) - Delete a sender
- update_sender(data) - Update a sender
- get_report(data) - Retrieve information for all report events
- get_statistics(data) - Get aggregate statistics about emails sent
- get_webhooks(data) - Get list of all registered webhooks or of specific type
- get_webhook(data) - Get information about a webhook
- create_webhook(data) - Registering a webhook
- delete_webhook(data) - Deleting a webhook
- update_webhook(data) - Editing a webhook
- delete_bounces(data) - Deleting bounces
- send_email(data) - Sending out a transactional email
- send_transactional_template(data) - Send templates created on SendinBlue, through SendinBlue smtp.
- create_template(data) - Create a template
- update_template(data) - Update template information
- send_sms(data) - Sending a SMS
- create_sms_campaign(data) - Create a SMS campaign
- update_sms_campaign(data) - Update a SMS campaign
- send_bat_sms(data) - Send a test SMS campaign
To install the mailin
module you can run python setup.py install
in the root of the distribution.
To just install the dependencies run pip install -r requirements.txt