Skip to main content
Aria Knowledge Central

get_usage_types_m Sample Call and Response

This example shows a client retrieving the full list of usage types configured for its account, both the system standard usage types Aria supplies and any custom usage types the client has created. It is based on the get_usage_types_m method as defined in methods_m_r73.yml, Admin Tools API.

This example lists the usage types themselves. It does not show the details of any single usage type, such as its supplemental object fields; that level of detail belongs to the separate get_usage_type_details_m method.

Sample call

{
  "rest_call": "get_usage_types_m",
  "output_format": "json",
  "client_no": 10023,
  "auth_key": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6",
  "include_translations": "false"
}

The rest_call and output_format fields are not part of the method’s own documented arguments. The REST layer adds them to every call: rest_call names the method being invoked, and output_format requests a JSON response rather than the default WDDX format. Within the method’s own arguments, client_no and auth_key identify and authenticate the client making the call. The optional locale_no and locale_name fields are omitted here because this example does not request locale-specific translations; instead, include_translations is set to the string value “false,” which is also the default, to show the field explicitly while keeping the response limited to the base language values.

Sample response

{
  "error_code": 0,
  "error_msg": "OK",
  "usage_types": [
    {
      "usage_type_no": 100501,
      "usage_type_desc": "Metered API Calls",
      "usage_unit_type": "calls",
      "usage_type_name": "API Calls",
      "is_editable": false
    },
    {
      "usage_type_no": 100502,
      "usage_type_desc": "Outbound Data Transfer",
      "usage_unit_type": "gigabytes",
      "usage_type_name": "Data Transfer",
      "is_editable": true
    },
    {
      "usage_type_no": 100503,
      "usage_type_desc": "Support Ticket Handling Time",
      "usage_unit_type": "minutes",
      "usage_type_name": "Support Minutes",
      "is_editable": true
    }
  ]
}

An error_code of zero, paired with an error_msg of “OK,” indicates that Aria retrieved the usage type list successfully. The usage_types array is repeatable; this example shows three representative entries, but a real client account could return many more. The first entry, API Calls, shows is_editable set to false because it is a system standard usage type available to all clients and therefore not editable. The other two entries show is_editable set to true because each is custom to this client and associated with a service, which the description in the yml file identifies as one of the two reasons a usage type becomes non-editable when false, or remains editable when neither reason applies. This example leaves out the usage_type_translations array under each usage type, since include_translations is set to false and no locale-specific translations are requested.

TOP
  • Was this article helpful?