get_account_data
To get information about the account of the current user and its billing plan (billing plan name, balance, days left, available services), use the core/get_account_data method.
Endpoint
svc=core/get_account_data¶ms={
"type": <uint>
}
Parameters
The request must contain the following parameter:
| Parameter | Description |
|---|---|
type |
Type of the returned information. Possible values:
|
Response
If the request is completed successfully, the response contains basic or detailed information, depending on the value of the type parameter.
If the request is executed for a top account, the response doesn’t contain the parentAccountName, parentAccountId, and parentEnabled fields, since a top account has no parent account.
Basic information
If the type parameter is 1, the response is returned in the following format:
{
"parentAccountName": <text>, /* Parent account name. */
"parentAccountId": <long>, /* Parent account ID. */
"parentEnabled": <int>, /* Parent account state: 0 (blocked), 1 (active). */
"plan": <text>, /* Billing plan name. */
"enabled": <int>, /* Account state: 0 (blocked), 1 (active). */
"switchTime": <uint>, /* Last time the account state was changed (Unix time). */
"created": <uint>, /* Account creation time (Unix time). */
"flags": <uint>, /* Billing plan flags. */
"balance": <text>, /* Balance (with currency). */
"daysCounter": <int>, /* Day counter. */
"services": { /* Services. */
<text>: { /* Service name. */
"type": <int>, /* Service type: 1 (on demand), 2 (periodic). */
"usage": <uint>, /* Number of used items of this service. */
"maxUsage": <int> /* Maximum number of items of this service. */
},
...
},
"dealerRights": <int>, /* Dealer rights for the billing plan: 0 (no), 1 (yes). Returned only if the account has dealer rights. */
"subPlans": [<text>] /* Subordinate billing plans. Returned only if the account has dealer rights. */
}
Detailed information
If the type parameter is 2 or 10, the response is returned in the following format:
The account and billing plan flags, the service key types, the list of services, and the format of the site details are described on the account/get_account_data page.
For more information about the account and billing plan settings, see account/update_billing_plan.
If the request fails, an error code is returned.
Error codes
| Error code | Description |
|---|---|
| 4 | Wrong input parameters, or failed to get the current user or their account. |