Restcomm-Connect icon indicating copy to clipboard operation
Restcomm-Connect copied to clipboard

Usage API the start date is not respected

Open deruelle opened this issue 9 years ago • 2 comments

See below, start date is 1st December but the records starts at 2nd

True for both Daily and Monthly

curl --user 'ACXXX:YYYYY' 'https://cloud.restcomm.com/restcomm/2012-04-24/Accounts/ACXXXX/Usage/Records/Monthly.json?EndDate=2016-12-31&StartDate=2016-12-01&Category=CALLS' [ { "category": "calls", "description": "Total Calls", "account_sid": "ACXXX", "start_date": "2016-12-02", "end_date": "2016-12-31", "usage": "12402", "usage_unit": "minutes", "count": "638", "count_unit": "calls", "price": "0", "price_unit": "USD", "uri": "/todo.json" }

deruelle avatar Jan 04 '17 13:01 deruelle

So what wasnt immediately clear to me was (given all prior incorrect guesses) this is a simple aggregate query that just displays available records from MIN(date_created) to MAX(date_created) within the started_date and end_date bounds. We see 2016-12-02 as start_date only because i assume there are no records on 2016-12-02, and miraculously there are records on 2016-12-31 which is why end_date is correct, else it wouldve also been incorrect. @deruelle Potentially this is correct behaviour, another alternative fix could be to introduce two extra API attributes to display available lower and upper bound records, possibly named FirstRecordDate and LastRecordDate. PR #1698 however only replaces the current start_date and end_date with the passed in parameters

abdulazizali77 avatar Jan 10 '17 08:01 abdulazizali77

@abdulazizali77 @otsakir can we close this issue ?

deruelle avatar May 11 '17 08:05 deruelle