Beginner to APIs
Hi, I am a beginner to the API world and I am using Postman to test API connections.
The documentation is rather overwhelming and I can't seem to find what is the right URL to use.

My aim is to setup and change schedules.
I have enabled API Key under Private Token tab on my FoxCloud account.

I am using the following
URL: https://www.foxesscloud.com/op/v0/device/list
Auth = NoAuth

Code: Select all

Path: "/op/v0/device/list"
Timestamp: 1768282128342
Raw string: "/op/v0/device/list\r\n0acae5c0-3572-436d-a5e3-58db6fa34\r\n1768282128342"
Signature (MD5): b729b1504a756da48406dc1c9fa2bb22
But I am getting below response:

Code: Select all

{
    "errno": 40256,
    "msg": "Please close and reopen this page illegal signature"
}
I tried to research for this issue, but I am not getting anywhere.
Any help would really be appreciated. Thank you.
Re: Beginner to APIs
A common problem is how \r\n is interpreted. The string is a literal and needs to include the characters and not CR LF.
You may need your URL to contain \\r\\n.

Signature calcuation has to be dynamic, based on the current time. You cannot use an out of date time stamp as this will be rejected.

If you are just getting going, you may find is easier to experiment in Jupyter Lab using working python code. There are examples of how to set this up here: https://github.com/TonyM1958/FoxESS-Clo ... r-Notebook
H1-6.0-E hybrid inverter
6 x HV2600 v2 batteries
16 x JA Solar 405w panels
7 x Tigo TS4-A-O optimisers
Re: Beginner to APIs
Thank you so much for your help tony.matthews1.
Escaping the slashes just worked :)
Post Reply