Account stats - granularity is not working


#1

The following API call is working but I’m getting the result in HOUR instead of DAY. https://ads-api.twitter.com/0/stats/accounts/18ce53w5492?start_time=2012-11-20T07%3A00%3A00Z&granularity=DAY


and the following api call always returns null https://ads-api.twitter.com/0/stats/accounts/18ce53w5492?granularity=DAY&start_time=2012-11-20T07%3A00%3A00Z


Is anything worng here?


#2

Hi @mcaravind,

When I ran this request, I got the following error:

"errors": [
        {
            "code": "INVALID_TIME_WINDOW",
            "message": "Expected start_time to be precisely aligned at midnight in timezone Africa/Johannesburg for granularity DAY, got \"2012-11-20T07:00:00Z\" for start_time",

Which is pretty self-explanatory. In order to retrieve data for DAY granularity, you must set the start time to midnight in the ads account’s timezone.


#3

Thanks for your valuable reply.
I have tried with start date to midnight of account’s timezone. Its working now.