Facebook GraphAPI 版本中的错误 ||GraphAPIError:有效的API版本为"2.8"、"2.9"、"2.10"、"2.11"、"2.12"、"3.0"'3.1'



我一直在为Facebook创建一个API;GraphAPIError:有效的API版本为"2.8"、"2.9"、"2.10"、"2.11"、"2.12"、"3.0"、"3.1";。有什么解决方案吗?因为我已经尝试了发布在互联网/堆栈溢出上的多种解决方案,但没有解决方案来解决我的问题。

请帮我解决这个错误:(

import pandas as pd
import facebook
import json

df1 = pd.DataFrame(columns = ['Ad_Account_ID','ad_account_name','study_id','study_name','cells_id','cells_name','cells_treatment_percentage','objective_id','objective_name','cell_id_updated',
'experiment_id','population_reached','impressions','frequency','spend','advancedScoreMean_test','advancedScoreMean_control',
'advancedScoreMean_incremental','advancedBreakthroughs_incremental','advancedCostPerIncrementalBreakthrough'])
z = 0
file_location = ('C:/xyz/Desktop/facbook-api/acesstoken.xlsx')
df = pd.read_excel(file_location)
Access_Token = df['Token'][0]
Brand_ID = '123xxxxxxx'
graph = facebook.GraphAPI(Access_Token,version = 7.0)
k=0

profile = graph.get_object(Brand_ID + '?fields=adaccounts.limit(700){name,ad_studies{name,cells,objectives{name,results}}}')
print (profile)

在此处输入图像描述

您可以将版本号放在引号中:

graph=脸书。GraphAPI(Access_Token,版本="7.0"(

发件人:https://facebook-sdk.readthedocs.io/en/latest/api.html

最新更新