@juanshishido can you elaborate a little on the “improper encoding” here. I figured that it had something to do with how I was encoding my ISO 8601 timestamps (and therefore the signature) because I, like Matias, tried doing it with YYYY-mm-dd
dates, which worked. But when I do encode my query string params, I still get a 401. This makes me feel like my signing method is correct (because I can get data when date is formatted like YYYY-mm-dd
), but I’m handling the ISO 8601 case incorrectly.
URL looks like:
https://ads-api.twitter.com/4/stats/accounts/<ACCOUNT_ID>?entity=CAMPAIGN&metric_groups=ENGAGEMENT%2CBILLING&granularity=HOUR&placement_type=ALL_ON_TWITTER&entity_ids=<CAMPAIGN_ID>&start_time=2019-02-11T00%3A00%3A00Z&end_time=2019-02-12T00%3A00%3A00Z