Skip to main content

Query report

POST 

/reports/active_sessions

JSON-RPC

reports.active_sessions.query

The method generates active sessions report and returns the data according to the return_fields argument. Please pay attention that quantity of fields affect time required to generate the report.

note

Fields specified in the order argument, should be present in the return_fields.

Request​

Bodyrequired

    return_fieldsstring[]required

    List of fields to include in the response. Fields can be:

    • Aggregated fields (e.g., total quantity, total duration) - provide summarized values.
    • Singular fields (e.g., client ID, equipment ID) - define how the data is grouped.

    Possible values: [session_id, session_setup_time, session_start_time, equipment_id, equipment_name, orig_leg_id, orig_src_party_id, orig_dst_party_id, orig_companies_id, orig_owner_users_id, orig_clients_id, orig_clients_name, orig_accounts_id, orig_accounts_name, orig_accounts_ident, orig_rates_code, orig_rates_code_name, term_leg_id, term_src_party_id, term_dst_party_id, term_companies_id, term_owner_users_id, term_clients_id, term_clients_name, term_accounts_id, term_accounts_name, term_accounts_ident, term_rates_code, term_rates_code_name, quantity, duration]

    filters object

    Filters for report.

    orig_companies_idinteger[]

    Origination: partition ID(s) of the client.

    orig_owner_users_idinteger[]

    Origination: owner user ID(s) of the client.

    orig_clients_idinteger[]

    Origination: client ID(s).

    orig_accounts_idinteger[]

    Origination: account ID(s).

    orig_rates_codestring[]

    Origination: rate code(s).

    orig_rates_code_namestring[]

    Origination: rate code name(s).

    term_companies_idinteger[]

    Termination: partition ID(s) of the client.

    term_owner_users_idinteger[]

    Termination: owner user ID(s) of the client.

    term_clients_idinteger[]

    Termination: client ID(s).

    term_accounts_idinteger[]

    Termination: account ID(s).

    term_rates_codestring[]

    Termination: rate code(s).

    term_rates_code_namestring[]

    Termination: rate code name(s).

    quantityinteger[]

    Total quantity, given as range.

    Possible values: >= 2, <= 2

    durationinteger[]

    Total volume (duration), given as range.

    Possible values: >= 2, <= 2

    orderstring[]

    List of fields to order results by. Any fields used in this list should be present in return_fields.

    Possible values: [duration, -duration, equipment_id, -equipment_id, equipment_name, -equipment_name, orig_accounts_id, -orig_accounts_id, orig_accounts_ident, -orig_accounts_ident, orig_accounts_name, -orig_accounts_name, orig_clients_id, -orig_clients_id, orig_clients_name, -orig_clients_name, orig_companies_id, -orig_companies_id, orig_dst_party_id, -orig_dst_party_id, orig_leg_id, -orig_leg_id, orig_owner_users_id, -orig_owner_users_id, orig_rates_code, -orig_rates_code, orig_rates_code_name, -orig_rates_code_name, orig_src_party_id, -orig_src_party_id, quantity, -quantity, session_id, -session_id, session_setup_time, -session_setup_time, session_start_time, -session_start_time, term_accounts_id, -term_accounts_id, term_accounts_ident, -term_accounts_ident, term_accounts_name, -term_accounts_name, term_clients_id, -term_clients_id, term_clients_name, -term_clients_name, term_companies_id, -term_companies_id, term_dst_party_id, -term_dst_party_id, term_leg_id, -term_leg_id, term_owner_users_id, -term_owner_users_id, term_rates_code, -term_rates_code, term_rates_code_name, -term_rates_code_name, term_src_party_id, -term_src_party_id]

    Default value: []
    limitinteger | nullnullable

    Number of rows to return. It is typically used with order argument to get top X rows ranked by some attribute.

    Default value: null
    grouping_modestring | nullnullable

    Grouping mode for aggregation:

    • rollup - the report will include intermediate subtotals and full totals aside from regular records.
    • null - the report will include only regular records.

    Possible values: [rollup]

    Default value: null
    code_decks_idinteger | nullnullable

    Code deck ID to use for providing code name and country for destination codes. If not set, the code decks of the rate tables used during billing will be used.

    Default value: null
    timezonetimezonenullable

    Timezone to use for date-based aggregation. If not set, UTC will be used.

    Default value: null

Responses​

List of report rows.

Schema
  • Array [
  • object
  • ]

Authorization: X-Api-Key

name: X-Api-Keytype: apiKeyin: headerdescription: Token for API access

Request Collapse all
Auth
Body required
{
  "return_fields": [
    "session_id"
  ],
  "filters": {
    "orig_companies_id": [
      0
    ],
    "orig_owner_users_id": [
      0
    ],
    "orig_clients_id": [
      0
    ],
    "orig_accounts_id": [
      0
    ],
    "orig_rates_code": [
      "string"
    ],
    "orig_rates_code_name": [
      "string"
    ],
    "term_companies_id": [
      0
    ],
    "term_owner_users_id": [
      0
    ],
    "term_clients_id": [
      0
    ],
    "term_accounts_id": [
      0
    ],
    "term_rates_code": [
      "string"
    ],
    "term_rates_code_name": [
      "string"
    ],
    "quantity": [
      0
    ],
    "duration": [
      0
    ]
  },
  "order": [
    "duration"
  ],
  "grouping_mode": "rollup"
}