api cloud, sometimes works and sometimes 401 unauthorized?? why?

  • Hi,

    i have a Shelly1 connected to the cloud. I use api-cloud like /device/status for reading temperature and the status of relay. It's all ok. Works all time.

    I work in javascript, jquery on a website.

    Now i call the api /device/relay/control/ with data "turn=on" and with another command "turn=off".

    Sometime it respond "401 - unauthorized". And sometimes works fine. The same POST call.... the same identicaly post-call, one time works, and 3 times not works.... error 401 (distance between calls 6 or 7 seconds)

    Why? Is a temporary problem of the cloud? I have to sold this to a client of mine....

    Any suggest?

  • Experiencing something similar: When only requesting endpoints status/ or relay/control/, all is good. When requesting endpoint status/ and (directly afterwards) relay/control/, the second request gets answered with 401.

    This is due to the Api being limited to 1 request per second (a bit longer in my tests, currently I go with 1.7 seconds).

    Hopefully the limit is raised soon, as this timespan makes up more or less 90% of the latency in my automation...

    Einmal editiert, zuletzt von sefzig (22. Januar 2022 um 16:29) aus folgendem Grund: Linked docs, added hope.