Browse developer docs
List authorized devices
GETdevice-sn-list
Request
Send GET to /open/service with serviceName=device-sn-list and the common signing parameters.
Send extra fields in the URL query
Optional pageIndex starts at 1 and pageSize defaults to 10. Read data.records[].sn and, for AutoPilot, extInfo.deviceId.
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=device-sn-list' \
--url-query 'pageIndex=1' \
--url-query 'pageSize=20' \
--url-query "appUid=$XAG_APP_UID" \
--url-query "timestamp=$timestamp" \
--url-query "token=$token"| Parameter | Requirement | Meaning |
|---|---|---|
pageIndex | Optional | Page number, starting at 1. |
pageSize | Optional | Number of records per page. |
Response
The paginated records identify each authorized device by sn and definitionName. AutoPilot entries can also supply extInfo.deviceId.
Show example response fields and types
{
"status": "number",
"message": "null",
"data": {
"total": "number",
"pageIndex": "number",
"pageSize": "number",
"records": [
{
"sn": "string",
"sourceUserName": "string",
"definitionName": "string",
"extInfo": {
"deviceId": "string"
}
}
]
}
}