Official Python SDK for the VZaps public API.
Project description
VZaps Python SDK
Official Python SDK for the VZaps public API.
Requirements
- Python 3.10+
client_tokenandclient_secretfrom VZapsinstance_tokenfor instance-scoped operations
Installation
pip install vzaps
For local development:
pip install -e ".[dev]"
Quick Start
from vzaps import VZapsClient
with VZapsClient(
client_token="your-client-token",
client_secret="your-client-secret",
) as client:
instances = client.instances.list()
print(instances)
Send a text message:
from vzaps import VZapsClient
client = VZapsClient(client_token="...", client_secret="...")
client.messages.send_text(
instance_id="VZ...",
instance_token="instance-token",
phone="5511999999999",
message="Hello from Python",
)
client.close()
Async
from vzaps import AsyncVZapsClient
async with AsyncVZapsClient(
client_token="your-client-token",
client_secret="your-client-secret",
) as client:
await client.messages.send_text(
instance_id="VZ...",
instance_token="instance-token",
phone="5511999999999",
message="Hello from async Python",
)
Authentication
The SDK exchanges client_token and client_secret for an access token using POST /token.
Tokens are cached and refreshed before expiration. Requests include:
Authorization: Bearer <access_token>X-Client-TokenX-Instance-Tokenwhen the call is scoped to an instance
Resources
The client exposes:
authinstancessessionsmessageswebhookscontactsgroupsusersqueuestypebotschatwootchatsevents
All request arguments use Python snake_case.
Generic Request
client.request(
"POST",
"/instances/get",
body={"id": "VZ..."},
)
Realtime
Realtime subscriptions are async-first:
async with AsyncVZapsClient(client_token="...", client_secret="...") as client:
async with client.events.subscribe(
instance_id="VZ...",
instance_token="instance-token",
events=["Message", "Connected"],
) as sub:
@sub.on("Message")
async def handle_message(event):
print(event.id, event.data)
await sub.wait_closed()
Handlers registered for All receive every event. The SDK sends an ack after handlers
complete and reconnects by default with last_event_id tracking.
Errors
from vzaps import VZapsAPIError, VZapsAuthenticationError, VZapsRateLimitError
try:
client.instances.get("VZ...")
except VZapsAuthenticationError:
...
except VZapsRateLimitError:
...
except VZapsAPIError as exc:
print(exc.status_code, exc.details)
Documentation
See docs.vzaps.com for API and SDK guides.
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
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 vzaps-0.1.0.tar.gz.
File metadata
- Download URL: vzaps-0.1.0.tar.gz
- Upload date:
- Size: 16.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5818d5c0a30e71c3cb9c676e7e5b510a8847eb064928b4b3b7e0e48f0b5e9fc3
|
|
| MD5 |
ce0d12a891b4201b09154589df3b352e
|
|
| BLAKE2b-256 |
6ab73a004754f40c34ea6f796fd1571f695fa4d2c9d724db822f8b8e1ddde905
|
Provenance
The following attestation bundles were made for vzaps-0.1.0.tar.gz:
Publisher:
release.yml on VZaps/vzaps-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vzaps-0.1.0.tar.gz -
Subject digest:
5818d5c0a30e71c3cb9c676e7e5b510a8847eb064928b4b3b7e0e48f0b5e9fc3 - Sigstore transparency entry: 1960883038
- Sigstore integration time:
-
Permalink:
VZaps/vzaps-sdk-python@a87043c1e800e92dc9e48342a6dfedc38ccf08c3 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/VZaps
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a87043c1e800e92dc9e48342a6dfedc38ccf08c3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file vzaps-0.1.0-py3-none-any.whl.
File metadata
- Download URL: vzaps-0.1.0-py3-none-any.whl
- Upload date:
- Size: 20.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2754962047a591adf2ea1a38eddcb7470b2a1dbc860dd14bc3a35d9113e458f4
|
|
| MD5 |
4e517007b8c9c95c1d5cc131002fcb8b
|
|
| BLAKE2b-256 |
ab17019ca1b09efab0197dfd9b4ae6aa995b7dfdeed2351ff78b0fe072a7e2b0
|
Provenance
The following attestation bundles were made for vzaps-0.1.0-py3-none-any.whl:
Publisher:
release.yml on VZaps/vzaps-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vzaps-0.1.0-py3-none-any.whl -
Subject digest:
2754962047a591adf2ea1a38eddcb7470b2a1dbc860dd14bc3a35d9113e458f4 - Sigstore transparency entry: 1960883163
- Sigstore integration time:
-
Permalink:
VZaps/vzaps-sdk-python@a87043c1e800e92dc9e48342a6dfedc38ccf08c3 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/VZaps
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a87043c1e800e92dc9e48342a6dfedc38ccf08c3 -
Trigger Event:
push
-
Statement type: