使用 API 演练场(Using an API playground)#
此文档网站提供了一个用于测试调用的实验区。自托管用户也可以访问作为其实例一部分托管的内置实验区。
🌐 This documentation site provides a playground to test out calls. Self-hosted users also have access to a built-in playground hosted as part of their instance.
文档测试环境(Documentation playground)#
您可以从本网站的API参考测试API调用。您需要设置服务器的基础URL和实例名称,并添加API密钥。
🌐 You can test API calls from this site's API reference. You need to set your server's base URL and instance name, and add an API key.
n8n 使用 Scalar 的开源 API 平台来驱动此功能。
🌐 n8n uses Scalar's open source API platform to power this functionality.
泄露的 API 密钥和数据
在使用沙箱环境时,请使用具有有限权限和测试数据的测试 API 密钥。来自沙箱环境的所有调用都会通过 Scalar 的代理服务器路由。
真实数据
您可以访问您的实时数据。这对于尝试请求非常有用。请注意,您可以更改或删除真实数据。
内置 Playground(Built-in playground)#
功能可用性
API 演示平台在云端不可用。它适用于所有自托管定价层。
n8n API 在自托管版本中自带内置的 Swagger UI 演示环境。这提供了交互式文档,你可以在其中尝试请求。访问演示环境的路径取决于你的托管方式。
🌐 The n8n API comes with a built-in Swagger UI playground in self-hosted versions. This provides interactive documentation, where you can try out requests. The path to access the playground depends on your hosting.
n8n 根据你设置的环境变量值构建路径:
🌐 n8n constructs the path from values set in your environment variables:
1 | |
API 版本号是 1。将来可能会有多个版本可用。
🌐 The API version number is 1. There may be multiple versions available in the future.
Real data
If you select Authorize and enter your API key in the API playground, you have access to your live data. This is useful for trying out requests. Be aware you can change or delete real data.
The API includes built-in documentation about credential formats. This is available using the credentials endpoint:
1 | |
How to find credentialTypeName
To find the type, download your workflow as JSON and examine it. For example, for a Google Drive node the {credentialTypeName} is googleDriveOAuth2Api:
1 2 3 4 5 6 7 8 9 | |