Skip to main content

A tiny client wrapper for the Sendblue API in Python

Project description

Sendblue API

Overview

This package is a Python wrapper for the Sendblue API. It provides a simple interface for sending and receiving messages.

Prerequisites

You will need to get API keys by signing up for a Sendblue account. You can do so here.

Installation

pip install sendblue-python

Usage

Initializing

from sendblue import Sendblue

# Load your key from an environment variable or secret management service
# (do not include your key directly in your code)
SENDBLUE_API_KEY = os.environ.get("SENDBLUE_API_KEY")
SENDBLUE_API_SECRET = os.environ.get("SENDBLUE_API_SECRET")

sendblue = Sendblue(SENDBLUE_API_KEY, SENDBLUE_API_SECRET)

Send Message API Call

response = sendblue.send_message('+19998887777', {
    'content': 'Hello from Sendblue!',
    'send_style': 'invisible',
    'media_url': 'https://source.unsplash.com/random.png',
    'status_callback': 'https://example.com/callback'
})

Send Group Message API call

response = sendblue.send_group_message(['+19998887777', '+19998887778'], {
    'content': 'Hello from Sendblue!',
    'send_style': 'invisible',
    'media_url': 'https://source.unsplash.com/random.png',
    'status_callback': 'https://example.com/callback'
})

Hint

You can get free api keys for testing & hobby purposes by emailing the team

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sendblue-0.1.2.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distribution

sendblue-0.1.2-py3-none-any.whl (4.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page