终端函数调用
基础信息
- Base URL:
https://api.ticos.cn - Endpoint:
POST /terminal/function
认证与请求头
Content-Type: application/jsonAuthorization: Bearer {terminal_secret}
请求参数
function_name(必填):函数名称arguments(可选):函数参数对象request_id(可选):请求追踪 IDresponse_item_id(可选):响应项 IDfunction_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 示例
curl --location 'https://api.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:服务器错误