【问题标题】:Python - You are calling a deprecated version of the Ads APIPython - 您正在调用已弃用的 Ads API 版本
【发布时间】:2021-01-25 15:46:08
【问题描述】:

这似乎是使用 Facebook API 时的一个常见问题。我正在尝试使用 Python 使用广告 API。当我使用 Graph API Explorer 对其进行测试时,我使用的是 9.0 版,并且没有收到任何错误。我正在尝试使用 Python 实现 API 调用,但是当我指定版本 9.0 时,我收到了以下错误日志:

facebook.GraphAPIError: Valid API versions are '2.8', '2.9', '2.10', '2.11', '2.12', '3.0', '3.1'

我的代码:

import facebook
token = "<token>"
graph = facebook.GraphAPI(access_token=token, version="9.0")
events = graph.request("?ids=<id>")
print(events)

但是当我使用3.1&lt; than 3.1 版本时,我又遇到了另一个错误:

facebook.GraphAPIError: (#2635) You are calling a deprecated version of the Ads API. Please update to the latest version: v9.0.

我该如何解决?

【问题讨论】:

    标签: facebook facebook-graph-api facebook-marketing-api facebook-python-business-sdk


    【解决方案1】:

    似乎与较旧的 SDK 相关(参见 github 上的代码)

    建议你更新到官方Facebook SDK for Python

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-07-05
      • 1970-01-01
      • 1970-01-01
      • 2022-01-14
      • 1970-01-01
      • 2010-09-30
      相关资源
      最近更新 更多