我需要从tiktok中获取活动数据,广告组和广告,这是我试过的
import requests
url = "https://business-api.tiktok.com/open_api/v1.3/campaign/get/"
access_token = "your_access_token"
headers = {
"Authorization": f"Bearer {access_token}"
}
response = requests.get(url, headers=headers)
if response.status_code == 200:
print(response.json())
else:
print(f"Failed to fetch ad campaigns. Status code: {response.status_code}")
print(None)
字符串
但这会产生如下误差
{'code': 40104, 'message': 'Access token is null, you should set it in http header with key Access-Token.', 'request_id': '', 'data': {}}
型
1条答案
按热度按时间dfddblmv1#
你的头是错误的(因为它也在错误中说),它必须是:
字符串
正式文件:https://ads.tiktok.com/marketing_api/docs?id=1739315828649986