Devices API

The Devices API is used to obtain information for devices within the Crestron Home® OS system.

GET devices

This method gets a list of all available devices within the system.

Syntax

  • HTTPS Method: GET
  • Base URI: /cws/api/devices

Parameters

None

Request Header

Copy
{
    Name: "Crestron-RestAPI-AuthKey",
    Value: "[Authentication Key]"
}

Sample Response

Response Type: Application/JSON

Copy
"devices": [
    {
      "id": 3,
      "name": "Light1",
      "type": "light",
      "subType": "Dimmer",
      "roomId": 1
    },
    {
      "id": 5,
      "name": "Light2",
      "type": "light",
      "subType": "Switch",
      "roomId": 5
    },
    {
      "id": 8,
      "name": "Light 3",
      "type": "light",
      "subType": "Switch",
      "roomId": 4
    },
    {
      "id": 1,
      "name": "Light 4",
      "type": "light",
      "subType": "Dimmer",
      "roomId": 2
    },
    {
      "id": 10,
      "name": "Shade",
      "type": "shade",
      "subType": "Shade",
      "roomId": 1
    },
    {
      "id": 13,
      "name": "TSTAT",
      "type": "thermostat",
      "roomId": 5
    },
    {
      "id": 15,
      "name": "CTSTAT",
      "type": "thermostat",
      "roomId": 1
    },
    {
      "id": 12,
      "name": "Lock",
      "type": "lock",
      "roomId": 1
    },
    {
      "id": 7,
      "name": "GLS-OIR-sensor",
      "type": "sensor",
      "subType": "OccupancySensor",
      "roomId": 2
    },
    {
      "id": 11,
      "name": "Photosensor",
      "type": "sensor",
      "subType": "PhotoSensor",
      "roomId": 5
    },
    {
      "id": 14,
      "name": "Honeywell",
      "type": "security Device",
      "roomId": 1
    },
    {
      "id": 2,
      "name": "Gym",
      "type": "media Zone",
      "subType": "Audio",
      "roomId": 2
    },
    {
      "id": 1,
      "name": "Atrium",
      "type": "media Zone",
      "subType": "Audio",
      "roomId": 1
    },
    {
      "id": 5,
      "name": "Bedroom",
      "type": "media Zone",
      "subType": "Audio",
      "roomId": 5
    },
    {
      "id": 4,
      "name": "Garage",
      "type": "media Zone",
      "subType": "Audio",
      "roomId": 4
    }
  ],
  "version": "[API Version]"
}

GET devices/{id}

This method gets information for a specific device within the system.

Syntax

  • HTTPS Method: GET
  • Base URI: /cws/api/devices/{id}

Parameters

Name Description
{id} The unique identifier for the device in the system.

Request Header

Copy
{
    Name: "Crestron-RestAPI-AuthKey",
    Value: "[Authentication Key]"
}

Sample Responses

Response Type: Application/JSON

Copy
{
  "devices": [
    {
      "id": 1,
      "name": "Light1",
      "type": "Light",
      "subType": "Switch",
      "roomid": 2
    }
  ],
  "version": "[API Version]"
}