Browse developer docs
Read an irrigation scene
POSTfarm-device-smart-detail
Request
Send POST to /open/service with serviceName=farm-device-smart-detail and the common signing parameters.
Send extra fields in the JSON body
Use the ID from the scene 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 POST \
'https://open.xa.com/open/service' \
--url-query 'serviceName=farm-device-smart-detail' \
--url-query "appUid=$XAG_APP_UID" \
--url-query "timestamp=$timestamp" \
--url-query "token=$token" \
--header 'Content-Type: application/json' \
--data '{
"org_id": "YOUR_FARM_ID",
"fs_sn": "YOUR_FARM_SERVER_SN",
"id": "YOUR_SCENE_ID"
}'| Parameter | Requirement | Meaning |
|---|---|---|
org_id | Required | Authorized farm or organization ID. |
fs_sn | Required | Farm server serial from farm-server-list. |
id | Required | Scene ID from the scene list. |
Response
The scene type governs the returned property fields, including irrigation state.
Show example response fields and types
{
"status": "number",
"success": "boolean",
"data": [
{
"id": "string",
"name": "string",
"type": "number",
"property": {}
}
],
"message": "string"
}