Thanks for the question, @kishore_uber. Nice to meet you, too.
We’ve been able to repro this (with a slightly modified request):
$ twurl -H ads-api.twitter.com "/2/stats/accounts/18ce54h9509?placement=ALL_ON_TWITTER&metric_groups=ENGAGEMENT&start_time=2017-10-15T03:00:00Z&end_time=2017-10-16T02:00:00Z&granularity=DAY&entity=CAMPAIGN&entity_ids=9nb5s"
{
"errors": [
{
"code": "INVALID_TIME_WINDOW",
"message": "Expect time to be midnight in the account's local timezone for day granularity",
"parameter": ""
}
],
"request": {
"params": {
"start_time": "2017-10-15T03:00:00Z",
"entity_ids": [
"9nb5s"
],
"end_time": "2017-10-16T02:00:00Z",
"placement": "ALL_ON_TWITTER",
"account_id": "18ce54h9509",
"granularity": "DAY",
"entity": "CAMPAIGN",
"metric_groups": [
"ENGAGEMENT"
]
}
}
}
It looks like there is an issue with the way we check for midnight in the account’s local timezone.
As a workaround, please request data at hour granularity (granularity=HOUR). This is the same exact request, but with a different granularity value:
$ twurl -H ads-api.twitter.com "/2/stats/accounts/18ce54h9509?placement=ALL_ON_TWITTER&metric_groups=ENGAGEMENT&start_time=2017-10-15T03:00:00Z&end_time=2017-10-16T02:00:00Z&granularity=HOUR&entity=CAMPAIGN&entity_ids=9nb5s"
{
"data_type": "stats",
"time_series_length": 23,
"data": [
{
"id": "9nb5s",
"id_data": [
{
"segment": null,
"metrics": {
"impressions": [30,15,13,3,2,1,2,11,5,47,84,84,64,77,55,83,74,67,51,60,69,38,66],
"tweets_send": null,
"qualified_impressions": null,
"follows": null,
"app_clicks": [1,1,0,0,0,0,0,0,0,0,0,0,1,1,2,0,0,0,0,0,0,0,0],
"retweets": null,
"likes": null,
"engagements": [1,1,0,3,0,0,0,0,0,0,1,1,4,2,3,0,0,1,0,1,0,0,0],
"clicks": [0,0,0,3,0,0,0,0,0,0,1,1,3,1,1,0,0,1,0,1,0,0,0],
"card_engagements": [1,1,0,0,0,0,0,0,0,0,0,0,1,1,2,0,0,0,0,0,0,0,0],
"poll_card_vote": null,
"replies": null,
"url_clicks": null,
"carousel_swipes": null
}
}
]
}
],
"request": {
"params": {
"start_time": "2017-10-15T03:00:00Z",
"segmentation_type": null,
"entity_ids": [
"9nb5s"
],
"end_time": "2017-10-16T02:00:00Z",
"country": null,
"placement": "ALL_ON_TWITTER",
"granularity": "HOUR",
"entity": "CAMPAIGN",
"platform": null,
"metric_groups": [
"ENGAGEMENT"
]
}
}
}
We’ll add this to our backlog, but can’t provide an estimate as to when it might be fixed.