Browse developer docs
Query task list
POSTuav-protection-work-query
Request
Send POST to /open/service with serviceName=uav-protection-work-query and the common signing parameters.
Send extra fields in the JSON body
Use seconds for the date bounds. Start at page 1. Maximum page size is 100. Filter by work_status or is_prescription if needed.
Request example
# Requires curl 7.87+, Python 3 and OpenSSL.
: "${XAG_APP_UID:?Set XAG_APP_UID}"
: "${XAG_APP_SECRET:?Set XAG_APP_SECRET}"
timestamp=$(python3 -c 'import time; print(time.time_ns() // 1000000)')
token=$(printf "%s" "$XAG_APP_UID$timestamp$XAG_APP_SECRET" | openssl dgst -sha1 -r | cut -d " " -f 1)
curl --silent --show-error --fail-with-body --max-time 30 --request POST \
'https://open.xa.com/open/service' \
--url-query 'serviceName=uav-protection-work-query' \
--url-query "appUid=$XAG_APP_UID" \
--url-query "timestamp=$timestamp" \
--url-query "token=$token" \
--header 'Content-Type: application/json' \
--data '{
"sn": "YOUR_DRONE_SN",
"start_day": 1788134400,
"end_day": 1788739200,
"page_no": 1,
"page_size": 20
}'| Parameter | Requirement | Meaning |
|---|---|---|
start_day | Required | Start of the work date range in Unix seconds. |
end_day | Required | End of the work date range in Unix seconds. |
sn | Required | Authorized equipment serial number. |
account | Conditional | For personal data authorization, provide the authorized account as country code, hyphen, then phone number. |
work_status | Optional | Filter unfinished (0) or completed (1) work. |
work_guid | Optional | Job identifier returned as guid in the drone task list. |
is_prescription | Optional | Filter regular (0) or prescription (1) jobs. |
page_size | Required | Number of records per page. |
page_no | Required | Page number, starting at 1. |
Response
data.records contains job IDs in guid. Use work_status for completion and prescription_guid to correlate a prescription when present.
Show example response fields and types
{
"success": "boolean",
"data": {
"total": "number",
"size": "number",
"current": "number",
"records": [
{
"guid": "string",
"sn": "string",
"start_time": "number",
"end_time": "number",
"start_day": "number",
"is_prescription": "number",
"prescription_guid": "string",
"work_status": "number"
}
]
},
"message": "string",
"status": "number"
}