API Reference
Client
Authentication
- class nexacon.auth.Auth(client)[source]
Bases:
objectAuthentication service for external integration using nx_token
- generate_token(username: str, phone: str | None = None, email: str | None = None) Dict[str, Any][source]
Generate nx_token for a user.
This endpoint requires API key and secret key (no nx_token needed). It will auto-register the user if they don’t exist.
- Parameters:
username – User identifier (phone number or email)
phone – Optional phone number (defaults to username if starts with +)
email – Optional email address
- Returns:
Dictionary containing the generated nx_token
- Raises:
ValidationError – If username is not provided
APIError – If token generation fails
- verify_token() Dict[str, Any][source]
Verify the current nx_token is valid.
- Returns:
User information if token is valid
- Raises:
ValidationError – If no token is set
AuthenticationError – If token is invalid
Messaging
Calls
Devices
Rooms
Presence
Exceptions
Nexacon SDK Exception Classes
- exception nexacon.exceptions.NexaconError[source]
Bases:
ExceptionBase exception for all Nexacon SDK errors.
- exception nexacon.exceptions.AuthenticationError[source]
Bases:
NexaconErrorRaised when authentication fails.
- exception nexacon.exceptions.APIError(message, status_code=None, response=None)[source]
Bases:
NexaconErrorRaised when API request fails.
- exception nexacon.exceptions.RateLimitError(message, status_code=None, response=None)[source]
Bases:
APIErrorRaised when rate limit is exceeded.
- exception nexacon.exceptions.ValidationError[source]
Bases:
NexaconErrorRaised when input validation fails.