api-setup

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

API Setup

API 搭建

This skill helps you set up a new API integration with our standard configuration.
本技能可帮助您按照我们的标准配置搭建新的API集成。

Steps

步骤

  1. Run
    setup.sh <api-name>
    to create the integration directory
  2. Copy
    templates/config.template.json
    to your integration directory
  3. Update the config with your API credentials
  4. Test the connection
  1. 运行
    setup.sh <api-name>
    创建集成目录
  2. templates/config.template.json
    复制到您的集成目录中
  3. 更新配置文件,填入您的API凭证
  4. 测试连接

Configuration

配置说明

The config template includes:
  • api_key
    : Your API key (get from the provider's dashboard)
  • endpoint
    : API endpoint URL
  • timeout
    : Request timeout in seconds (default: 30)
配置模板包含以下内容:
  • api_key
    : 您的API密钥(可从服务商控制台获取)
  • endpoint
    : API端点URL
  • timeout
    : 请求超时时间(单位:秒,默认值:30)

Verification

验证步骤

After setup, verify:
  • Config file is valid JSON
  • API key is set and not a placeholder
  • Test connection succeeds
搭建完成后,请验证以下内容:
  • 配置文件为有效的JSON格式
  • API密钥已正确设置,而非占位符
  • 连接测试成功

Troubleshooting

故障排查

Connection Timeout

连接超时

If you experience connection timeouts:
  1. Check your network connection
  2. Verify the endpoint URL is correct
  3. Increase the timeout value in config
如果遇到连接超时问题:
  1. 检查您的网络连接
  2. 验证端点URL是否正确
  3. 增加配置文件中的超时时间值

Authentication Errors

认证错误

If you get 401/403 errors:
  1. Verify your API key is correct
  2. Check if the key has the required permissions
  3. Ensure the key hasn't expired
如果出现401/403错误:
  1. 验证您的API密钥是否正确
  2. 检查该密钥是否具备所需权限
  3. 确认密钥未过期