Disha Sood
Disha Sood

Reputation: 11

TikTok API Permission Error when Fetching Campaign and Ad Reports Details in Python

I'm encountering difficulties while running a Python script to fetch TikTok API campaign and ad reports. Currently, I'm able to retrieve the campaign ID and name, but when attempting to access further details such as clicks, total_cost, conversions, impressions, cpm, cpc, I receive the following error:

{'code': 40102, 'msg': "You don't have permission to operate this", 'extra': {'i18n_key': 'KEY_PERMISSION_ERROR', 'type': 'permission_statement_failure'}, 'data': {}}

I suspect it's a permission issue, and I'm seeking guidance on how to resolve this.I'd appreciate any insights or code samples that could help me fetch the desired details successfully.

Upvotes: 1

Views: 939

Answers (1)

mlueckl
mlueckl

Reputation: 198

Generally, please provide code examples as it's impossible to know why it might be failing.

For your case, I don't think it's a problem with the code but with your TikTok Dev App setup and the scope of permission.

Go to https://business-api.tiktok.com/portal/apps, or where your App was created, and make sure that Reporting is enabled.

Best

Upvotes: 0

Related Questions