Using API to get WAN ipv4 address
Hi,
I am trying to use the API to get the external IP address of my router. Thus far I was able to log into the controller and get the full wan configuration with the script bellow:
CONTROLLER_ID="$(curl -sk "${OMADA_URL}/api/info" | jq -r .result.omadacId)"
TOKEN="$(curl -sk -X POST -c "${TOKEN_FILE}" -b "${TOKEN_FILE}" -H "Content-Type: application/json" "${OMADA_URL}/${CONTROLLER_ID}/api/v2/login" -d '{"username": "'"${USERNAME}"'", "password": "'"${PASSWORD}"'"}' | jq -r .result.token)"
SITE_ID="$(curl -sk -X GET -b "${TOKEN_FILE}" -H "Content-Type: application/json" -H "Csrf-Token: ${TOKEN}" "${OMADA_URL}/${CONTROLLER_ID}/api/v2/sites/${SITE}" | jq -r .result.id)"
echo $OMADA_URL
echo $CONTROLLER_ID
echo "SITE_ID= " $SITE_ID
echo $TOKEN
curl -sk -X GET -b "${TOKEN_FILE}" -H "Content-Type: application/json" -H "Csrf-Token: ${TOKEN}" "${OMADA_URL}/${CONTROLLER_ID}/api/v2/loginStatus?token=${TOKEN}" | jq .
curl -sk -X GET -b "${TOKEN_FILE}" -H "Content-Type: application/json" -H "Csrf-Token: ${TOKEN}" "${OMADA_URL}/${CONTROLLER_ID}/api/v2/sites/${SITE_ID}/setting/wan/networks?token=${TOKEN}" | jq .
But I wasn`t able to get the external IP. I tried to look into this post (v5.9.9 API) but I wasn`t able to find any API call that would give that directly.
I tried the following calls and couldn`t get the IP:
/{omadacId}/api/v2/sites/{siteId}/dashboard/portstatedetails
/{omadacId}/api/v2/sites/{siteId}/setting/wan/networks
/{omadacId}/api/v2/sites/{siteId}/setting/wanlanstatus
Is there an API call for that?