flighttask_prepare

DJI Services · wayline · flighttask_prepare

Request Params

vendor
string
必填
固定 dji
device_id
string
必填
目标设备 ID
command_type
string
必填
固定 flighttask_prepare
idempotency_key
string
必填
幂等键;重复请求返回同一命令
timeout_seconds
integer
超时秒数,范围 0~300
payload.break_point
object
method payload 字段
payload.executable_conditions
object
method payload 字段
payload.execute_time
integer
必填
method payload 字段
payload.exit_wayline_when_rc_lost
integer
必填
method payload 字段
payload.file
object
必填
method payload 字段
payload.flight_id
string
必填
method payload 字段
payload.out_of_control_action
integer
必填
method payload 字段
payload.ready_conditions
object
method payload 字段
payload.rth_altitude
integer
必填
method payload 字段
payload.simulate_mission
object
method payload 字段
payload.task_type
integer
必填
method payload 字段
payload.rth_mode
integer
必填
method payload 字段

Create Response

command_id
string(uuid)
平台命令受理标识,全平台唯一 UUID
status
string
受理状态:ACCEPTED
accepted_at
string(datetime)
命令受理时间(UTC)

Query Response

command_id
string(uuid)
平台命令受理标识,全平台唯一 UUID
status
string
执行状态:ACCEPTED / DELIVERED / SUCCEEDED / FAILED / TIMED_OUT / UNMATCHED_RESPONSE
vendor
string
厂商标识,固定为 dji
device_id
string
目标设备 ID
command_type
string
method 名称
response_code
string
设备侧执行码
response_message
string
设备侧执行信息
vendor_response
object
原始厂商回包(透传)

DJI Services Reply Mapping

设备通过 services_reply 返回命令结果,平台使用 tid 关联到 command_id 并更新命令状态。接入方不需要直接处理 MQTT 回包。
Open Platform 字段DJI services_reply 来源
response_code优先使用 data.code;不存在时回退到 data.result
response_messagedata.message / data.msg / data.description
vendor_responseDJI 回包摘要,保留 resultcodemessageoutput 等原始扩展字段
data.result = 0 表示设备侧执行成功;非 0 表示设备侧执行失败,平台会将命令推进为失败终态。
curl -X POST "/api/v1/open/downlink/commands" \
  -H "Content-Type: application/json" \
  -H "X-Api-Id: YOUR_API_ID" \
  -H "X-Api-Timestamp: YOUR_UNIX_SECONDS" \
  -H "X-Api-Nonce: YOUR_NONCE" \
  -H "X-Api-Signature: YOUR_SIGNATURE" \
  -d '{"vendor":"dji","device_id":"drone-001","command_type":"flighttask_prepare","payload":{"execute_time":0,"exit_wayline_when_rc_lost":0,"file":{"fingerprint":"string","url":"https://example.com/path"},"flight_id":"id-001","out_of_control_action":0,"rth_altitude":0,"task_type":0,"rth_mode":0,"break_point":{"index":0,"state":0,"progress":0.0,"wayline_id":0,"break_reason":0,"latitude":0.0,"longitude":0.0,"height":0.0,"attitude_head":0.0},"executable_conditions":{"storage_capacity":0},"ready_conditions":{"battery_capacity":0,"begin_time":0,"end_time":0},"simulate_mission":{"is_enable":0,"latitude":0.0,"longitude":0.0}},"idempotency_key":"req-flighttask_prepare-001","timeout_seconds":30}'

curl "/api/v1/open/downlink/commands/676eda60-93c8-3534-3add-1e24d30c7d43"
{
  "command_id": "676eda60-93c8-3534-3add-1e24d30c7d43",
  "status": "ACCEPTED",
  "accepted_at": "2026-04-22T12:00:00Z"
}