question

Allen Morgan avatar image
Allen Morgan asked Phong Vu commented

Analytic API not matching API reports

Im trying to just pull detailed call data, grouped by users, daily...


"timeRange": {
            "timeFrom": "2023-01-26T00:00:00Z",
            "timeTo": "2023-01-26T23:59:59Z"
        }

If I try to set this time range I get this error:

"errorCode": "ANL-305",
            "message": "Interval must be less than time range"


I can pass things like this:

"grouping": {
        "groupBy": "Users",
        "keys": []
    },
    "timeSettings": {
        "timeRange": {
            "timeFrom": "2023-03-23T00:00:00.000Z",
            "timeTo": "2023-03-24T11:59:01.000Z"
        },
        "timeZone": "US/Eastern"
    }

and multiple variations in changing the timeFrom and timeTo -- so long the same Day is not selected...


However, none of the results I get match even close to the Performance Reports, by day, by user, in the admin analytics portal.


This is driving me crazy.
What am I doing wrong?


rest apianalytics and reporting
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Phong Vu avatar image
Phong Vu answered Phong Vu commented

I am sure that you tried reading the timeline analytics data, right? If so, check the query params and set the interval accordingly. The interval must be less than the time range. E.g. if the time range is within a day, the interval must be just the "Hour".

screen-shot-2023-04-28-at-81443-am.png


4 comments
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Allen Morgan avatar image Allen Morgan commented ·

Thanks for the response..
I have tried both the timeline and aggregate.
My goal is to get calls data at the end of each day by user.

I still cannot get the response to match with the totals/call details from the performance reports.

0 Likes 0 ·
Phong Vu avatar image Phong Vu ♦♦ Allen Morgan commented ·

You mixed the problem and made me think that you could not read the data at all

"message": "Interval must be less than time range"

If you could not read, how could you see the mismatched data?

Any way, the report you read from the dashboard is your local time. In the API, the time you specify to read data will be UTC time. Try to get your local time and convert it to UTC time before specify the timeFrom and timeTo to read the data.

0 Likes 0 ·
Allen Morgan avatar image Allen Morgan Phong Vu ♦♦ commented ·
--data '{"grouping":{"groupBy":"Users"},"timeSettings":{"timeRange":{"timeFrom":"2023-04-25T04:01:00.000Z","timeTo":"2023-04-26T03:59:00.000Z"},"timeZone":"US/Eastern"},"responseOptions":{"counters":{"allCalls":true}}}'

I've done that. I've also changed timezones from US/East and UTC while changing timeranges to try to get a match.
Is there some sort of calculation done on the performance reports for total calls that I am not understanding?
I have tried to make sense of it for multiple users and still just do not understand.

0 Likes 0 ·
Show more comments

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys