Skip to content

Terminal Function Call

Basics

  • Base URL: https://api.ticos.cn
  • Endpoint: POST /terminal/function

Headers & auth

  • Content-Type: application/json
  • Authorization: Bearer {terminal_secret}

Request fields

  • function_name (required): function name
  • arguments (optional): function args object
  • request_id (optional): request tracking ID
  • response_item_id (optional): response item ID
  • function_id (optional): function ID

Request example

{
"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 example

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
}
}'

Common status codes

  • 200 OK: success
  • 400 Bad Request: invalid params or terminal offline
  • 401 Unauthorized: authentication failed
  • 500 Internal Server Error: server error