Trouble Accessing Data on Ads API (using PHP)



I’ve been trying to access data on a particular account that I have access to via the ADs API but keep getting either “UNAUTHORIZED ACCESS” or “ACTION_NOT_ALLOWED” error messages when I try to make certain calls.

Calls That I’ve Tried so far:
/accounts/ == Works as expected.
/accounts/XXXXXX/promoted_tweets == ACTION_NOT_ALLOWED
/stats/jobs/accounts/XXXXXX?entity=account == UNAUTHORIZED_ACCESS

I’m 99.9% sure I have the coding and auth settings correct because it’s working fine with this call:
…but not on any of the others listed.

The consumer key, secret, account id, etc are def all correct in the code. The only thing I can think of that I haven’t tried is that the access level of the authenticated user to get this info needs to be higher than an Analyst? Or do we need to regenerate all the keys and secrets again?

Just a little extra background:

  • I see the correct account id that I’m trying to access in the response from the “/accounts/” call.
  • The app information we’re using is from an approved one (for ads api) and our level of access is an Analyst.

Attached are screenshots of the response messages I’m seeing:


Hi @thomasdintrone, as you suspected you will need higher level of access for this account to be able to use the API to pull this data. Some info at the link below:


@joncipriano, thanks for the quick response. We upgraded our account and I’m now seeing new information but certain other calls I’m still getting the UNAUTHORIZED_ACCESS Error. Any thoughts?

Example Call:


Hi @thomasdintrone ,

I see you masked your Ads account ID on that screen shot. Providing your Ads account ID here (publicly) is totally safe. Could you tell us your Ads account ID so that we can get more insight for this issue?



Hi @jrsyo, ah ok I wasn’t sure so thought it was a safe bet to leave it out. The account ID is aefe1



Thanks. Please check this post:

Are you encoding your OAuth header strings?