Page 1 of 1
Response: {"errno":40256,"msg":"Please close and reopen this page illegal signature"}
Posted: Wed Mar 18, 2026 10:40 am
by granta
Hi All having the message returned every time. I have looked a the responses on this forum and tried AI but no luck so far, any help appreciated
using ...
Source: /op/v1/device/real/query\\r\\n[MY TOKEN]\\r\\n1773829889976
Signature: 3fceb3662b6c15230c630a4558b91a2b
Full URL: +
https://www.foxesscloud.com/op/v1/device/real/query
My Time:18 Mar 2026, 10:31:33
Status: HTTP Status: 200
Response: {"errno":40256,"msg":"Please close and reopen this page illegal signature"}
Server Time: Wed, 18 Mar 2026 10:31:33 GMT
headers being sent
socket.RequestHeader("token") = apiKey
socket.RequestHeader("lang") = "en"
socket.RequestHeader("timestamp") = timestamp
socket.RequestHeader("signature") = signature
socket.RequestHeader("user-agent") = "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"
jsonString = {"sns":["60JC372045BM276"]}
RequestContent(jsonString, "application/json")
Re: Response: {"errno":40256,"msg":"Please close and reopen this page illegal signature"}
Posted: Wed Mar 18, 2026 5:12 pm
by tony.matthews1
Do you know if you are calcuating the signature correctly?
Try adding a timezone and a Content-Type decleration into your header?
Re: Response: {"errno":40256,"msg":"Please close and reopen this page illegal signature"}
Posted: Wed Mar 18, 2026 5:35 pm
by granta
Hi
Thanks for the response, I've added
socket.RequestHeader("TimeZone") = "GMT"
socket.RequestHeader("Content-Type") = "application/json;charset=UTF-8"
socket.RequestHeader("Accept") = "application/json"
with no change to the error message.
what I'm using is
Source: /op/v1/device/real/query\\r\\n3ab34f91-77c5-4283-8688-b37b21276792\\r\\n1773855533625
Signature: be70bb9847936d65ca4c6457a2ababef
(ill change the token after getting is sorted)
Re: Response: {"errno":40256,"msg":"Please close and reopen this page illegal signature"}
Posted: Thu Mar 19, 2026 5:23 pm
by tony.matthews1
Here's my debug data using your API key - this query body and header works and accesses your data:
getting real-time data
body = {"sns": ["60JC372045BM276"]}
path = /op/v1/device/real/query
headers = {'Token': '3ab34f91-77c5-4283-8688-b37b21276792', 'Lang': 'en', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36', 'Timezone': 'Europe/London', 'Timestamp': '1773940778160', 'Content-Type': 'application/json', 'Signature': 'c661733a533c79b92c53a2b64adf2361'}
Copy this data and the headers and use the time stamp and other data to check that you are generating the correct signatue.
Re: Response: {"errno":40256,"msg":"Please close and reopen this page illegal signature"}
Posted: Fri Mar 20, 2026 12:25 pm
by granta
Many thanks that was a great help, after comparing my results compared to yours It was the signature that was wrong as you suspected.
I it turns out using '\\r\\n' not working for me whereas '\r\n' works fine so all is now good.
Thanks for the assist
Re: Response: {"errno":40256,"msg":"Please close and reopen this page illegal signature"}
Posted: Fri Mar 20, 2026 2:22 pm
by tony.matthews1
No problem. Always tricky as it depends on the behaviour of your string parser. Most people don't realise the python example given for open API uses a raw string format that disables parsing.
You might want to generate a new API key as this one was posted here.
Re: Response: {"errno":40256,"msg":"Please close and reopen this page illegal signature"}
Posted: Tue Apr 14, 2026 12:11 pm
by Kiran84
I get this same error in Home assistant when i enter "python3 foxess_control.py get" command in SSH terminal.
Followed instructions in this link:
https://github.com/Robbie1977/foxESS_HA_set_mode
When i modify foxess_control.py line 54 to "return url, payload, get_headers(path)".
The command returns the following:
[
"
https://www.foxesscloud.com/op/v0/device/setting/get",
{
"sn": "60KE702047PCxxx",
"key": "WorkMode"
},
{
"Content-Type": "application/json",
"token": "xnxnxnxx-xxnn-nnxn-nxnx-xnxnxnxxnxnx",
"timestamp": "1776164630917",
"signature": "nnnxxnxnnxxnxxxxnxxnnnnnnnnnxnxn",
"lang": "en"
}
]
Any help much appreciated.
Re: Response: {"errno":40256,"msg":"Please close and reopen this page illegal signature"}
Posted: Thu Apr 16, 2026 2:47 pm
by tony.matthews1