Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


Recommended Posts

Posted

Is there documentation for the REST Api for this release of HC3? Some things work as per the HC2 documentation but much does not. Manuals.fibaro.com is not much help unless I missed something?

 

 

Posted

Please login or register to see this image.

/monthly_2021_08/image.png.895ea1db7b27266ba353aba867c6a599.png" />

  • Topic Author
  • Posted

    Yes, i feared this was the answer :-) so … doing a get of api/settings/info works …. But /devices returns a 200 code but an empty json object.

    hmmm

    Posted
    6 minutes ago, Relaxandbecool said:

    Yes, i feared this was the answer :-) so … doing a get of api/settings/info works …. But /devices returns a 200 code but an empty json object.

    hmmm

    Well we are a lot of people that use these apis daily and they work very well. It’s most likely that you don’t do the request correctly. You copy the curl example in the swagger api? Ex. you add the x-fibaro-version header? 

  • Topic Author
  • Posted

    Ah surely I am not doing this right, or my JSON decoder is not working. I am using pythonista to make the calls ….

     

    so 

    import requests
    api_url="http://192.168.8.10/api/settings/info"
    response=requests.get(api_url)
    print(response)
    print(response.json())
     

    Works as expected but not

     

    import requests
    api_url="http://192.168.8.10/devices"
    response=requests.get(api_url)
    print(response)
    print(response.json())

     

    Posted

    Note:

     

    .../api/settings/info -> works

    .../devices -> not good

     

    See the inconsistency?

    Try:

    .../api/devices

  • Topic Author
  • Posted

    Well indeed. I had tried that previously, but also did not work. However, I now see that the /api/devices needs some authentication, 401 code….. strange that in fact any random string produces a 200 response code and only a 501 if preceded by /api. That smells like a bug ….

  • Topic Author
  • Posted

    Indeed adding HTTPBasicAuth to /api/devices does indeed now work. Many thanks!

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Reply to this topic...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...