Complete API Testing Guide

Postman / cURL

You may use any HTTP client program to talk to the av-api. However if you don’t have one already that you like, we recommend using Postman

To change the state of the demo room using the AV API, you will send a PUT request to the following URL:

http://[pi-ip-addr]:8000/buildings/DEMO/rooms/123

You will need to set the Content-Type HTTP header to application/json, and add one of the following json snippits in the body of the request.

To turn on the display and set the input to HDMI1 send the following JSON body:

{
    "displays": [
        {
            "name": "D1",
            "power": "on",
            "blanked": false,
            "input": "HDMI1"
        }
    ]
}

To turn off the display send the following JSON body:

{
    "displays": [
        {
            "name": "D1",
            "power": "standby"
        }
    ]
}

To set the volume on the display to 50 send the following JSON body:

{
    "audioDevices": [
    {
      "name": "D1",
      "power": "on",
      "muted": false,
      "volume": 50
    }
  ]
}

You can send multiple commands at once, to turn the display on, set the input to HDMI2, and set the volume of the display to 20 send the following JSON body.

{
    "displays": [
        {
            "name": "D1",
            "power": "on",
            "blanked": false,
            "input": "HDMI2"
        }
    ],
    "audioDevices": [
        {
        "name": "D1",
        "power": "on",
        "muted": false,
        "volume": 20
        }
    ]
}

For additional information on each of these commands, please refer to the API Body & Response documentation.