My pleasure, Larry.
I use the following skeleton (Linux bash) script to retrieve info from Zero's cloud instance.
Maybe it's of use to others too.
*
Base :
$ BASEURL="https://mongol.brono.com/mongol/api.php"
$ FMT="json" # json,csv,xml,http
$ ZUSR="yourzeroaccount@maildomain"
$ ZPW="yourzeropassword"
$ ZUNIT="yourzerounitnumber" # retrieved from [1]
[1] Manually retrieve your unit number, in order to assign to the above variable ZUNIT :
$ ZCMD="get_units"
$ curl -s --http2 -G ${BASEURL}?commandname=${ZCMD} -d format=json -d user=${ZUSR} -d pass=${ZPW} | jq .
$ BASECMD="curl -s --http2 -G -d format=${FMT} -d user=${ZUSR} -d pass=${ZPW} -d unitnumber=${ZUNIT} ${BASEURL}?commandname="
*
Examples :
# retrieve latest data transmission
$ ZCMD="get_last_transmit" ${BASECMD}${ZCMD} | jq .
# retrieve user info
$ ZCMD="get_userinfo" ${BASECMD}${ZCMD} | jq .
*
Application :
(retrieve a month's worth of data, clean up, dump to separate CSV-formatted file zerocloud_yyyymm.csv, and append to (existing) CSV zerocloud.csv)-> Variable
DTBASE needs to be changed to the required month (format = 'yyyymm')
$ DESTDIR="/home/blabla_username_whatever_makes_your_cookie_crumble/Zero/SRF/data"
$ ZCMD="get_history" ; FMT=csv ; DESTFILEPREFIX="${DESTDIR}/zerocloud"
$ PARTURL="${BASEURL}?commandname=${ZCMD}&format=${FMT}&user=${ZUSR}&pass=${ZPW}&unitnumber=$ZUNIT&start=${DTSTART}&end=${DTEND}"
$ DTBASE="201911"
$ DESTFILE="${DESTFILEPREFIX}_${DTBASE}.${FMT}" ; rm "${DESTFILE}.tmp" ; for dts in `seq 1 31` ; do dtstart=$(printf "${DTBASE}%02d" "$dts") ; dtend=$(date +%Y%m%d -d "$dtstart + 1 days") ; curl "${PARTURL}&start=${dtstart}&end=${dtend}" >> "${DESTFILE}.tmp" ; done
$ head -n 1 "${DESTFILE}.tmp" > "${DESTFILE}" ; egrep -v "^mileage|^610 Bad end date" "${DESTFILE}.tmp" >> "${DESTFILE}"
$ egrep -v "^mileage" "${DESTFILE}" >> "${DESTFILEPREFIX}.${FMT}"