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


#1

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 ads-api.twitter.com “/campaigns”
($ twurl -X GET -H ads-api.twitter.com “/0/stats/account/my_acc”)

or SANDBOX api

$ twurl -H ads-api-sandbox.twitter.com /0/accounts/

Yield:
{“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.


#2

Alex,

Below is the message from our tech team.

Markets.com has self-restricted themselves to Read-Only. They can log into https://apps.twitter.com 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.”

Thanks,

Jackie


#3

Jackie,

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?

Thanks,
Alex.


#4

Jackie:

After confirming that you have read+write permission on https://apps.twitter.com, have you re-authorized the user you are testing with, to pick-up the corrected permission?

Alex:

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:
1.
I submitted:
Twurl authorize –consumer-key XXXX –consumer-secret XXXX
(XXXX- replaces real values for security purpose )
2.
Got link. Pasted it in the browser. Signed in with user @marketsdotcom and password.
Got TOKEN.
3.
Pasted it back to Linux command line.
Got Authorization successful.
4.
Submitted:
Twurl accounts
Got accounts ( actually same account to @marketsdotcom and Marketsdotcom )
5.
Submitted:
Twurl –X GET –H ads-api.twitter.com “/campaigns”
Got:
{“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:
https://dev.twitter.com/ads/campaigns

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


#5

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


#6

Hi Brandonmblack,

Here it is:

–consumer-key G5RWFmT3Te7ymmlnMtkTZ57yv


#7

I cannot work with:
ads-api

I always get:
”UNAUTHORIZED_CLIENT_APPLICATION”


#8

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.


#9

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:
https://ads.twitter.com/accounts/18ce53y9hd8/campaigns_dashboard

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

Many thanks in advance!
Alex


#10

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 apps.twitter.com). 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 ads.twitter.com. 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.


#11

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