Getting Started with Audian API
This guide will walk you through setting up your development environment and making your first API request to the Audian API.
Prerequisites​
Before you begin, make sure you have:
- A valid Audian account at my.audian.com
- Basic understanding of REST APIs and JSON
- A programming language or tool to make HTTP requests (curl, Python, Node.js, etc.)
Step 1: Create an Audian Account​
- Visit my.audian.com
- Click "Sign Up" and create your account
- Verify your email address
- Log in to your dashboard
Step 2: Generate Your API Key​
- Log in to my.audian.com
- Navigate to API Keys in the sidebar
- Click Create New API Key
- Give your key a descriptive name (e.g., "Development Key")
- Click Generate
- Copy your API key immediately and store it securely
Important: Your API key is sensitive. Never share it or commit it to version control.
Step 3: Authenticate and Get Your Auth Token​
The Audian API uses a two-step authentication process:
- Exchange your API key for an auth token
- Use the auth token for subsequent API requests
Using cURL​
# Step 1: Get 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": "account_abc123",
"owner_id": "user_xyz789"
},
"status": "success"
}
# Step 2: Use the auth token for API requests
curl -X GET "https://api.audian.com:8443/v2/accounts/{ACCOUNT_ID}" \
-H "X-Auth-Token: {AUTH_TOKEN}" \
-H "Accept: application/json"
Using Python​
import requests
# Configuration
API_KEY = 'your_api_key_here'
BASE_URL = 'https://api.audian.com:8443/v2'
# Step 1: Authenticate
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"Account ID: {account_id}")
# Step 2: Make API requests
headers = {
'X-Auth-Token': auth_token,
'Accept': 'application/json'
}
response = requests.get(
f'{BASE_URL}/accounts/{account_id}',
headers=headers
)
print(response.json())
Using Node.js​
const axios = require('axios');
const API_KEY = process.env.AUDIAN_API_KEY || 'your_api_key_here';
const BASE_URL = 'https://api.audian.com:8443/v2';
async function main() {
// Step 1: Authenticate
const authResponse = await axios.put(
`${BASE_URL}/api_auth`,
{ data: { api_key: API_KEY } }
);
const authToken = authResponse.data.auth_token;
const accountId = authResponse.data.data.account_id;
console.log(`Account ID: ${accountId}`);
// Step 2: Make API requests
const response = await axios.get(
`${BASE_URL}/accounts/${accountId}`,
{
headers: {
'X-Auth-Token': authToken,
'Accept': 'application/json'
}
}
);
console.log(response.data);
}
main().catch(console.error);
Step 4: Make Your First Request​
After authenticating, test your setup by listing 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"
Expected response:
{
"auth_token": "eyJhbGciOiJSUzI1...",
"data": [
{
"id": "user_xyz789",
"first_name": "John",
"last_name": "Doe",
"email": "john@example.com",
"username": "johndoe"
}
],
"request_id": "req_abc123",
"status": "success"
}
API Overview​
Base URL​
https://api.audian.com:8443/v2
Authentication Header​
All API requests (after initial authentication) require the X-Auth-Token header:
X-Auth-Token: {AUTH_TOKEN}
Request Format​
For requests with a body, wrap your data in a data object:
{
"data": {
"field1": "value1",
"field2": "value2"
}
}
HTTP Methods​
| Method | Usage |
|---|---|
| GET | Retrieve resources |
| PUT | Create new resources |
| POST | Update existing resources |
| DELETE | Remove resources |
Common Setup Issues​
Issue: "Unauthorized" Response​
Solution:
- Verify your API key is correct
- Ensure you're using
X-Auth-Tokenheader (notX-Auth-Token:) - Check that your auth token hasn't expired (re-authenticate if needed)
Issue: Connection Refused​
Solution:
- Ensure you're using port
8443in the URL - Verify the full URL:
https://api.audian.com:8443/v2/
Issue: Invalid Request Body​
Solution:
- Wrap your data in
{"data": {...}} - Ensure valid JSON format
- Use
Content-Type: application/jsonheader
Environment Variables​
Best practice is to store your API key as an environment variable:
# .env file (never commit this to git)
AUDIAN_API_KEY=your_api_key_here
Load it in your application:
Python:
import os
api_key = os.getenv('AUDIAN_API_KEY')
Node.js:
const apiKey = process.env.AUDIAN_API_KEY;
Bash:
export AUDIAN_API_KEY="your_api_key_here"
Next Steps​
Congratulations! You've successfully set up your development environment. Here's what to explore next:
- API Basics - Understand request formats, pagination, and filtering
- Authentication - Learn more about auth tokens and security
- Users API - Manage users in your account
- Devices API - Configure phones and endpoints
- Error Handling - Best practices for handling API errors
Getting Help​
- Check the Error Handling Guide
- Review API Documentation
- Contact support: support@audian.com
- Visit the support portal: support.audian.com
Tip: Keep your API key secure. Use different keys for development, staging, and production environments.