Python 2.7 使用转销商api的apiclient.discovery.build
我正在尝试为python-2.7中的Python 2.7 使用转销商api的apiclient.discovery.build,python-2.7,oauth-2.0,google-reseller-api,Python 2.7,Oauth 2.0,Google Reseller Api,我正在尝试为python-2.7中的分销商api创建一个服务,其中包括oauth 2.0。Oauth 2.0工作正常,因为我已经验证了我可以获得访问令牌。我有此错误消息,因为我找不到经销商服务的正确文档。尽管阅读了apiclient.discovery.build中的代码,但有谁能帮我确定问题所在(问题在本文最后一部分) 以下是错误: Traceback (most recent call last): File "C:\Program Files (x86)\Google\google_a
分销商api
创建一个服务,其中包括oauth 2.0
。Oauth 2.0工作正常,因为我已经验证了我可以获得访问令牌。我有此错误消息,因为我找不到经销商服务的正确文档。尽管阅读了apiclient.discovery.build
中的代码,但有谁能帮我确定问题所在(问题在本文最后一部分)
以下是错误:
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 1535, in __call__
rv = self.handle_exception(request, response, e)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 1529, in __call__
rv = self.router.dispatch(request, response)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 1278, in default_dispatcher
return route.handler_adapter(request, response)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 1102, in __call__
return handler.dispatch()
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 572, in dispatch
return self.handle_exception(e, self.app.debug)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 570, in dispatch
return method(*args, **kwargs)
File "C:\xampp\htdocs\reseller-asteriainteractive\oauth2client\appengine.py", line 777, in setup_oauth
resp = method(request_handler, *args, **kwargs)
File "C:\xampp\htdocs\reseller-asteriainteractive\main.py", line 74, in post
customer_document = customers.insert().execute(decorator.http())
File "C:\xampp\htdocs\reseller-asteriainteractive\apiclient\discovery.py", line 583, in method
raise TypeError('Missing required parameter "%s"' % name)
TypeError: Missing required parameter "body"
这是我的密码:
class CustomerCreateHandler(BaseHandler):
@decorator.oauth_aware
def post(self):
admin_user = users.is_current_user_admin()
user = users.get_current_user()
if user:
if decorator.has_credentials():
customers = reseller_service.customers()
customer_document = customers.insert().execute(decorator.http())
self.redirect('/customer/create/')
如何构建转销商服务?“body”参数应该放在哪里?太棒了
我终于在Google API客户端库中找到了: