Flair API suddenly severely limited?

Comments

7 comments

  • Avatar
    Jaymz Julian

    Also: is this rate limit _just on ouath_, or on the API generally?  I didn't find any documentation for the limits.... if it's on oauth, we can refactor to cache tokens and such, and not constantly re-authenticate -I'm using your supplied python library, which doens't do that, but I can obviously modify it to do that.  But need guidence!

    1
    Comment actions Permalink
  • Avatar
    Robert Garito

    +1.  Without the Flair API, the vents are rendered completely useless in my setup. I have used Flair for several years and if the API is now crippled, the vents just became eWaste.  If this is a permanent change, you just rendered the vents unusable for a large portion of your customers.

    0
    Comment actions Permalink
  • Avatar
    Jaymz Julian

    FYI one of the flair engineers pushed a commit to the putting library to use oauth2, which doesn't have this limitation. That fixed it for me.

    1
    Comment actions Permalink
  • Avatar
    Robert Garito

    I was already thinking maybe the issue was related to them deprecating oauth 1.0....  But....

    Where is this library?  I'm looking on flair-systems and I don't see any commits since 2022 and the python library there is not using oauth2.  I tried using oauth2 via just curl for testing (from the flair.co/api page) and it fails:

    When I try doing the "Resource Owner Credentials"  POST method using my client ID/secret/username/password, I get {"error": "unsupported_grant_type"}
      (complaining about 'grant_type="password"' ).  I tried both with and without the quotes around the grant_type (my home automation code was using the oauth1.0 version of this API successfully for 2-3 years up until about a day ago, when it started throwing the rate limiting errors)

    When I try using the "OAuth2 Token Endpoint" POST method using my client ID/secret, I get {"error": "invalid_client"}

    I seem to recall from years ago when I first wrote the code that the "Token Endpoint" was for dealers only, so the 2nd error might make sense.  But Resource Owner Credentials should work.

     

    0
    Comment actions Permalink
  • Avatar
    Jaymz Julian

    Oh!  I had that problem too - if you look at the readme in that PR, you'll see that you need a new client id and secret, but that you can generate them from in the flair app (or on my.flair.co as well).  You go into account seetings, then scroll down to developer options, and there's an option down there to generate the oauth2 creds you need

    1
    Comment actions Permalink
  • Avatar
    Robert Garito

    Ahhh...  THAT worked!  I got a Bearer token this time.  Thanks!

    first, I didn't realize he didn't merge the commit, so I wasn't looking at the commits themselves :)

    And yes, after I created a new client ID/secret in the app, the "Token Endpoint" call now works.  (for other readers, do NOT put the values in double quotes--this is a bit confusing in the API documentation, as one example has double quotes and one does not)

    It still appears that my old method of using the "Resource Owner Credentials" method doesn't work anymore--maybe they deprecated it and they need to update the docs?  (it still says invalid grant type) but I'm perfectly fine with switching the API in my code.

    0
    Comment actions Permalink

Please sign in to leave a comment.