Query report
POST/reports/active_sessions
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.
Fields specified in the order
argument, should be present in the
return_fields
.
Request​
- application/json
Bodyrequired
- 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.
rollup
- the report will include intermediate subtotals and full totals aside from regular records.null
- the report will include only regular records.
List of fields to include in the response. Fields can be:
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
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
]
[]
Number of rows to return. It is typically used with order
argument to get top X rows ranked by some attribute.
null
Grouping mode for aggregation:
Possible values: [rollup
]
null
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.
null
Timezone to use for date-based aggregation. If not set,
UTC
will be used.
null
Responses​
- 200
- 400
- 401
- 404
- 422
- 500
List of report rows.
- application/json
- Schema
- Example (auto)
Schema
- Array [
- ]
[
{}
]
The request contains invalid arguments or is malformed
- application/json
- Schema
- Example (auto)
Schema
error object
{
"error": {
"message": "Invalid request",
"data": {
"name": "Empty value is not allowed",
"payment_terms_id": "Object \"payment_terms(123)\" was not found!"
}
}
}
Access is not authorized
- application/json
- Schema
- Example (auto)
Schema
error object
{
"error": {
"message": "utoken-auth-failed: Authentication Failed: IP 10.0.0.1 is not allowed",
"data": {
"code": "utoken-auth-failed",
"message": "Authentication Failed: IP 10.0.0.1 is not allowed"
}
}
}
Requested object was not found
- application/json
- Schema
- Example (auto)
Schema
error object
{
"error": {
"message": "not_found: Object \"clients(123)\" was not found!",
"data": {
"code": "not_found",
"message": "Object \"clients(123)\" was not found!",
"object_name": "clients",
"object_id": "123"
}
}
}
A logical error occurred, making the request unprocessable
- application/json
- Schema
- Example (auto)
Schema
error object
{
"error": {
"message": "invoices-zero-amount: Impossible to create an invoice with zero amount",
"data": {
"code": "invoices-zero-amount",
"message": "Impossible to create an invoice with zero amount"
}
}
}
An unexpected error occurred
- application/json
- Schema
- Example (auto)
Schema
error object
{
"error": {
"message": "An unexpected error occurred"
}
}
Authorization: X-Api-Key
name: X-Api-Keytype: apiKeyin: headerdescription: Token for API access
- curl
- python
- nodejs
- php
- CURL