Retrieve Account
Retrieve details about a specific account.
Endpoint​
GET https://api.audian.com:8443/v2/accounts/{accountId}
Request​
Path Parameters​
| Parameter | Type | Required | Description |
|---|---|---|---|
accountId | string | Yes | The unique account identifier |
Headers​
X-Auth-Token: YOUR_API_TOKEN
Query Parameters​
| Parameter | Type | Required | Description |
|---|---|---|---|
includeUsage | boolean | No | Include usage statistics |
includeBilling | boolean | No | Include billing information |
format | string | No | Response format (json, xml) |
Examples​
Retrieve Basic Account Info​
curl -X GET https://api.audian.com:8443/v2/accounts/acc_1234567890 \
-H "X-Auth-Token: YOUR_API_TOKEN"
Retrieve with Usage Statistics​
curl -X GET "https://api.audian.com:8443/v2/accounts/acc_1234567890?includeUsage=true" \
-H "X-Auth-Token: YOUR_API_TOKEN"
Retrieve with Billing Information​
curl -X GET "https://api.audian.com:8443/v2/accounts/acc_1234567890?includeBilling=true" \
-H "X-Auth-Token: YOUR_API_TOKEN"
JavaScript/Node.js Example​
const axios = require('axios');
async function getAccount(accountId) {
try {
const response = await axios.get(
`https://api.audian.com:8443/v2/accounts/${accountId}`,
{
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN'
},
params: {
includeUsage: true,
includeBilling: true
}
}
);
console.log('Account details:', response.data);
return response.data;
} catch (error) {
console.error('Error retrieving account:', error.response.data);
}
}
getAccount('acc_1234567890');
Python Example​
import requests
def get_account(account_id):
url = f'https://api.audian.com:8443/v2/accounts/{account_id}'
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN'
}
params = {
'includeUsage': True,
'includeBilling': True
}
response = requests.get(url, headers=headers, params=params)
if response.status_code == 200:
print('Account details:', response.json())
return response.json()
else:
print('Error:', response.json())
get_account('acc_1234567890')
Response​
Success Response (200 OK)​
{
"id": "acc_1234567890",
"name": "Acme Corporation",
"displayName": "Acme Corp",
"email": "admin@acme.com",
"phone": "+1-555-0100",
"status": "active",
"plan": "professional",
"address": {
"street": "123 Business Ave",
"city": "San Francisco",
"state": "CA",
"postalCode": "94102",
"country": "US"
},
"createdAt": "2023-10-15T10:30:00Z",
"updatedAt": "2023-10-20T14:22:00Z",
"usage": {
"users": {
"current": 45,
"limit": 100
},
"devices": {
"current": 23,
"limit": 50
},
"storage": {
"current": 234.5,
"unit": "GB",
"limit": 500
}
},
"billing": {
"status": "active",
"nextBillingDate": "2023-11-15",
"plan": "professional",
"monthlyRate": 99.99,
"currency": "USD"
}
}
Error Response (404 Not Found)​
{
"error": {
"code": "ACCOUNT_NOT_FOUND",
"message": "The specified account does not exist",
"details": {
"accountId": "acc_1234567890"
}
}
}
Status Codes​
| Code | Description |
|---|---|
200 | Account retrieved successfully |
400 | Bad request |
401 | Unauthorized - invalid token |
403 | Forbidden - no access to this account |
404 | Account not found |
429 | Too many requests |
500 | Server error |
Response Fields​
Account Object​
- id: Unique account identifier
- name: Account name
- displayName: Display name for UI
- email: Primary contact email
- phone: Contact phone number
- status: Current account status
- plan: Service plan level
- address: Billing/contact address
- createdAt: ISO 8601 timestamp
- updatedAt: ISO 8601 timestamp
Usage Object (optional)​
- users: Current and limit counts
- devices: Current and limit counts
- storage: Current usage, limit, and unit
Billing Object (optional)​
- status: Billing status
- nextBillingDate: ISO 8601 date
- plan: Current plan name
- monthlyRate: Numeric amount
- currency: ISO 4217 currency code
Filtering and Pagination​
For retrieving multiple accounts, use the list accounts endpoint.