sdkwa-whatsapp-api-client


Namesdkwa-whatsapp-api-client JSON
Version 1.0.4 PyPI version JSON
download
home_pageNone
SummaryPython SDK for SDKWA WhatsApp HTTP API
upload_time2025-10-07 10:10:35
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT
keywords whatsapp sdkwa api python sdk
VCS
bugtrack_url
requirements requests typing-extensions flask
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # SDKWA Messenger API Client - Python SDK

[![PyPI version](https://badge.fury.io/py/sdkwa-whatsapp-api-client.svg)](https://badge.fury.io/py/sdkwa-whatsapp-api-client)
[![Python](https://img.shields.io/pypi/pyversions/sdkwa-whatsapp-api-client.svg)](https://pypi.org/project/sdkwa-whatsapp-api-client/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Python SDK for the SDKWA Messenger HTTP API. Send messages, files, and manage WhatsApp and Telegram accounts programmatically.

## Features

- 🚀 **Simple & Modern**: Clean, type-safe API following Python best practices
- 📱 **Multi-Messenger Support**: Support for both WhatsApp and Telegram
- 📡 **Full API Coverage**: Support for all SDKWA API endpoints
- 🔒 **Type Safe**: Complete type hints for better development experience
- 🪝 **Webhook Support**: Built-in webhook handling for real-time notifications
- 📁 **File Handling**: Send files by URL or upload with automatic type detection
- 🔄 **Async Support**: Optional async/await support for better performance
- 📦 **Zero Config**: Works out of the box with minimal setup

## Installation

```bash
pip install sdkwa-whatsapp-api-client
```

## Quick Start

### Step 1: Authorize Your Account (Scan QR Code)

Before you can send or receive messages, you need to authorize your WhatsApp account by scanning a QR code:

```python
from sdkwa import SDKWA

# Initialize the client
client = SDKWA(
    id_instance="YOUR_INSTANCE_ID",
    api_token_instance="YOUR_API_TOKEN"
)

# Get QR code for authorization
qr_data = client.get_qr()
print(f"QR Code: {qr_data['message']}")  # Display this QR code
print(f"Scan this QR code with your WhatsApp mobile app")

# Check authorization state
state = client.get_state_instance()
print(f"Account state: {state['stateInstance']}")
# Wait until state is "authorized" before sending messages
```

### Step 2: Send and Receive Messages

Once your account is authorized (QR code is scanned), you can start sending messages:

```python
from sdkwa import SDKWA

# Initialize the client (WhatsApp is the default messenger)
client = SDKWA(
    id_instance="YOUR_INSTANCE_ID",
    api_token_instance="YOUR_API_TOKEN"
)

# Send a text message
response = client.send_message(
    chat_id="1234567890@c.us",
    message="Hello from SDKWA! 👋"
)
print(f"Message sent with ID: {response['idMessage']}")

# Send a file
response = client.send_file_by_url(
    chat_id="1234567890@c.us",
    url_file="https://example.com/image.jpg",
    file_name="image.jpg",
    caption="Check out this image!"
)

# Get account state
state = client.get_state_instance()
print(f"Account state: {state['stateInstance']}")
```

### Using Telegram

For Telegram, you need to authorize using a confirmation code instead of QR:

```python
from sdkwa import SDKWA

# Create client and use messenger parameter for Telegram calls
client = SDKWA(
    id_instance="YOUR_INSTANCE_ID",
    api_token_instance="YOUR_API_TOKEN"
)

# Step 1: Authorize with Telegram
# Send confirmation code to your phone number
client.send_confirmation_code(phone_number=1234567890, messenger="telegram")

# Step 2: Enter the code you received
client.sign_in_with_confirmation_code(code="YOUR_CODE", messenger="telegram")

# Step 3: Now you can send messages
response = client.send_message(
    chat_id="1234567890",
    message="Hello from SDKWA Telegram! 👋",
    messenger="telegram"
)

# Telegram-specific methods
app = client.create_app(
    title="My App",
    short_name="myapp",
    url="https://myapp.com",
    description="My awesome Telegram app",
    messenger="telegram"
)
```

## API Reference

### Account Management

```python
# Get account settings
settings = client.get_settings()

# Update settings
client.set_settings({
    "webhookUrl": "https://your-webhook-url.com",
    "delaySendMessagesMilliseconds": 1000
})

# Get QR code for authorization
qr_data = client.get_qr()

# Get account state
state = client.get_state_instance()
print(f"Account state: {state['stateInstance']}")

# Reboot instance
client.reboot()

# Logout
client.logout()
```

### Sending Messages

```python
# Text message
client.send_message(
    chat_id="1234567890@c.us",
    message="Hello World!",
    quoted_message_id="optional_message_id",  # Reply to message
    link_preview=True  # Enable link previews
)

# Send contact
client.send_contact(
    chat_id="1234567890@c.us",
    contact={
        "phoneContact": 1234567890,
        "firstName": "John",
        "lastName": "Doe",
        "company": "Example Corp"
    }
)

# Send location
client.send_location(
    chat_id="1234567890@c.us",
    name_location="My Location",
    address="123 Main St",
    latitude=40.7128,
    longitude=-74.0060
)
```

### File Operations

```python
# Send file by URL
client.send_file_by_url(
    chat_id="1234567890@c.us",
    url_file="https://example.com/document.pdf",
    file_name="document.pdf",
    caption="Important document"
)

# Upload and send file
with open("image.jpg", "rb") as file:
    client.send_file_by_upload(
        chat_id="1234567890@c.us",
        file=file,
        file_name="image.jpg",
        caption="Photo from vacation"
    )

# Download received file
file_data = client.download_file(
    chat_id="1234567890@c.us",
    id_message="MESSAGE_ID"
)
```

### Receiving Messages

```python
# Get notifications
notification = client.receive_notification()
if notification:
    print(f"New notification: {notification}")
    # Process notification...
    
    # Delete notification after processing
    client.delete_notification(notification['receiptId'])

# Get chat history
history = client.get_chat_history(
    chat_id="1234567890@c.us",
    count=50
)
```

### Groups and Contacts

```python
# Create group
group = client.create_group(
    group_name="My Group",
    chat_ids=["1234567890@c.us", "0987654321@c.us"]
)

# Get group data
group_info = client.get_group_data("GROUP_ID@g.us")

# Add participants to group
client.add_group_participant(
    group_id="GROUP_ID@g.us",
    participant_chat_id="1111111111@c.us"
)

# Remove participant from group
client.remove_group_participant(
    group_id="GROUP_ID@g.us",
    participant_chat_id="1111111111@c.us"
)

# Set group admin
client.set_group_admin(
    group_id="GROUP_ID@g.us",
    participant_chat_id="1111111111@c.us"
)

# Remove admin rights
client.remove_admin(
    group_id="GROUP_ID@g.us",
    participant_chat_id="1111111111@c.us"
)

# Update group name
client.update_group_name(
    group_id="GROUP_ID@g.us",
    group_name="New Group Name"
)

# Set group picture
with open("group_pic.jpg", "rb") as file:
    client.set_group_picture("GROUP_ID@g.us", file)

# Leave group
client.leave_group("GROUP_ID@g.us")

# Get contacts
contacts = client.get_contacts()

# Get chats
chats = client.get_chats()

# Get contact info
contact_info = client.get_contact_info("1234567890@c.us")

# Check if number has WhatsApp
has_whatsapp = client.check_whatsapp(1234567890)

# Get avatar
avatar = client.get_avatar("1234567890@c.us")

# Set profile picture
with open("profile_pic.jpg", "rb") as file:
    client.set_profile_picture(file)
```

### Chat Management

```python
# Mark chat as read
client.read_chat("1234567890@c.us")

# Mark specific message as read
client.read_chat("1234567890@c.us", id_message="MESSAGE_ID")

# Archive chat
client.archive_chat("1234567890@c.us")

# Unarchive chat
client.unarchive_chat("1234567890@c.us")

# Delete message
client.delete_message("1234567890@c.us", "MESSAGE_ID")
```

### Queue Management

```python
# Show messages in queue
queue = client.show_messages_queue()

# Clear messages queue
client.clear_messages_queue()
```

### Message History

```python
# Get last outgoing messages (last 24 hours by default)
outgoing = client.last_outgoing_messages()

# Get last outgoing messages from last 60 minutes
outgoing = client.last_outgoing_messages(minutes=60)

# Get last incoming messages
incoming = client.last_incoming_messages()
```

## Webhook Handling

```python
from flask import Flask, request
from sdkwa import WebhookHandler, WebhookType

app = Flask(__name__)
webhook_handler = WebhookHandler()

# Register event handlers
@webhook_handler.on(WebhookType.INCOMING_MESSAGE_RECEIVED)
def handle_message(notification):
    """Handle incoming message notifications."""
    sender_data = notification.get('senderData', {})
    message_data = notification.get('messageData', {})
    
    sender = sender_data.get('chatId', 'Unknown')
    sender_name = sender_data.get('senderName', 'Unknown')
    message_type = message_data.get('typeMessage', 'unknown')
    
    print(f"📥 Incoming message from {sender_name} ({sender})")
    
    if message_type == 'textMessage':
        text = message_data.get('textMessageData', {}).get('textMessage', '')
        print(f"Message: {text}")

@webhook_handler.on(WebhookType.OUTGOING_MESSAGE_STATUS)
def handle_status(notification):
    """Handle outgoing message status notifications."""
    status = notification.get('status', 'unknown')
    id_message = notification.get('idMessage', '')
    print(f"📤 Message {id_message} status: {status}")

@app.route('/webhook', methods=['POST'])
def webhook():
    webhook_handler.handle(request.json)
    return "OK"

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=5000)
```

## Telegram-Specific Methods

The SDK provides special methods for Telegram messenger:

### Create Telegram App

```python
# Create a Telegram Business app
app = client.create_app(
    title="My Business App",
    short_name="mybusiness",
    url="https://mybusiness.com",
    description="Official business application"
)
print(f"App created with ID: {app['data']['appId']}")
```

### Telegram Authorization

```python
# Send confirmation code to phone number
response = client.send_confirmation_code(phone_number=79001234567)
print(f"Confirmation code sent: {response['message']}")

# Sign in with the received code
result = client.sign_in_with_confirmation_code(code="JpkyJeAM8dQ")
print(f"Sign in successful: {result['message']}")
```

## Configuration

### Environment Variables

```bash
export SDKWA_ID_INSTANCE="your_instance_id"
export SDKWA_API_TOKEN="your_api_token"
export SDKWA_API_HOST="https://api.sdkwa.pro"  # Optional
export SDKWA_MESSENGER="whatsapp"  # Optional: 'whatsapp' or 'telegram', defaults to 'whatsapp'
```

### Constructor Options

```python
client = SDKWA(
    id_instance="your_instance_id",
    api_token_instance="your_api_token",
    api_host="https://api.sdkwa.pro",  # Optional, defaults to official API
    messenger="whatsapp",  # Optional: 'whatsapp' or 'telegram', defaults to 'whatsapp'
    user_id="your_user_id",  # Optional, for additional authentication
    user_token="your_user_token",  # Optional, for additional authentication
    timeout=30,  # Request timeout in seconds
    verify_ssl=True  # SSL verification
)
```

## Error Handling

```python
from sdkwa import APIError, AuthenticationError, ValidationError

try:
    response = client.send_message(
        chat_id="invalid_chat_id",
        message="Test message"
    )
except AuthenticationError:
    print("Invalid credentials")
except ValidationError as e:
    print(f"Validation error: {e}")
except APIError as e:
    print(f"API error: {e}")
```

## Development

### Setting up development environment

```bash
# Clone the repository
git clone https://github.com/sdkwa/whatsapp-api-client-python.git
cd whatsapp-api-client-python

# Install in development mode
pip install -e .

# Format code
python scripts/dev.py format

# Clean build artifacts
python scripts/dev.py clean

# Build package
python scripts/dev.py build

# Publish to PyPI (requires API token)
python scripts/dev.py publish
```

## Contributing

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Support

- 📚 [Documentation](https://docs.sdkwa.pro)
- 💬 [Telegram Support](https://t.me/sdkwa_support)
- 🌐 [Official Website](https://sdkwa.pro)
- 🐛 [Report Issues](https://github.com/sdkwa/whatsapp-api-client-python/issues)

## Changelog

### v1.0.0
- Initial release
- Full API coverage for SDKWA WhatsApp API
- Type-safe implementation
- Webhook support
- Comprehensive documentation and examples

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "sdkwa-whatsapp-api-client",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "whatsapp, sdkwa, api, python, sdk",
    "author": null,
    "author_email": "SDKWA Community <support@sdkwa.pro>",
    "download_url": "https://files.pythonhosted.org/packages/b0/6f/964f80e6ccb8c864a80382ce391c8117092740333da79c1a2d03efebc3ba/sdkwa_whatsapp_api_client-1.0.4.tar.gz",
    "platform": null,
    "description": "# SDKWA Messenger API Client - Python SDK\n\n[![PyPI version](https://badge.fury.io/py/sdkwa-whatsapp-api-client.svg)](https://badge.fury.io/py/sdkwa-whatsapp-api-client)\n[![Python](https://img.shields.io/pypi/pyversions/sdkwa-whatsapp-api-client.svg)](https://pypi.org/project/sdkwa-whatsapp-api-client/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nPython SDK for the SDKWA Messenger HTTP API. Send messages, files, and manage WhatsApp and Telegram accounts programmatically.\n\n## Features\n\n- \ud83d\ude80 **Simple & Modern**: Clean, type-safe API following Python best practices\n- \ud83d\udcf1 **Multi-Messenger Support**: Support for both WhatsApp and Telegram\n- \ud83d\udce1 **Full API Coverage**: Support for all SDKWA API endpoints\n- \ud83d\udd12 **Type Safe**: Complete type hints for better development experience\n- \ud83e\ude9d **Webhook Support**: Built-in webhook handling for real-time notifications\n- \ud83d\udcc1 **File Handling**: Send files by URL or upload with automatic type detection\n- \ud83d\udd04 **Async Support**: Optional async/await support for better performance\n- \ud83d\udce6 **Zero Config**: Works out of the box with minimal setup\n\n## Installation\n\n```bash\npip install sdkwa-whatsapp-api-client\n```\n\n## Quick Start\n\n### Step 1: Authorize Your Account (Scan QR Code)\n\nBefore you can send or receive messages, you need to authorize your WhatsApp account by scanning a QR code:\n\n```python\nfrom sdkwa import SDKWA\n\n# Initialize the client\nclient = SDKWA(\n    id_instance=\"YOUR_INSTANCE_ID\",\n    api_token_instance=\"YOUR_API_TOKEN\"\n)\n\n# Get QR code for authorization\nqr_data = client.get_qr()\nprint(f\"QR Code: {qr_data['message']}\")  # Display this QR code\nprint(f\"Scan this QR code with your WhatsApp mobile app\")\n\n# Check authorization state\nstate = client.get_state_instance()\nprint(f\"Account state: {state['stateInstance']}\")\n# Wait until state is \"authorized\" before sending messages\n```\n\n### Step 2: Send and Receive Messages\n\nOnce your account is authorized (QR code is scanned), you can start sending messages:\n\n```python\nfrom sdkwa import SDKWA\n\n# Initialize the client (WhatsApp is the default messenger)\nclient = SDKWA(\n    id_instance=\"YOUR_INSTANCE_ID\",\n    api_token_instance=\"YOUR_API_TOKEN\"\n)\n\n# Send a text message\nresponse = client.send_message(\n    chat_id=\"1234567890@c.us\",\n    message=\"Hello from SDKWA! \ud83d\udc4b\"\n)\nprint(f\"Message sent with ID: {response['idMessage']}\")\n\n# Send a file\nresponse = client.send_file_by_url(\n    chat_id=\"1234567890@c.us\",\n    url_file=\"https://example.com/image.jpg\",\n    file_name=\"image.jpg\",\n    caption=\"Check out this image!\"\n)\n\n# Get account state\nstate = client.get_state_instance()\nprint(f\"Account state: {state['stateInstance']}\")\n```\n\n### Using Telegram\n\nFor Telegram, you need to authorize using a confirmation code instead of QR:\n\n```python\nfrom sdkwa import SDKWA\n\n# Create client and use messenger parameter for Telegram calls\nclient = SDKWA(\n    id_instance=\"YOUR_INSTANCE_ID\",\n    api_token_instance=\"YOUR_API_TOKEN\"\n)\n\n# Step 1: Authorize with Telegram\n# Send confirmation code to your phone number\nclient.send_confirmation_code(phone_number=1234567890, messenger=\"telegram\")\n\n# Step 2: Enter the code you received\nclient.sign_in_with_confirmation_code(code=\"YOUR_CODE\", messenger=\"telegram\")\n\n# Step 3: Now you can send messages\nresponse = client.send_message(\n    chat_id=\"1234567890\",\n    message=\"Hello from SDKWA Telegram! \ud83d\udc4b\",\n    messenger=\"telegram\"\n)\n\n# Telegram-specific methods\napp = client.create_app(\n    title=\"My App\",\n    short_name=\"myapp\",\n    url=\"https://myapp.com\",\n    description=\"My awesome Telegram app\",\n    messenger=\"telegram\"\n)\n```\n\n## API Reference\n\n### Account Management\n\n```python\n# Get account settings\nsettings = client.get_settings()\n\n# Update settings\nclient.set_settings({\n    \"webhookUrl\": \"https://your-webhook-url.com\",\n    \"delaySendMessagesMilliseconds\": 1000\n})\n\n# Get QR code for authorization\nqr_data = client.get_qr()\n\n# Get account state\nstate = client.get_state_instance()\nprint(f\"Account state: {state['stateInstance']}\")\n\n# Reboot instance\nclient.reboot()\n\n# Logout\nclient.logout()\n```\n\n### Sending Messages\n\n```python\n# Text message\nclient.send_message(\n    chat_id=\"1234567890@c.us\",\n    message=\"Hello World!\",\n    quoted_message_id=\"optional_message_id\",  # Reply to message\n    link_preview=True  # Enable link previews\n)\n\n# Send contact\nclient.send_contact(\n    chat_id=\"1234567890@c.us\",\n    contact={\n        \"phoneContact\": 1234567890,\n        \"firstName\": \"John\",\n        \"lastName\": \"Doe\",\n        \"company\": \"Example Corp\"\n    }\n)\n\n# Send location\nclient.send_location(\n    chat_id=\"1234567890@c.us\",\n    name_location=\"My Location\",\n    address=\"123 Main St\",\n    latitude=40.7128,\n    longitude=-74.0060\n)\n```\n\n### File Operations\n\n```python\n# Send file by URL\nclient.send_file_by_url(\n    chat_id=\"1234567890@c.us\",\n    url_file=\"https://example.com/document.pdf\",\n    file_name=\"document.pdf\",\n    caption=\"Important document\"\n)\n\n# Upload and send file\nwith open(\"image.jpg\", \"rb\") as file:\n    client.send_file_by_upload(\n        chat_id=\"1234567890@c.us\",\n        file=file,\n        file_name=\"image.jpg\",\n        caption=\"Photo from vacation\"\n    )\n\n# Download received file\nfile_data = client.download_file(\n    chat_id=\"1234567890@c.us\",\n    id_message=\"MESSAGE_ID\"\n)\n```\n\n### Receiving Messages\n\n```python\n# Get notifications\nnotification = client.receive_notification()\nif notification:\n    print(f\"New notification: {notification}\")\n    # Process notification...\n    \n    # Delete notification after processing\n    client.delete_notification(notification['receiptId'])\n\n# Get chat history\nhistory = client.get_chat_history(\n    chat_id=\"1234567890@c.us\",\n    count=50\n)\n```\n\n### Groups and Contacts\n\n```python\n# Create group\ngroup = client.create_group(\n    group_name=\"My Group\",\n    chat_ids=[\"1234567890@c.us\", \"0987654321@c.us\"]\n)\n\n# Get group data\ngroup_info = client.get_group_data(\"GROUP_ID@g.us\")\n\n# Add participants to group\nclient.add_group_participant(\n    group_id=\"GROUP_ID@g.us\",\n    participant_chat_id=\"1111111111@c.us\"\n)\n\n# Remove participant from group\nclient.remove_group_participant(\n    group_id=\"GROUP_ID@g.us\",\n    participant_chat_id=\"1111111111@c.us\"\n)\n\n# Set group admin\nclient.set_group_admin(\n    group_id=\"GROUP_ID@g.us\",\n    participant_chat_id=\"1111111111@c.us\"\n)\n\n# Remove admin rights\nclient.remove_admin(\n    group_id=\"GROUP_ID@g.us\",\n    participant_chat_id=\"1111111111@c.us\"\n)\n\n# Update group name\nclient.update_group_name(\n    group_id=\"GROUP_ID@g.us\",\n    group_name=\"New Group Name\"\n)\n\n# Set group picture\nwith open(\"group_pic.jpg\", \"rb\") as file:\n    client.set_group_picture(\"GROUP_ID@g.us\", file)\n\n# Leave group\nclient.leave_group(\"GROUP_ID@g.us\")\n\n# Get contacts\ncontacts = client.get_contacts()\n\n# Get chats\nchats = client.get_chats()\n\n# Get contact info\ncontact_info = client.get_contact_info(\"1234567890@c.us\")\n\n# Check if number has WhatsApp\nhas_whatsapp = client.check_whatsapp(1234567890)\n\n# Get avatar\navatar = client.get_avatar(\"1234567890@c.us\")\n\n# Set profile picture\nwith open(\"profile_pic.jpg\", \"rb\") as file:\n    client.set_profile_picture(file)\n```\n\n### Chat Management\n\n```python\n# Mark chat as read\nclient.read_chat(\"1234567890@c.us\")\n\n# Mark specific message as read\nclient.read_chat(\"1234567890@c.us\", id_message=\"MESSAGE_ID\")\n\n# Archive chat\nclient.archive_chat(\"1234567890@c.us\")\n\n# Unarchive chat\nclient.unarchive_chat(\"1234567890@c.us\")\n\n# Delete message\nclient.delete_message(\"1234567890@c.us\", \"MESSAGE_ID\")\n```\n\n### Queue Management\n\n```python\n# Show messages in queue\nqueue = client.show_messages_queue()\n\n# Clear messages queue\nclient.clear_messages_queue()\n```\n\n### Message History\n\n```python\n# Get last outgoing messages (last 24 hours by default)\noutgoing = client.last_outgoing_messages()\n\n# Get last outgoing messages from last 60 minutes\noutgoing = client.last_outgoing_messages(minutes=60)\n\n# Get last incoming messages\nincoming = client.last_incoming_messages()\n```\n\n## Webhook Handling\n\n```python\nfrom flask import Flask, request\nfrom sdkwa import WebhookHandler, WebhookType\n\napp = Flask(__name__)\nwebhook_handler = WebhookHandler()\n\n# Register event handlers\n@webhook_handler.on(WebhookType.INCOMING_MESSAGE_RECEIVED)\ndef handle_message(notification):\n    \"\"\"Handle incoming message notifications.\"\"\"\n    sender_data = notification.get('senderData', {})\n    message_data = notification.get('messageData', {})\n    \n    sender = sender_data.get('chatId', 'Unknown')\n    sender_name = sender_data.get('senderName', 'Unknown')\n    message_type = message_data.get('typeMessage', 'unknown')\n    \n    print(f\"\ud83d\udce5 Incoming message from {sender_name} ({sender})\")\n    \n    if message_type == 'textMessage':\n        text = message_data.get('textMessageData', {}).get('textMessage', '')\n        print(f\"Message: {text}\")\n\n@webhook_handler.on(WebhookType.OUTGOING_MESSAGE_STATUS)\ndef handle_status(notification):\n    \"\"\"Handle outgoing message status notifications.\"\"\"\n    status = notification.get('status', 'unknown')\n    id_message = notification.get('idMessage', '')\n    print(f\"\ud83d\udce4 Message {id_message} status: {status}\")\n\n@app.route('/webhook', methods=['POST'])\ndef webhook():\n    webhook_handler.handle(request.json)\n    return \"OK\"\n\nif __name__ == '__main__':\n    app.run(host='0.0.0.0', port=5000)\n```\n\n## Telegram-Specific Methods\n\nThe SDK provides special methods for Telegram messenger:\n\n### Create Telegram App\n\n```python\n# Create a Telegram Business app\napp = client.create_app(\n    title=\"My Business App\",\n    short_name=\"mybusiness\",\n    url=\"https://mybusiness.com\",\n    description=\"Official business application\"\n)\nprint(f\"App created with ID: {app['data']['appId']}\")\n```\n\n### Telegram Authorization\n\n```python\n# Send confirmation code to phone number\nresponse = client.send_confirmation_code(phone_number=79001234567)\nprint(f\"Confirmation code sent: {response['message']}\")\n\n# Sign in with the received code\nresult = client.sign_in_with_confirmation_code(code=\"JpkyJeAM8dQ\")\nprint(f\"Sign in successful: {result['message']}\")\n```\n\n## Configuration\n\n### Environment Variables\n\n```bash\nexport SDKWA_ID_INSTANCE=\"your_instance_id\"\nexport SDKWA_API_TOKEN=\"your_api_token\"\nexport SDKWA_API_HOST=\"https://api.sdkwa.pro\"  # Optional\nexport SDKWA_MESSENGER=\"whatsapp\"  # Optional: 'whatsapp' or 'telegram', defaults to 'whatsapp'\n```\n\n### Constructor Options\n\n```python\nclient = SDKWA(\n    id_instance=\"your_instance_id\",\n    api_token_instance=\"your_api_token\",\n    api_host=\"https://api.sdkwa.pro\",  # Optional, defaults to official API\n    messenger=\"whatsapp\",  # Optional: 'whatsapp' or 'telegram', defaults to 'whatsapp'\n    user_id=\"your_user_id\",  # Optional, for additional authentication\n    user_token=\"your_user_token\",  # Optional, for additional authentication\n    timeout=30,  # Request timeout in seconds\n    verify_ssl=True  # SSL verification\n)\n```\n\n## Error Handling\n\n```python\nfrom sdkwa import APIError, AuthenticationError, ValidationError\n\ntry:\n    response = client.send_message(\n        chat_id=\"invalid_chat_id\",\n        message=\"Test message\"\n    )\nexcept AuthenticationError:\n    print(\"Invalid credentials\")\nexcept ValidationError as e:\n    print(f\"Validation error: {e}\")\nexcept APIError as e:\n    print(f\"API error: {e}\")\n```\n\n## Development\n\n### Setting up development environment\n\n```bash\n# Clone the repository\ngit clone https://github.com/sdkwa/whatsapp-api-client-python.git\ncd whatsapp-api-client-python\n\n# Install in development mode\npip install -e .\n\n# Format code\npython scripts/dev.py format\n\n# Clean build artifacts\npython scripts/dev.py clean\n\n# Build package\npython scripts/dev.py build\n\n# Publish to PyPI (requires API token)\npython scripts/dev.py publish\n```\n\n## Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Support\n\n- \ud83d\udcda [Documentation](https://docs.sdkwa.pro)\n- \ud83d\udcac [Telegram Support](https://t.me/sdkwa_support)\n- \ud83c\udf10 [Official Website](https://sdkwa.pro)\n- \ud83d\udc1b [Report Issues](https://github.com/sdkwa/whatsapp-api-client-python/issues)\n\n## Changelog\n\n### v1.0.0\n- Initial release\n- Full API coverage for SDKWA WhatsApp API\n- Type-safe implementation\n- Webhook support\n- Comprehensive documentation and examples\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python SDK for SDKWA WhatsApp HTTP API",
    "version": "1.0.4",
    "project_urls": {
        "Documentation": "https://docs.sdkwa.pro",
        "Homepage": "https://sdkwa.pro",
        "Issues": "https://github.com/sdkwa/whatsapp-api-client-python/issues",
        "Repository": "https://github.com/sdkwa/whatsapp-api-client-python"
    },
    "split_keywords": [
        "whatsapp",
        " sdkwa",
        " api",
        " python",
        " sdk"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "9399ab7740b8634615685074585deb9cc763caa868b648110bfed1311684d654",
                "md5": "4e075da247cabdee0283c8d3a138b20b",
                "sha256": "db3546acf299ffa87158669ad93b147fb22447b870caf6acc803fffa43e910eb"
            },
            "downloads": -1,
            "filename": "sdkwa_whatsapp_api_client-1.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4e075da247cabdee0283c8d3a138b20b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 15119,
            "upload_time": "2025-10-07T10:10:34",
            "upload_time_iso_8601": "2025-10-07T10:10:34.080973Z",
            "url": "https://files.pythonhosted.org/packages/93/99/ab7740b8634615685074585deb9cc763caa868b648110bfed1311684d654/sdkwa_whatsapp_api_client-1.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "b06f964f80e6ccb8c864a80382ce391c8117092740333da79c1a2d03efebc3ba",
                "md5": "6ede3d7feb9115daac0894f107bccab5",
                "sha256": "1b13a760a9c6c818018e59bc3b42a8aa85359a98f1ddc7ce00d77398dfd766df"
            },
            "downloads": -1,
            "filename": "sdkwa_whatsapp_api_client-1.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "6ede3d7feb9115daac0894f107bccab5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 24521,
            "upload_time": "2025-10-07T10:10:35",
            "upload_time_iso_8601": "2025-10-07T10:10:35.286759Z",
            "url": "https://files.pythonhosted.org/packages/b0/6f/964f80e6ccb8c864a80382ce391c8117092740333da79c1a2d03efebc3ba/sdkwa_whatsapp_api_client-1.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-07 10:10:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sdkwa",
    "github_project": "whatsapp-api-client-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "requests",
            "specs": [
                [
                    ">=",
                    "2.25.0"
                ]
            ]
        },
        {
            "name": "typing-extensions",
            "specs": [
                [
                    ">=",
                    "4.0.0"
                ]
            ]
        },
        {
            "name": "flask",
            "specs": [
                [
                    ">=",
                    "2.0.0"
                ]
            ]
        }
    ],
    "lcname": "sdkwa-whatsapp-api-client"
}
        
Elapsed time: 2.88605s