get_account_data

To get detailed information about one or several accounts, use the account/get_account_data method.

Endpoint

To get information about one account, use the following request:

Copied!
svc=account/get_account_data&params={
  "itemId": <long>,
  "type": <uint>
}

To get information about several accounts, specify an array of IDs:

Copied!
svc=account/get_account_data&params={
  "itemId": [<long>],
  "type": <uint>
}

Parameters

The request must contain the following parameters:

Parameter Description
itemId Account ID or array of account IDs.
type Type of the returned information. Optional. 2 by default. The values can be summed. Possible values:
  • 1: minimal information required to estimate the state of the current user.
  • 2: detailed information with the billing plan, account, and combined settings.
  • 4: exclude subordinate accounts from usage. The information concerns only the specified account.
  • 8: site details. Works only together with 2, for example, "type":10. For more information, see Site details.

Response

If the request for one account is completed successfully, the response is returned in the following format:

Response
Copied!
{
  "parentAccountName": <text>,  /* Parent account name. Not returned for top accounts. */
  "parentAccountId": <long>,    /* Parent account ID. Not returned for top accounts. */
  "parentEnabled": <int>,       /* Parent account state: 0 (blocked), 1 (active). Not returned for top accounts. */
  "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. Duplicates the flags of the billing plan settings. */
  "balance": <text>,            /* Balance (with currency). */
  "daysCounter": <int>,         /* Day counter. */
  "settings": {                 /* Settings. */
    "balance": <double>,        /* Balance. */
    "plan": {                   /* Billing plan settings. */
      "flags": <uint>,          /* Billing plan flags (see Account flags). */
      "blockBalance": <double>, /* Balance below which the account is blocked. */
      "denyBalance": <double>,  /* Balance below which paid services are unavailable. */
      "minDaysCounter": <int>,  /* Number of days below which the account is blocked. */
      "historyPeriod": <uint>,  /* Message storage period, in days. 0 means unlimited. */
      "currencyFormat": <text>, /* Currency format. */
      "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. */
          "cost": <text>,       /* Cost table. */
          "interval": <int>,    /* Reset interval: 0 (none), 1 (hourly), 2 (daily), 3 (weekly), 4 (monthly). */
          "descr": <text>       /* Description. */
        },
        ...
      }
    },
    "personal": {               /* Account settings. */
      ...                       /* In the same format as the billing plan settings, without currencyFormat. */
    },
    "combined": {               /* Combined settings of the billing plan and the account. */
      ...                       /* In the same format as the billing plan settings, without currencyFormat. */
    },
    "siteAccess": {             /* Sites available to the account. */
      <text>: <text>,           /* Key: service name. Value: DNS name or, if the type parameter contains 8, site details. */
      ...
    },
    "serviceKeys": {            /* External map providers. */
      <text>: {                 /* Service name. */
        "name": <text>,         /* Map key name. */
        "type": <int>,          /* Key type (see Service key types). */
        "provider": <text>      /* Map provider name. */
      },
      ...
    }
  },
  "managable": <int>,           /* The current user can manage the account: 0 (no), 1 (yes). */
  "dealerRights": <int>,        /* Dealer rights for the billing plan: 0 (no), 1 (yes). */
  "subPlans": [<text>]          /* Subordinate billing plans. */
}

If the request for several accounts is completed successfully, the response is returned in the following format:

Copied!
{
  <text>: {                     /* Requested item ID. */
    ...                         /* Account information in the format described above. */
  },
  ...
}

If an ID in the array belongs to a unit, user, or other item that isn’t an account, the response contains the data of the account this item belongs to, under the requested ID. If the array contains several items of the same account, the account data is returned under each of their IDs.

The response contains only the items to which the user has the View detailed object properties access right. Other IDs are skipped without an error.

If the request fails, an error code is returned.

Error codes

Error code Description
4 Wrong input parameters, or the specified item isn’t an account. The second case applies only to a request for one account.
7 The account doesn’t exist, or the user doesn’t have the View detailed object properties access right to it. Returned only for a request for one account.

Site details

If the type parameter contains both 2 and 8 (for example, "type":10), each value of the siteAccess object is an object with the site details instead of a DNS name:

Copied!
"siteAccess": {
  <text>: {                           /* Service name. */
    "n": <text>,                      /* DNS name. */
    "tt": <text>,                     /* Site template type, for example, wialon_web, cms_manager, wialon_sdk. */
    "b": <text>,                      /* Site branch. Returned only if the branch is set. */
    "sp": <int>,                      /* SSL port. */
    "force_https": <text>,            /* Value of the "force_https" site property. Returned only if the property is set. */
    "ignore_in_cms_login_as": <text>  /* Value of the "ignore_in_cms_login_as" site property. Returned only if the property is set. */
  },
  ...
}

Service key types

The type field of the serviceKeys object can have the following values:

Type Description
0x01 Protected key (Gurtam key).
0x02 Routing key.
0x04 Geocoding key.
0x08 Distance matrix key.
0x10 Map tiles key.

Account flags

The following flags are used in the account and billing plan settings:

Flag Description
0x01 Block users if the balance is lower than the blocking threshold.
0x02 Forbid using paid services if the balance is less than the value specified in the denyBalance parameter.
0x04 Allow unknown services.
0x20 Decrease the number of days in the day counter, and block the account when the number of remaining days reaches the minimum.
0x40 Redefine billing plan flags.

Services list

The following services can be available in a billing plan:

Service Type Description
avl_resource periodic Activates the Accounts section in CMS Manager; defines the quantity and cost of resources and accounts.
avl_retranslator periodic Activates the Retranslators section in CMS Manager and defines the allowed quantity and cost of retranslators.
avl_route periodic Activates the Routes module. Enables the Routes tab and associated reports and notifications.
avl_unit periodic Activates the Units section in CMS Manager and the Units tab in the monitoring system. Defines the cost and quantity of units.
avl_unit_group periodic Activates the Unit groups section in CMS Manager and Units tab in the monitoring system. Defines the cost and quantity of unit groups.
cms_manager on demand Grants access to CMS Manager.
create_units on demand Activates the button to create units in the Units section in CMS Manager and the Units tab in the monitoring system.
create_users on demand Activates the button to create users in the Users section in CMS Manager and the Users tab in the monitoring system.
create_unit_groups on demand Activates the button to create unit groups in the Unit groups section in CMS Manager and the Unit groups tab in the monitoring system.
create_resources on demand Activates the button to create resources and accounts in the Resources section in CMS Manager.
custom_fields periodic Activates the Custom fields tab in the properties of units, users or groups. Defines the cost and quantity (summarized, by objects of different types) of custom fields; doesn’t affect drivers and trailers.
custom_reports on demand Activates advanced reports: reports on unit groups, users, drivers, trailers as well as groups of drivers and trailers (except the Log table for users and unit groups). Works within the Reports module.
drivers periodic Activates the Drivers module and defines the cost and quantity of drivers. If disabled, the Drivers tab isn’t shown and mentions of drivers disappear from notifications, user settings, and the window for sending SMS messages.
driver_groups periodic Defines the quantity and cost of driver groups. Works within the Drivers module.
email_notification on demand Enables sending notifications by email. The recommended limitation is 10 reports an hour (to avoid server overloading).
email_report on demand Enables sending a report by email (within the Jobs module). The recommended limitation is 10 reports an hour (to avoid server overloading).
google_service on demand Activates Google services.
import_export on demand Activates the Import/Export features on monitoring sites.
jobs periodic Activates the Jobs tab. Defines the cost and the allowed number of jobs.
locator on demand Activates the Locator option in the user menu.
messages on demand Grants access to the Messages tab.
net_access (outdated) on demand Allows authentication through the service connector in Wialon Pro.
notifications periodic Activates the Notifications tab and defines the cost and the allowed number of notifications.
orders periodic Activates access to the Logistics application and allows running the Orders report on units and drivers in the monitoring system.
pois (outdated) periodic Activates the POI panel and defines the cost and allowed quantity of POIs.
reports on demand Activates the Reports module and defines the cost and the allowed quantity of report templates. If disabled, associated jobs and notifications disappear and the trip detector can’t be used.
retranslator_units periodic Defines the number of available units attached to activated retranslators.
rounds periodic Defines the number of allowed rounds and their cost (within the Routes module).
route_schedules periodic Defines the number of allowed schedules and their cost (within the Routes module).
sdk on demand Grants access to Apps.
service_intervals periodic Defines the cost and quantity of service intervals. If activated, the Service intervals tab appears in the unit properties. Allows registering events of the Maintenance type, run reports and receive notifications about maintenance.
sms on demand Determines the allowed quantity of SMS messages and their cost.
tacho on demand Activates the Driver activity and Violations tables in reports on drivers.
storage_user periodic Activates the Users tab and defines the cost and quantity of users.
trailers periodic Activates the Trailers tab and defines the cost and quantity of trailers.
trailer_groups periodic Defines the quantity and cost of trailers; works within the Trailers module.
unit_commands periodic Activates the Commands tab in the unit properties. Defines the quantity (for all units in total) and cost of commands.
unit_sensors periodic Defines the number of sensors (calculated for all units in total) and their cost.
user_notifications periodic Enables receiving notices from the administrator of the service.
Wialon_activex (outdated) on demand Grants remote access to the system via SDK, ActiveX.
wialon_mobile (outdated) on demand Activates access to the application for Android and iOS.
wialon_mobile2 on demand Activates access to the application for Android and iOS. Requires the wialon_mobile service to be enabled.
wialon_sdk on demand Grants remote access to the system via SDK.
zones_library periodic Activates the Geofences module and defines the cost and quantity of geofences. If disabled, the Geofences tab isn’t shown, and any mention of geofences disappears from reports and user settings.
zone_groups periodic Activates groups of geofences.
AgroService (outdated) Type Description
agroplots periodic Plots
agroplotgroups periodic Groups of plots
agrocrops periodic Crops
agromachines periodic Machines
agroequipments periodic Equipment
agrocultivationtypes periodic Cultivation types

If you find a mistake in the text, please select it and press Ctrl+Enter.