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


  • 0

[SOLVED]REST API syntax for POST and PUT


Paolino65
 Share

Question

Hi to all,

 

Sorry if I started a new discussion but I don't find information about my doubt.:(

 

My main need is to send some information from an external server to HC2 ... to a scena ... or a virtual device...

 

I try to call HC2 through API from another server using REST API but i cannot find the correct syntax to ... for examples "press a button " in a virtual devices...

 

There is someone that can help me?

 

 

Thanks a lot in advance 

Paolino 

 

 

 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0
  • Inquirer
  • Thanks a lot for upper answer, 

    but i don't understand how I can build the "body" when I use the PUT o POST options...where I can find the syntax ?

     

    for example, if I want to push a button in a virtual device ... I need to invoke:

     

    ... 

    Please login or register to see this link.

     and fill the body with the name of the button... 

     

    my problem is to found the syntax for the body...

     

    in the official documentation I don't find this information... :(

     

    thanks 

    Paolino

    Link to comment
    Share on other sites

    • 0
    5 minutes ago, Paolino65 said:

    but i don't understand how I can build the "body" when I use the PUT o POST options...where I can find the syntax ?

     

    Please login or register to see this code.

    python example

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Thanks a lot!

     

    i need to find the content of the body in order to press the button (id=1) of the virtual device 483..

     

    http://192.168.1.203:80/api/devices/483/action/pressButton

     

    in the body I should be declare the button id... but I don't know the correct Json ...

     

    thank a lot in advance

    Paolino

    Link to comment
    Share on other sites

    • 0

    I am sorry, but press button call not use POSt or PUT http methods

     

    http://<HC2 ip address>/api/callAction?deviceID=15&name=pressButton&arg1=2 

     

    Link to comment
    Share on other sites

    Join the conversation

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

    Guest
    Answer this question...

    ×   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.

     Share

    ×
    ×
    • Create New...