随航一步(SidecarOneStep)随航一步(SidecarOneStep)
指南
功能展示
下载 macOS 版
指南
功能展示
下载 macOS 版
  • 开始使用

    • 快速开始
    • 安装指南
  • 高级功能

    • Web 控制台
    • REST API 参考

REST API 参考

SidecarOneStep 提供了 RESTful API,方便开发者集成。

基础信息

  • 默认端口: 8765
  • Base URL: http://localhost:8765
  • 鉴权: 如果在设置中开启了鉴权,需要在 Header 中添加 Authorization: Bearer <YOUR_API_KEY>。

接口列表

1. 获取设备列表

  • URL: /devices
  • Method: GET
  • Response:
    {
      "code": 0,
      "message": "success",
      "data": {
        "devices": ["Joe's iPad", "iPad Pro"]
      }
    }
    

2. 连接设备

  • URL: /connect
  • Method: POST
  • Body:
    {
      "name": "Joe's iPad",
      "wired": false
    }
    

    name 为可选。若为空,则连接第一个可用设备。wired 为 true 时强制使用有线模式。

3. 断开设备

  • URL: /disconnect
  • Method: POST
  • Body:
    {
      "name": "Joe's iPad"
    }
    

4. 切换状态 (Toggle)

  • URL: /toggle
  • Method: POST
  • Body:
    {
      "name": "Joe's iPad"
    }
    

Swagger 文档

应用开启调试模式后,访问 /docs 路径(例如 http://localhost:8765/docs)可查看交互式 Swagger UI 文档。

最近更新: 2025/12/22 00:03
Contributors: zhangyi
Prev
Web 控制台