Hi there! I’m facing a problem with getting analytics data for a promoted tweet using the endpoint GET /1/stats/accounts/:account_id.
I’m not sure if this endpoint should have the .json suffix or not, as other endpoints must have (for example, the endpoint for campain editing works only with the “.json” suffix, even though this doesn’t appear on the endpoint’s documentation page).
I have made 2 requests, with the suffix and without the suffix, and both return an error, not the same one though:
GET /1/stats/accounts/18ce53z82f8.json?entity=PROMOTED_TWEET&entity_ids=cn1iw&granularity=DAY&start_time=2015-09-07T07%3A00%3A00Z&end_time=2015-09-11T07%3A00%3A00Z&metric_groups=ENGAGEMENT&placement=ALL_ON_TWITTER
returns
HTTP/1.1 400 Bad Request
{"errors":[{"code":"MISSING_PARAMETER","message":"\"account_id\" is a required parameter","parameter":"account_id"}],"request":{"params":{}}}
and
GET /1/stats/accounts/18ce53z82f8?entity=PROMOTED_TWEET&entity_ids=cn1iw&granularity=DAY&start_time=2015-09-07T07%3A00%3A00Z&end_time=2015-09-11T07%3A00%3A00Z&metric_groups=ENGAGEMENT&placement=ALL_ON_TWITTER
returns
HTTP/1.1 401 Authorization Required
{"errors":[{"code":"UNAUTHORIZED_ACCESS","message":"This request is not properly authenticated"}],"request":{"params":{}}}
As far as I can see, the parameters are not recognized either.
The account is in the America/Denver timezone, which is UTC-7.
Could anyone help me with this, please? I can’t figure out what I’m doing wrong.
Thank you!