Quickstart Guide
Get up and running with the Audian API in just 5 minutes. This guide demonstrates authenticating and making your first API calls.
What You'll Needā
- Your API key (from my.audian.com)
- A tool to make HTTP requests (curl, Postman, or your preferred language)
1. Authenticateā
First, exchange your API key for an auth token:
curl -X PUT https://api.audian.com:8443/v2/api_auth \
-H "Content-Type: application/json" \
-d '{"data": {"api_key": "YOUR_API_KEY"}}'
Response:
{
"auth_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"data": {
"account_id": "abc123def456",
"owner_id": "user_xyz789"
},
"status": "success"
}
Save the auth_token and account_id for subsequent requests.
2. List Usersā
Get all users in your account:
curl -X GET "https://api.audian.com:8443/v2/accounts/{ACCOUNT_ID}/users?paginate=false" \
-H "X-Auth-Token: {AUTH_TOKEN}" \
-H "Accept: application/json"
Response:
{
"auth_token": "eyJhbGciOiJSUzI1...",
"data": [
{
"id": "user_abc123",
"first_name": "John",
"last_name": "Doe",
"email": "john@example.com",
"username": "johndoe"
}
],
"status": "success"
}
3. Create a Userā
Add a new user to your account:
curl -X PUT "https://api.audian.com:8443/v2/accounts/{ACCOUNT_ID}/users" \
-H "X-Auth-Token: {AUTH_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"data": {
"first_name": "Jane",
"last_name": "Smith",
"email": "jane@example.com",
"username": "janesmith"
}
}'
Response:
{
"auth_token": "eyJhbGciOiJSUzI1...",
"data": {
"id": "user_def456",
"first_name": "Jane",
"last_name": "Smith",
"email": "jane@example.com",
"username": "janesmith"
},
"status": "success"
}
4. Create a Deviceā
Add a phone device for the user:
curl -X PUT "https://api.audian.com:8443/v2/accounts/{ACCOUNT_ID}/devices" \
-H "X-Auth-Token: {AUTH_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"data": {
"name": "Jane Desk Phone",
"device_type": "sip_device",
"owner_id": "user_def456",
"sip": {
"username": "jane_phone",
"password": "secure_password_123"
}
}
}'
Response:
{
"auth_token": "eyJhbGciOiJSUzI1...",
"data": {
"id": "device_ghi789",
"name": "Jane Desk Phone",
"device_type": "sip_device",
"owner_id": "user_def456",
"enabled": true,
"sip": {
"username": "jane_phone",
"realm": "sip.audian.com"
}
},
"status": "success"
}
5. List Phone Numbersā
View your available phone numbers:
curl -X GET "https://api.audian.com:8443/v2/accounts/{ACCOUNT_ID}/phone_numbers?paginate=false" \
-H "X-Auth-Token: {AUTH_TOKEN}" \
-H "Accept: application/json"
Complete Python Exampleā
Here's a complete Python script combining all steps:
import requests
API_KEY = 'your_api_key_here'
BASE_URL = 'https://api.audian.com:8443/v2'
# Step 1: Authenticate
print("Authenticating...")
auth_response = requests.put(
f'{BASE_URL}/api_auth',
json={'data': {'api_key': API_KEY}}
)
auth_data = auth_response.json()
auth_token = auth_data['auth_token']
account_id = auth_data['data']['account_id']
print(f"ā Authenticated. Account ID: {account_id}")
headers = {
'X-Auth-Token': auth_token,
'Accept': 'application/json'
}
# Step 2: List existing users
print("\nListing users...")
users_response = requests.get(
f'{BASE_URL}/accounts/{account_id}/users?paginate=false',
headers=headers
)
users = users_response.json()['data']
print(f"ā Found {len(users)} users")
for user in users:
print(f" - {user['first_name']} {user['last_name']} ({user['email']})")
# Step 3: Create a new user
print("\nCreating new user...")
new_user_response = requests.put(
f'{BASE_URL}/accounts/{account_id}/users',
headers={**headers, 'Content-Type': 'application/json'},
json={
'data': {
'first_name': 'Test',
'last_name': 'User',
'email': 'test@example.com',
'username': 'testuser'
}
}
)
new_user = new_user_response.json()['data']
print(f"ā Created user: {new_user['id']}")
# Step 4: Create a device for the user
print("\nCreating device...")
device_response = requests.put(
f'{BASE_URL}/accounts/{account_id}/devices',
headers={**headers, 'Content-Type': 'application/json'},
json={
'data': {
'name': 'Test User Phone',
'device_type': 'sip_device',
'owner_id': new_user['id'],
'sip': {
'username': 'testuser_phone',
'password': 'secure_password'
}
}
}
)
device = device_response.json()['data']
print(f"ā Created device: {device['id']}")
print("\nā
Quickstart complete!")
Key Conceptsā
| Concept | Description |
|---|---|
| Auth Token | Temporary token from API key exchange |
| Account ID | Your organization identifier |
| X-Auth-Token | Header for authenticated requests |
| PUT | HTTP method to create resources |
| POST | HTTP method to update resources |
| Data wrapper | All request bodies use {"data": {...}} |
Next Stepsā
Now that you've made your first API calls:
- Users API - Learn more about managing users
- Devices API - Configure phones and endpoints
- Call Control - Set up call routing
- Webhooks - Get real-time event notifications
Need Help?ā
- Check the Error Handling Guide
- Review API Basics
- Contact support: support@audian.com