Endpoints associated with creating and managing user accounts.
Get account information
Get account details
Refer to Status Codes for definitions of HTTP status code responses.
Successful response
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
->setUsername('USERNAME')
->setPassword('API_KEY');
$apiInstance = new ClickSend\Api\AccountApi(new GuzzleHttp\Client(),$config);
try {
$result = $apiInstance->accountGet();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AccountApi->accountGet: ', $e->getMessage(), PHP_EOL;
}
?>
{- "http_code": 200,
- "response_code": "SUCCESS",
- "response_msg": "Here's your account.",
- "data": {
- "user_id": 116,
- "username": "johndoe1",
- "user_email": "johndoe1@awesome.com",
- "active": 0,
- "banned": 0,
- "balance": "4.998000",
- "user_phone": "+15184811001",
- "reply_to": "originalemail",
- "delivery_to": null,
- "user_first_name": "John",
- "user_last_name": "Doe",
- "account": 0,
- "account_name": "The Awesome Company",
- "account_billing_email": "johndoe1@awesome.com",
- "account_billing_mobile": "+15184811001",
- "country": "US",
- "default_country_sms": "US",
- "auto_recharge": 0,
- "auto_recharge_amount": "20.00",
- "low_credit_amount": "0.00",
- "setting_unicode_sms": 0,
- "setting_email_sms_subject": 0,
- "setting_fix_sender_id": 0,
- "setting_sms_message_char_limit": 6,
- "old_dashboard": 0,
- "balance_commission": 0.299954,
- "timezone": "Australia/Melbourne",
- "_currency": {
- "currency_name_short": "AUD",
- "currency_prefix_d": "$",
- "currency_prefix_c": "c",
- "currency_name_long": "Australian Dollars"
}, - "_subaccount": {
- "subaccount_id": 126,
- "api_username": "johndoe1",
- "email": "johndoe1@awesome.com",
- "phone_number": "+15184811001",
- "first_name": "John",
- "last_name": "Doe",
- "api_key": "F3702045-EB2C-0091-C211-7728048DCAE2",
- "access_users": 1,
- "access_billing": 1,
- "access_reporting": 1,
- "access_contacts": 1,
- "access_settings": 1,
- "access_sms": 1,
- "access_email": 1,
- "access_voice": 1,
- "access_fax": 1,
- "access_post": 1,
- "access_reseller": 1,
- "access_mms": 1,
- "share_campaigns": 0,
- "notes": null
}
}
}
Get account usage
Get account usage statistics grouped by subaccount.
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
year | string | true | none | Your account usage year. Example: 2019 |
month | string | true | none | Your account usage month. Example: 4 |
Refer to Status Codes for definitions of HTTP status code responses.
Successful response
curl --include \ --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==" \ 'https://rest.clicksend.com/v3/account/usage/{year}/{month}/subaccount'
{- "http_code": 200,
- "response_code": "SUCCESS",
- "response_msg": "Here is your usage for this month.",
- "data": {
- "sms": [
- {
- "subaccount_id": 1039,
- "username": "gerald",
- "total_count": "29.00",
- "total_price": "2.1337"
}, - {
- "subaccount_id": 1047,
- "username": "user5",
- "total_count": "4.00",
- "total_price": "0.3080"
}
], - "voice": [
- {
- "subaccount_id": 1039,
- "username": "user1",
- "total_count": "6.00",
- "total_price": "0.1980"
}, - {
- "subaccount_id": 1047,
- "username": "user5",
- "total_count": "1.00",
- "total_price": "0.0330"
}
], - "fax": [
- {
- "subaccount_id": 1039,
- "username": "user1",
- "total_count": "3.00",
- "total_price": "0.6943"
}, - {
- "subaccount_id": 1047,
- "username": "user5",
- "total_count": "1.00",
- "total_price": "0.2314"
}
], - "post": [
- {
- "subaccount_id": 1039,
- "username": "user1",
- "total_count": "10",
- "total_price": "8.5624"
}, - {
- "subaccount_id": 1047,
- "username": "user5",
- "total_count": "3",
- "total_price": "2.5586"
}
], - "email": [
- {
- "subaccount_id": 1039,
- "username": "user1",
- "total_count": 3992,
- "total_price": "9.0020"
}, - {
- "subaccount_id": 1047,
- "username": "user5",
- "total_count": 998,
- "total_price": "0.0000"
}
], - "sms_total": {
- "count": 33,
- "price": "2.4417"
}, - "voice_total": {
- "count": 7,
- "price": "0.2310"
}, - "fax_total": {
- "count": 4,
- "price": "0.9257"
}, - "post_total": {
- "count": 13,
- "price": "11.1210"
}, - "email_total": {
- "count": 4990,
- "price": "9.0020"
}
}
}