v1.12 REST API - Doco

Discussion in 'C-Bus Automation Controllers' started by Timbo, Nov 16, 2022.

  1. Timbo

    Timbo

    Joined:
    Aug 3, 2004
    Messages:
    22
    Likes Received:
    4
    Location:
    Perth, Australia
    Just wondering is there any doco around for the newly enabled REST API? Couldn't find mention in the manual/readme...

    Cheers,

    Tim
     
    Timbo, Nov 16, 2022
    #1
  2. Timbo

    Dasman

    Joined:
    May 5, 2011
    Messages:
    36
    Likes Received:
    5
    Location:
    Adelaide
    There sure is! I have spent some time playing with it so feel welcome to as questions.

    load up the website https://petstore.swagger.io/#/

    At the top, enter in https://NACSHACIPAddr/api/swagger.json

    If that doesn't load, visit the URL of the swagger.json directly and accept the self signed certificate.

    Once you get the swagger website to load the NAC api, log in using your admin credentials, and from there, have fun
     
    Dasman, Nov 16, 2022
    #2
    lcrowhurst likes this.
  3. Timbo

    lcrowhurst

    Joined:
    Dec 2, 2004
    Messages:
    271
    Likes Received:
    97
    Location:
    Sydney, NSW, Australia
    I have created a small htm test file ( rename TestAPI.txt to TestAPI.html) that displays the groups listed in the mygroups table in the code. The ipaddress of the controller is in mycontroller variable.

    var mycontroller = '192.168.0.11'
    var mygroups = ['70','71', '72', '73', '74'];

    The HTML displays the groups listed in the table along with their Name, on/off buttons and a slider.

    I have set it to every 10 second get the value of the groups from the controller (not sure if there is a better way of doing it)

    On my controller I have SSL setup so have to have that loaded on each device running the HTML not sure if this is true if SSL isn't setup.
     

    Attached Files:

    lcrowhurst, Jan 22, 2024
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.