Receiving 401 Unauthorized for ads-api.twitter.com/1/stats/accounts/


#1

I am a developer trying to get a response back with the following GET call (I’ve omitted the CAMPAIGN_ID and ACCOUNT_ID):

GET https://ads-api.twitter.com/1/stats/accounts/MY_ACCOUNT_ID?start_time=2016-08-17T07:00:00Z&granularity=TOTAL&end_time=2016-08-25T07:00:00Z&metric_groups=BILLING&placement=ALL_ON_TWITTER&entity_ids=MY_CAMPAIGN_ID&entity=CAMPAIGN

When making this call I get a 401 Unauthorized…

BUT - if I make the following call:
GET https://ads-api.twitter.com/1/stats/accounts/MY_ACCOUNT_ID I don’t get a HTTP STATUS CODE 401 and instead get a HTTP STATUS CODE 200 with the following result:

{“request”:{“params”:{}},“data_type”:“job”,“next_cursor”:null,“data”:[]}

This tells me that I should be authorized to make calls to Twitters Ads API - I am completely unsure why the first GET is giving me a 401.

Any help or guidance would be appreciated.


#2

Hi, @SteelHouse. Sorry about the delay here.

In order for us to reproduce this, could you please provide the account and campaign IDs?


#3

@SteelHouse: Have you been able to resolve this? If not, we’d like to help, but need the account and campaign IDs to try and reproduce this. Thanks!


#4

@juanshishido
Sorry for my delay. I hadn’t noticed that anyone finally replied.

No, we haven’t solved the problem, but I also haven’t looked at it in quite some time either. We’ve just been working around it by never trying to update the timesTomorrow, I’ll look to repro it and get you the details


#5

Sorry for the delay as well -

We have resolved this and thank you for the replies.


#6

Sounds good. Thanks, @SteelHouse! As always, if you have questions, we’re here to help.