Python client for TingTing
Project description
TingTing Python Client
A lightweight Python client for interacting with the TingTing API.
Easily create and manage SMS/voice campaigns, contacts, and more — all from Python.
📦 Installation
pip install tingting
🚀 Quickstart Example
import os
from dotenv import load_dotenv
from tingting import Campaign, Category, Contact, Services, TingTingClient
# Load environment variables (BASE_URL, TOKEN)
load_dotenv()
BASE_URL = os.environ.get("BASE_URL", "https://app.tingting.io")
TOKEN = os.environ.get("TOKEN", "your_api_token_here")
# Initialize client
client = TingTingClient(BASE_URL, TOKEN)
# Fetch available dialers & voices
dialers = client.get_dialers()
voices = client.get_voices()
# Create a campaign
campaign = Campaign(
client=client,
name="Phone Campaign Name",
services=Services.PHONE,
category=Category.TEXT,
message="This is the phone message to be said",
dialers=dialers,
voice=voices[0],
lengthFactor=1, # Only works for premium voice
).create()
# Add contacts to the campaign
for i in range(4):
contact = Contact(
client=client,
phoneNumber=str(9990000000 + i),
attributes={"name": "John", "age": 100 + i},
)
campaign.add_contact(contact)
# Run the campaign
campaign.run()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tingting-1.0.1.tar.gz
(10.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
tingting-1.0.1-py3-none-any.whl
(14.0 kB
view details)
File details
Details for the file tingting-1.0.1.tar.gz.
File metadata
- Download URL: tingting-1.0.1.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ede0c3f9522225c5285a095192312944df4df520e38d95f1bdb7104238f7fcfe
|
|
| MD5 |
5a238dc59602cabdfb2f52a35d293581
|
|
| BLAKE2b-256 |
ed607012476a8760cfceb8f9819e6e1ec50c8b3709e42ceb9931ec0d29cd66de
|
File details
Details for the file tingting-1.0.1-py3-none-any.whl.
File metadata
- Download URL: tingting-1.0.1-py3-none-any.whl
- Upload date:
- Size: 14.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3410be6453476f457ce437786e761c15a6ab514b6388b7cb43fbd76cc665731
|
|
| MD5 |
bb8fafbd500e6094d2bbc8d9805fd670
|
|
| BLAKE2b-256 |
03f7b075b182bee61d584b77fe38d0b50986ee1215cb2690a76b828947cb3d90
|