Browse developer docs
Read current location
GETagricultural-machinery-autopilot-current-location
Request
Send GET to /open/service with serviceName=agricultural-machinery-autopilot-current-location and the common signing parameters.
Send extra fields in the URL query
Use the AutoPilot device ID from the authorized device list.
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 GET \
'https://open.xa.com/open/service' \
--url-query 'serviceName=agricultural-machinery-autopilot-current-location' \
--url-query 'sn=YOUR_AUTOPILOT_SN' \
--url-query 'deviceID=YOUR_AUTOPILOT_DEVICE_ID' \
--url-query "appUid=$XAG_APP_UID" \
--url-query "timestamp=$timestamp" \
--url-query "token=$token"| Parameter | Requirement | Meaning |
|---|---|---|
sn | Required | Authorized equipment serial number. |
deviceID | Required | AutoPilot device ID from the authorized device list. |
Response
One AutoPilot location and connectivity snapshot. Match the position to the reporting timestamp before showing it as current.
Show example response fields and types
{
"status": "number",
"data": {
"online_time": "number",
"definition_name": "string",
"model": "string",
"location": {
"latitude": "number",
"longitude": "number"
},
"sn": "string",
"dev_type": "string",
"deviceId": "string",
"lastUpdateTime": "number",
"status": "string"
}
}