@macy_poc: Please see the example requests and responses, below.
GET /1/stats/accounts/:account_id
$ twurl -H ads-api.twitter.com "/1/stats/accounts/18ce54d4x5t?entity=LINE_ITEM&entity_ids=6vn5g&start_time=2016-11-24&end_time=2016-11-26&granularity=DAY&placement=ALL_ON_TWITTER&metric_groups=ENGAGEMENT" | jq
{
"data_type": "stats",
"time_series_length": 2,
"data": [
{
"id": "6vn5g",
"id_data": [
{
"segment": null,
"metrics": {
"impressions": [
0,
68
],
"tweets_send": null,
"qualified_impressions": null,
"follows": null,
"app_clicks": null,
"retweets": null,
"likes": [
0,
1
],
"engagements": [
0,
14
],
"clicks": [
0,
4
],
"card_engagements": null,
"replies": null,
"url_clicks": null,
"carousel_swipes": null
}
}
]
}
],
"request": {
"params": {
"start_time": "2016-11-24T08:00:00Z",
"segmentation_type": null,
"entity_ids": [
"6vn5g"
],
"end_time": "2016-11-26T08:00:00Z",
"country": null,
"placement": "ALL_ON_TWITTER",
"granularity": "DAY",
"entity": "LINE_ITEM",
"platform": null,
"metric_groups": [
"ENGAGEMENT"
]
}
}
}
GET stats/accounts/:account_id/reach/campaigns
$ twurl -H ads-api.twitter.com "/1/stats/accounts/18ce54d4x5t/reach/campaigns?campaign_ids=6l0nl&start_time=2016-11-24&end_time=2016-11-26" | jq
{
"request": {
"params": {
"campaign_ids": [
"6l0nl"
],
"start_time": "2016-11-24T00:00:00Z",
"end_time": "2016-11-26T00:00:00Z",
"account_id": "18ce54d4x5t"
}
},
"data_type": "reach",
"data": [
{
"id": "6l0nl",
"total_audience_reach": 68,
"average_frequency": 1
}
]
}
In both cases, you can find the start and end times in request.params.start_time and request.params.end_time, respectively. That being said, you will have this information prior to seeing the response, because you would have had to pass in those values.