A client for interacting with the CallNowUSA API
Project description
CallNowUSA
A Python client for the CallNowUSA API to send messages and manage calls.
Installation
pip install callnowusa
Usage
from callnowusa import Client
# Initialize CallNowUSA client
account_sid = 'YOUR_ACCOUNT_SID' # e.g., 'SID_xxx...'
auth_token = 'YOUR_AUTH_TOKEN' # e.g., 'AUTH_xxx...'
callnowusa_number = 'default' # or your assigned CallNowUSA number
client = Client(account_sid, auth_token, callnowusa_number)
# Numbers to interact with
to_number = '+19876543210'
to_number2 = '+10987654321'
# 1. Send SMS
try:
message = client.messages.create(
body="Test message from CallNowUSA.",
from_=callnowusa_number,
to=to_number
)
print(f"Message SID: {message.sid}")
print(f"Message Response: {message.fetch()}")
except Exception as e:
print(f"Error sending message: {e}")
# 2. Direct Call
try:
call = client.calls.create(
to=to_number,
from_=callnowusa_number,
auto_hang=False # False keeps call active; True hangs up after connect
)
print(f"Direct Call SID: {call.sid}")
print(f"Direct Call Response: {call.fetch()}")
except Exception as e:
print(f"Error initiating direct call: {e}")
# 3. Merge Call
try:
merge_call = client.calls.merge(
phone_1=to_number,
phone_2=to_number2,
from_=callnowusa_number
)
print(f"Merge Call SID: {merge_call.sid}")
print(f"Merge Call Response: {merge_call.fetch()}")
except Exception as e:
print(f"Error initiating merge call: {e}")
Requirements
- Python 3.7+
requests(installed automatically viapip)
Setup
- Get
account_sid,auth_token, andcallnowusa_numberfrom the CallNowUSA dashboard. - Install the package using the command above.
- Replace placeholders in the usage examples with your credentials.
License
MIT
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
callnowusa-0.1.0.tar.gz
(3.5 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
File details
Details for the file callnowusa-0.1.0.tar.gz.
File metadata
- Download URL: callnowusa-0.1.0.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f84f9560882fe15d8f67dfc94fc3e7225b5c71304809a7ec0d49e47ece2877c
|
|
| MD5 |
d211127151f032559376223483d256d5
|
|
| BLAKE2b-256 |
17c0bfec7b414d7caef52d74dc663e2c279ad32c38cb31d2e6af6f4b679d9ab1
|
File details
Details for the file callnowusa-0.1.0-py3-none-any.whl.
File metadata
- Download URL: callnowusa-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67177960145232011e468e185b8e96f7653ad61335d2131ba10a01fb106e1ecb
|
|
| MD5 |
85185b900f4f99a911587a7815306a5b
|
|
| BLAKE2b-256 |
b0ea19ca36a05dc83bcb93d874e6cf9653d4348b9197fdd3d3f67fe528cf6458
|