Cannot access the /stats/ part of the API (Topic #2)


Hello Twitter stuff,

I experience same problem to: Cannot access the /stats/ part of the API

Please add my account/organization to whitelist.

I was able to see my account using:

$ twurl accounts

But this command and other in this style:
$ twurl -X GET -H “/campaigns”
($ twurl -X GET -H “/0/stats/account/my_acc”)

or SANDBOX api

$ twurl -H /0/accounts/

{“errors”:[{“code”:“UNAUTHORIZED_CLIENT_APPLICATION”,“message”:“The client application making this request does not have access to this API”}],“request”:{“params”:{}}}

Please assist.

Thanks in advance,
Alex Fedorov.



Below is the message from our tech team. has self-restricted themselves to Read-Only. They can log into to change the Permission from Read-Only to Read+Write. Once they do that, they need to re-auth the user they are testing with, to pick-up the new permission.”





I’ve created the application MarketsAnalyze two weeks ago and verified that it has R+W permission.

Screen shot sent separately to you.

Am I missing something?




After confirming that you have read+write permission on, have you re-authorized the user you are testing with, to pick-up the corrected permission?


I did it a lot of times and did it once again just now. Nothing helps.

In order eliminate misunderstanding I will show you what I did:
I submitted:
Twurl authorize –consumer-key XXXX –consumer-secret XXXX
(XXXX- replaces real values for security purpose )
Got link. Pasted it in the browser. Signed in with user @marketsdotcom and password.
Pasted it back to Linux command line.
Got Authorization successful.
Twurl accounts
Got accounts ( actually same account to @marketsdotcom and Marketsdotcom )
Twurl –X GET –H “/campaigns”
{“errors”:[{“code”:”UNAUTHORIZED_CLIENT_APPLICATION”,”message”:”The client application making this request does not have access to this API”}],”request”:{“params”:{}}}

Additional problems:
I cannot run examples shown on:

I didn’t succeed to work with SANDBOX. I get same error: ”UNAUTHORIZED_CLIENT_APPLICATION”…


@Marketsdotcom what’s the consumer key you’re using for one of these failing requests?


Hi Brandonmblack,

Here it is:

–consumer-key G5RWFmT3Te7ymmlnMtkTZ57yv


I cannot work with:

I always get:


This is not the API key that was granted access to the Ads API. Please refer back to your confirmation email for the whitelisted app ID.


Dear Jillblaz,

I haven’t received any confirmation email, maybe it has been sent to other person who initially registered in Twitter.

The key “story” is very confusing, I expect to get only one key that will work according to permitions that I assign to my application here:

Please help me with step by step explanation how to write a simple script (in TwURL) that will work in batch mode from Linux server.

The script should be able to download performance statistics from Twitter in CSV format exactly as I can do manually here:

Please also explain me how can I obtain a valid key that will work for me.

Many thanks in advance!


Hi Alex,

I believe you have a conversation going on with a business stakeholder to ensure the correct application is whitelisted now. Please check on that with your team, if you do not receive something, as access should be sorted.

As for the keys, we use OAuth 1.0A for all requests to the Twitter Ads API. You’ll have a Consumer Key and a Consumer Secret and these are associated with your Twitter Client Application (via These are used in conjunction with the user tokens you get for each user you access the API on behalf of.

For each user that authenticates with your application, you will also get a user token and user secret, which will be used in signing your subsequent OAuth 1.0A requests made to the Twitter APIs on that user’s behalf. You’ll need those to access each user’s advertiser account.

For more information on the general Twitter OAuth flow for user-context (all Ads API endpoints), check out Single-user OAuth with Examples.

You will gain access to advertiser accounts via a user access token and it’s secret. The secret for both your application and each user is the equivalent to a password, so keep those secure. They will allow access to whatever accounts they also have permission to see at For a summary of how to gain access to advertiser accounts, check out Obtaining Ads Account Access.

Finally, on stats as a CSV, we don’t return any CSVs like we do in our UI via the API. All of our responses are returned as JSON and you will need to construct a CSV if that’s the end result you’re looking for from the API calls that you make.

Hope this helps.


This topic was automatically closed after 18 hours. New replies are no longer allowed.