跳转到内容

终端函数调用

  • Base URL: https://stardust.ticos.cn
  • Endpoint: POST /terminal/function
  • Content-Type: application/json
  • Authorization: Bearer {terminal_secret}
  • function_name(必填):函数名称
  • arguments(可选):函数参数对象
  • request_id(可选):请求追踪 ID
  • response_item_id(可选):响应项 ID
  • function_id(可选):函数 ID
{
"function_name": "control_robot_motion",
"arguments": {
"action": "move_forward",
"distance": 1.5,
"speed": 0.5
},
"request_id": "req_12345",
"response_item_id": "resp_67890",
"function_id": "func_abcde"
}
curl --location 'https://stardust.ticos.cn/terminal/function' \
--header 'Authorization: Bearer ts_xxx_terminal_secret' \
--header 'Content-Type: application/json' \
--data-raw '{
"function_name": "play_audio",
"arguments": {
"audio_url": "https://example.com/audio.wav",
"volume": 80
}
}'
  • 200 OK:成功
  • 400 Bad Request:参数错误或设备不在线
  • 401 Unauthorized:鉴权失败
  • 500 Internal Server Error:服务器错误