在大多数文档页面上,屏幕右侧都会显示一个简化版 API Explorer。如果 API Explorer 未显示,请点击 Try it! 以显示 API Explorer 的精简版本。
如果参考文档页面中没有显示试试看!字样,则 API Explorer 不支持该方法。例如,API Explorer 与需要服务帐号的 API 不兼容,因此它不会显示在这些 API 的文档页面上。
显示 API Explorer 的展开版本
API Explorer 的展开版本包含 c网址、HTTP 及可能的其他代码示例。要显示 API Explorer 的展开版本,请点击“全屏”图标 fullscreen。
执行方法
您可以使用 API Explorer 输入 API 方法的必需参数、可选参数和请求正文(如果适用)。对于许多 REST 方法(例如 list 方法),您只需要填充一个或两个字段即可执行该方法。例如,Books API 的 books.volumes.list 方法只需要查询参数 (q) 即可列出图书。如需试用 books.volumes.list 方法,请执行以下操作:
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2022-04-27。"],[[["The APIs Explorer allows you to test API methods directly in the documentation by providing parameters and executing requests."],["To use the APIs Explorer with methods requiring authorization, you need to generate and use your own credentials."],["The expanded APIs Explorer provides code samples in various formats like cURL and HTTP for easier integration."],["If you encounter a 401 or 403 error, verify the authorization type and scope, as they are the most common causes."],["The APIs Explorer uses popups for authorization, so ensure your browser settings allow them to function correctly."]]],[]]