Quick Start
Initialize the Client
Initialize the client with your API keys and username. The SDK automatically generates the nx_token on the first API call:
from nexacon import NexaconClient
client = NexaconClient(
api_key="your_api_key",
secret_key="your_secret_key",
username="+255788811191", # Phone number or email
base_url="https://nxservice.quantumvision-tech.com/api/v1.0"
)
Send a Message
result = client.messaging.send(
to="+255788811191",
message="Hello from Nexacon SDK!"
)
Initiate a Call
call = client.calls.initiate_call(
to="+255788811191",
call_type="video",
room="my-room"
)
Register a Device
device = client.devices.register(
fcm_token="device_fcm_token",
platform="android",
device_name="Samsung Galaxy"
)
Manage Rooms
# List all rooms
rooms = client.rooms.list()
# Create a new room
room = client.rooms.create(
title="My Group",
description="Group chat"
)
# Add member to room
client.rooms.add_member(room["name"], nxid="user_nxid")
Check Presence
presence = client.presence.get(user="user_nxid")
Close the Client
Always close the client when done to release resources:
client.close()