Hi, i am not able to access twitter ads api using below snippets
client = Client(CONSUMER_KEY,
CONSUMER_SECRET,
ACCESS_TOKEN,
ACCESS_TOKEN_SECRET)
account = client.accounts(Account_ID)

can you please help me on it, my account id is : 18ce55gh7nb

Thank you.

Thanks,
Brahma

Thanks,
Brahma

Have you received confirmation that the Ads API has been granted for your app? What error message does the request return?

We are getting below unauthorized error message.

twitter_ads.error.Forbidden: <Forbidden object at 0x7fb371157520 code=403 details=[{‘code’: ‘UNAUTHORIZED_CLIENT_APPLICATION’, ‘message’: ‘The client application making this request does not have access to Twitter Ads API’}]>

You will need to apply for and be granted access to the Ads API. Here is the link to the application:

Hi, we requested for access and got an email from Twitter as “Your app 22896784 has been granted access to the Ads API.” but when i try to access getting below error.

Can you please help me what is not allowing me to connect.

twitter_ads.error.Forbidden: <Forbidden object at 0x7fe8f0e37520 code=403 details=[{‘code’: ‘INSUFFICIENT_USER_AUTHORIZED_PERMISSION’, ‘message’: ‘User 18959506 is not authorized to make this request. Please have them reauthorize with your client application with id 22896784.’}]>

Thanks,
Brahma

Hi,

After regenerating keys, i am able to access.

But now i am getting error message like “TypeError: ‘Analytics’ object is not subscriptable”. Can you help me how can we avoid this error message?

I am getting above error message when i try to implement fetching metadata (campaign/line_item) from promoted_tweet_ids · GitHub logic.

Thank you.

Thanks,
Brahma

I am looking for some help from Twitter tech team, please provide help to unblock me.

I’m not familiar with that error and it looks like it is coming from the SDK and not the Ads API.
Feel free to ask the developer as a comment for that sample script to help debug.

It appears a lot of the issues you are running into recently have been due to using the SDK. It may be easier to explore the API using Twurl or Postman to understand the entity relationships with the API before using the SDK.

1 Like