I use this script on linux.Isn't authentication missing from this script?
RESPONSE=`curl -s -X GET http://192.168.8.1/api/webserver/SesTokInfo`
COOKIE=`echo "$RESPONSE"| grep SessionID=| cut -b 10-147`
TOKEN=`echo "$RESPONSE"| grep TokInfo| cut -b 10-41`
curl -s http://192.168.8.1/api/device/signal -H "Cookie: $COOKIE" -H "__RequestVerificationToken: $TOKEN" -o /tmp/Signal.txt
It returns various signal strengths and also the PCI of the cell you are connected to. Then lookup this cell on cellmapper.
The script could be ported to windows, but I am away for the weekend.
I should clarify
I can see you call the SesTokInfo
API and its return is set as the value for the variable RESPONSE
which is then parsed using grep to get Session Id and Token Info and they are placed into 2 seperate variables called COOKIE
which are both used as parameters when calling the Signal
API but at no point have you passed in a User and Password which is done via the Login