The Client class is the main entry point for the OmniDimension SDK. It handles authentication, request management, and provides access to all API domains.
To use the OmniDimension SDK, you first need to initialize the Client with your API key:
1
2
3
4
5
6
import os
from omnidimension import Client
# Initialize with default production URL
api_key = os.environ.get('OMNIDIM_API_KEY', 'your_api_key_here')
client = Client(api_key)
The Client object provides access to different domains of the OmniDimension API through dedicated properties:
1
2
3
4
5
client.agent # Agent operations
client.call # Call operations
client.integrations # Integration operations
client.knowledge_base # Knowledge base operations
client.phone_number # Phone number operations
Upload, manage, and attach knowledge base files to agents.
View Knowledge Base documentation →The SDK provides an APIError class to handle API-specific errors. Here's how to use it:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import os
from omnidimension import Client, APIError
api_key = os.environ.get('OMNIDIM_API_KEY', 'your_api_key_here')
client = Client(api_key)
try:
# Make an API request
response = client.agent.list()
print(response)
except APIError as e:
print(f"API Error ({e.status_code}): {e.message}")
except Exception as e:
print(f"Unexpected error: {str(e)}")
Parameter | Type | Required | Description |
---|---|---|---|
api_key | string | Yes | Your OmniDimension API key for authentication |
base_url | string | No | The base URL for the API. Defaults to the production URL. |