Difference between revisions of "MOR API v2 Calls"
| (One intermediate revision by the same user not shown) | |||
| Line 58: | Line 58: | ||
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhc3NpZ25lZF9kZXZpY2VzIjoiMiw4LDEwLDEyLDE4LDI2LDM2IiwiZXhwIjoxNzUyNTU1Njk4LCJpYXQiOjE3NTI0NjkyOTgsImlzcyI6IkZsYXNoIENhbGxzIEFQSSIsInN1YiI6InJpY2FyZGFzIn0.I3Sy1zrJx0mAsTLthitY8dyZfythsWzJ4V1CVfNJmYU | Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhc3NpZ25lZF9kZXZpY2VzIjoiMiw4LDEwLDEyLDE4LDI2LDM2IiwiZXhwIjoxNzUyNTU1Njk4LCJpYXQiOjE3NTI0NjkyOTgsImlzcyI6IkZsYXNoIENhbGxzIEFQSSIsInN1YiI6InJpY2FyZGFzIn0.I3Sy1zrJx0mAsTLthitY8dyZfythsWzJ4V1CVfNJmYU | ||
<br/> | <br/> | ||
=== Returns === | |||
{ | |||
"calls": { | |||
"pagename": "Calls", | |||
"language": "en", | |||
"error_msg": "", | |||
"userid": 0, | |||
"username": "admin", | |||
"total_calls": 1, | |||
"limit": 50, | |||
"max_limit": 500, | |||
"page": "1/1", | |||
"currency": "EUR", | |||
"calls_stat": { | |||
"period": { | |||
"period_start": "2026-01-16 00:00:00", | |||
"period_end": "2026-01-16 23:59:59" | |||
}, | |||
"show_user": "all", | |||
"show_device": "all", | |||
"show_status": "all", | |||
"show_provider": "all", | |||
"show_hgc": "all", | |||
"show_reseller": "all", | |||
"show_did": "all", | |||
"show_destination": "", | |||
"calls": [ | |||
{ | |||
"calldate2": "2026-01-16 07:18:42", | |||
"timezone": "GMT +00:00", | |||
"clid": "\"test\" <101>", | |||
"destination": "Lithuania - Special Services", | |||
"did": "37060000001", | |||
"did_inc_price": "0.0", | |||
"did_price": "0.0", | |||
"did_prov_price": "0.0", | |||
"dispod": "ANSWERED(16)", | |||
"dst": "37060000001", | |||
"dst_user_id": 0, | |||
"lega_call_id": "", | |||
"legb_call_id": "", | |||
"nice_billsec": 16, | |||
"nice_reseller": " ", | |||
"originator_codec": "ulaw", | |||
"prefix": "3706", | |||
"privacy": 0, | |||
"profit": "0.0000", | |||
"provider_name": "", | |||
"provider_price": "0.0", | |||
"provider_rate": "0.0", | |||
"reseller_price": "0.0", | |||
"reseller_rate": "0.0", | |||
"server_id": 1, | |||
"src": "123456", | |||
"terminated_by": "originator", | |||
"terminator_codec": "ulaw", | |||
"tp_src": "", | |||
"user": "Test User #1", | |||
"user_currency": "EUR", | |||
"user_exchange_rate": "1.000000000000000", | |||
"user_id": 2, | |||
"user_price": "0.0", | |||
"user_rate": "0.0", | |||
"uniqueid": "1768547922.0", | |||
"originator_codec_name": "G.711 u-law", | |||
"terminator_codec_name": "G.711 u-law" | |||
} | |||
] | |||
} | |||
} | |||
} | |||
=Additional notes= | |||
More examples and responses are available in the MOR REST API Documentation, which is available in '''/billing/api/v2/api-docs'''. | |||
Latest revision as of 11:30, 16 January 2026
Documentation
Full MOR REST API Documentation is available in /billing/api/v2/api-docs.
Description
The Calls API retrieves the list of calls in the selected time period for the specified User/Device.
Availability: This API is available from MOR X19 onwards.
API
The Calls API accepts parameters in JSON format. Responses are also returned in JSON format.
Parameters:
- limit
- only_did
- order_by
- order_desc
- page
- period_end
- period_start
- s_call_type
- s_callback_uniqueid
- s_destination
- s_device
- s_did
- s_hgc
- s_provider
- s_reseller
- s_uniqueid
- s_user
Authentication
The Calls API requires user authentication - basic authentication (username/password) and JWT token authentication.
Basic authentication
Basic authentication uses the User's username and password to access API endpoints.
Username and password must be provided in HTTP Authorization header, "username:password" string encoded in Base64. For example:
POST http://x.x.x.x/billing/api/v2/authentication/login HTTP/1.1 Authorization: Basic cmljYXJkYxM6OWtBWFpadT9yak1iayRSaA==
JWT authentication
JWT authentication uses a token (generated by MOR) with each request to endpoints. The API client must obtain a JWT token by calling the /authentication/login endpoint and then use this token in other endpoints for authentication until the token expires. The authentication token is valid for 15 minutes. Once the token has expired, a new token must be obtained from /authentication/refresh endpoint. Therefore, you need to run the refresh method every 15 minutes. The refresh token is valid for 7 days.
JWT token must be provided in HTTP Authorization header when requesting calls parameters. For example:
get http://x.x.x.x/billing/api/v2/calls?limit=500&period_end=1768549495&period_start=948008695 Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhc3NpZ25lZF9kZXZpY2VzIjoiMiw4LDEwLDEyLDE4LDI2LDM2IiwiZXhwIjoxNzUyNTU1Njk4LCJpYXQiOjE3NTI0NjkyOTgsImlzcyI6IkZsYXNoIENhbGxzIEFQSSIsInN1YiI6InJpY2FyZGFzIn0.I3Sy1zrJx0mAsTLthitY8dyZfythsWzJ4V1CVfNJmYU
Returns
{
"calls": {
"pagename": "Calls",
"language": "en",
"error_msg": "",
"userid": 0,
"username": "admin",
"total_calls": 1,
"limit": 50,
"max_limit": 500,
"page": "1/1",
"currency": "EUR",
"calls_stat": {
"period": {
"period_start": "2026-01-16 00:00:00",
"period_end": "2026-01-16 23:59:59"
},
"show_user": "all",
"show_device": "all",
"show_status": "all",
"show_provider": "all",
"show_hgc": "all",
"show_reseller": "all",
"show_did": "all",
"show_destination": "",
"calls": [
{
"calldate2": "2026-01-16 07:18:42",
"timezone": "GMT +00:00",
"clid": "\"test\" <101>",
"destination": "Lithuania - Special Services",
"did": "37060000001",
"did_inc_price": "0.0",
"did_price": "0.0",
"did_prov_price": "0.0",
"dispod": "ANSWERED(16)",
"dst": "37060000001",
"dst_user_id": 0,
"lega_call_id": "",
"legb_call_id": "",
"nice_billsec": 16,
"nice_reseller": " ",
"originator_codec": "ulaw",
"prefix": "3706",
"privacy": 0,
"profit": "0.0000",
"provider_name": "",
"provider_price": "0.0",
"provider_rate": "0.0",
"reseller_price": "0.0",
"reseller_rate": "0.0",
"server_id": 1,
"src": "123456",
"terminated_by": "originator",
"terminator_codec": "ulaw",
"tp_src": "",
"user": "Test User #1",
"user_currency": "EUR",
"user_exchange_rate": "1.000000000000000",
"user_id": 2,
"user_price": "0.0",
"user_rate": "0.0",
"uniqueid": "1768547922.0",
"originator_codec_name": "G.711 u-law",
"terminator_codec_name": "G.711 u-law"
}
]
}
}
}
Additional notes
More examples and responses are available in the MOR REST API Documentation, which is available in /billing/api/v2/api-docs.