Briq Python Client
Official Python client library for the Briq messaging platform API.
Overview
The Briq Python client provides a simple and intuitive interface to interact with the Briq messaging platform API. It allows you to manage workspaces, campaigns, send SMS, send Karibu Email, and send Karibu WhatsApp messages programmatically from your Python applications.
Installation
You can install the Briq client library using pip:
pip install briq
Requirements
- Python 3.7 or higher
- requests
- python-dotenv
Authentication
The Briq client requires an API key for authentication. You can provide your API key in several ways:
- Set it in your environment as
BRIQ_API_KEY - Store it in a
.envfile in your project directory - Pass it directly when initializing the client
Example .env file:
BRIQ_API_KEY=your_api_key_here
Quick Start
import briq
# Initialize the client (will load API key from environment or .env file)
client = briq.Client()
# Or set the API key manually
client.set_api_key("your_api_key_here")
# Create a workspace
workspace = client.workspace.create(
name="My Workspace",
description="A workspace for my messaging campaigns"
)
# List all workspaces
workspaces = client.workspace.list()
# Send an instant message
result = client.message.send_instant(
content="Hello from the Briq Python client!",
recipients=["255***"],
sender_id="my-sender-id"
)
# Send transactional email (Karibu Email)
accepted = client.email.send_messages(
messages=[
{
"to": "asha@example.com",
"subject": "Your receipt #10421",
"text": "Thanks. Your order is paid.",
}
],
transactional=True,
)
print(accepted["data"]["job_id"])
# Send a WhatsApp template (opens / reopens the 24-hour window)
queued = client.whatsapp.send_template(
"order_update",
to="255712345678",
variables={"1": "A1234"},
)
print(queued["data"]["message_id"])
Documentation
For detailed documentation and examples, please refer to the Official Usage Guide
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for briq 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| briq-0.3.0.tar.gz | 24.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| briq-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 45.8 kB
Release files / briq-0.3.0.tar.gz
| Download URL | briq-0.3.0.tar.gz |
|---|---|
| Size | 24.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aea4ef863a661633ad54dfc33d3205d8334b8ab6cdcf55e9f2ab6b189a0d3bbe
|
|
BLAKE2b-256 checksum How to use checksums |
52664728b7e5d911f2ecb4c646a0b30998ab08b69dcec344c7b84b2bb90d8c53
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / briq-0.3.0-py3-none-any.whl
| Download URL | briq-0.3.0-py3-none-any.whl |
|---|---|
| Size | 21.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d406b2a0b1438ea38e6f1fed37559fc871d576e5910a041c6609ab6e0b9fd24e
|
|
BLAKE2b-256 checksum How to use checksums |
7b9abe6a66e1b842ed24a232ad5a43adc8f7bc7ab35717b603f4ed155314cf14
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|