获取客户端模拟器的响应发现 json

Getting the response discovery json for the client mocker

我正在尝试使用 Google API 模拟程序,如下文所述。但是日历 API,而不是书籍 API。

from apiclient.discovery import build
from apiclient.http import HttpMock
import pprint

http = HttpMock('books-discovery.json', {'status': '200'})
api_key = 'your_api_key'
service = build('books', 'v1', http=http, developerKey=api_key)
request = service.volumes().list(source='public', q='android')
http = HttpMock('books-android.json', {'status': '200'})
response = request.execute(http=http)
pprint.pprint(response)

有一个图书发现示例 json return 值 here

如何为发现日历 API V3 生成或获取响应 json?

您可以使用 API Discovery Service 获取日历 API v3 的发现文档。