我想通过 Google 搜索 API 访问我的 Google Affiliate Network 产品供稿以进行购物。我想从我正在开发的后端 Python 库中执行此操作。有没有人做过这样的事情?
我有以下内容:
- 一个谷歌帐户
 - 在 Google API 控制台中启用 Search API for Shopping 并获得 API 密钥(用于服务器应用程序)和客户端 ID + 客户端密码(用于已安装的应用程序)。
 - 一个 GAN 帐户并获得了 pid。
 - 几个批准我的广告商,所以我的产品提要中有可用的产品。
 
OAuth2 Python 代码:
from apiclient.discovery import build
from oauth2client.client import OAuth2WebServerFlow
from oauth2client.tools import run
from oauth2client.django_orm import Storage
from models import CredentialsModel 
storage = Storage(CredentialsModel, 'name', 'GAN Reporting', 'credentials')
credentials = storage.get()
if credentials is None or credentials.invalid == True:
    flow = OAuth2WebServerFlow(
        client_id=MyClientID,
        client_secret=MyClientSecret,
        scope='https://www.googleapis.com/auth/shoppingapi',
        user_agent='cleverblocks/1.0',
        access_type='offline')
    credentials = run(flow, storage)
http = httplib2.Http()
credentials.authorize(http)
client = build('shopping', 'v1', http=http,
    developerKey=MyAPIKey)
resource = client.products()
request = resource.list(source='gan:MyGANPid', country='US')
return request.execute()
运行这个我得到以下错误(HttpError 412):
没有为给定发布商注册广告商
我用来验证的用户列在 GAN->settings->users 部分。
我一直在从各个方向进行黑客攻击,直到我现在开始认为这个 API 被破坏了。有没有人设法通过 Search API for Shopping 访问 GAN 产品提要?
任何帮助表示赞赏。