Skip to content

Retrieves detailed charge history for all legs of call sessions.

Retrieves detailed charge history for all legs of call sessions

Method get.financial_call_legs_report
Description Retrieves detailed charge history for all legs of call sessions.
Who has access Partners and clients

Calls initiated from the online chat or Sitephone forms are classified as outbound calls.

Request parameters

Name Type Required Valid values Description
access_token string yes Authentication session key
user_id number no Unique user identifier of the agent client on behalf of which the request is made (Is required for the agent) To obtain a list of client users, you must use the method ""get.customer_users""
limit number no Number of records returned. See section "Paging"
offset number no Shift determines from which record number to return "limit" records. Default is "0". See section "Paging"
fields array no See "View of Returned Data"
sort array no See section "Sorting data"
date_from iso8601 yes YYYY-MM-DD hh:mm:ss Start date and time of the reporting period.
date_till iso8601 yes YYYY-MM-DD hh:mm:ss Sampling end date

Response parameters

Name Type Valid values Filtering Sorting Default response Description
start_time iso8601 YYYY-MM-DD hh:mm:ss yes yes Leverage date and time
direction enum in - Inbox; out - Outbox yes yes yes Leg direction
source enum callapi - Call API; callapi_informer_call - Call API information call; callapi_scenario_call - Call API script call call_tracking- Analytics; dynamic_call_tracking - Dynamic call tracking; va - Virtual PBX; sip - Outgoing from SIP; consultant - Call through the Consultant; lead - Call via Lead Generator; sitephone - Call via Sitephone; faxout - Outgoing fax; retailcrm - retailCRM yes yes yes Leg source
call_session_id number yes yes yes Unique session ID call, see method "get.calls_report"
leg_id number yes yes yes Unique call ID, see method "get.call_legs_report" (Within one call session perhaps several calls)
calling_phone_number string yes yes yes Caller's phone number
called_phone_number string yes yes yes Phone number that was called
duration number yes yes yes Call duration, value in seconds
chargeable_duration number yes yes yes Charged call duration, value in seconds
direction_type enum international - International; national - Intercity; local - Local (Moscow and Moscow region); mobile - Mobile yes yes yes Call direction type
cost_per_minute number yes yes yes Cost per minute
total_charge number yes yes yes Total cost of the call
bonuses_charge number yes yes yes Paid with bonuses

Example request

{
"jsonrpc":"2.0",
"id":"number",
"method":"get.financial_call_legs_report",
"params":{
"access_token":"string",
"user_id":"number",
"offset":"number",
"limit":"number",
"date_from":"iso8601",
"date_till":"iso8601",
"filter":{
},
"sort":[
{
"field":"string",
"order":"string"
}
],
"fields":[
"string"
]

}
}

Example response

{
"jsonrpc":"2.0",
"id":"number",
"result":{
"metadata":{

},
"data":[
{
"start_time":"iso8601",
"direction":"enum",
"source":"enum",
"call_session_id":"string",
"leg_id":"number",
"calling_phone_number":"string",
"called_phone_number":"string",
"duration":"number",
"chargeable_duration":"number",
"direction_type":"enum",
"cost_per_minute":"number",
"total_charge":"number",
"bonuses_charge":"number"
}
]
}
}

Possible errors

See the "Errors for get methods" section.