Skip to main content
POST
/
v1
/
devices
/
hvac
/
{id}
/
user_preferences
/
get
get user preference
curl --request POST \
  --url https://api.example.com/v1/devices/hvac/{id}/user_preferences/get \
  --header 'x-ws-api-key: <api-key>'
import requests

url = "https://api.example.com/v1/devices/hvac/{id}/user_preferences/get"

headers = {"x-ws-api-key": "<api-key>"}

response = requests.post(url, headers=headers)

print(response.text)
const options = {method: 'POST', headers: {'x-ws-api-key': '<api-key>'}};

fetch('https://api.example.com/v1/devices/hvac/{id}/user_preferences/get', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/devices/hvac/{id}/user_preferences/get",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-ws-api-key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.example.com/v1/devices/hvac/{id}/user_preferences/get"

req, _ := http.NewRequest("POST", url, nil)

req.Header.Add("x-ws-api-key", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.example.com/v1/devices/hvac/{id}/user_preferences/get")
.header("x-ws-api-key", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v1/devices/hvac/{id}/user_preferences/get")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-ws-api-key"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "name": "Weekday comfort",
  "tempUnits": "F",
  "defaultMode": "AUTO",
  "defaultMaxTemp": 75,
  "defaultMinTemp": 65,
  "defaultCoolSetpoint": 74,
  "defaultHeatSetpoint": 68,
  "scheduleBlocks": [
    {
      "startTimeMinutes": 0,
      "endTimeMinutes": 480,
      "mode": "HEAT",
      "targetCoolSetpoint": null,
      "targetHeatSetpoint": 68,
      "maxTemp": 75,
      "minTemp": 65,
      "daysOfWeek": [
        1,
        2,
        3,
        4,
        5
      ],
      "scheduleType": "RECURRING"
    },
    {
      "startTimeMinutes": 480,
      "endTimeMinutes": 1440,
      "mode": "AUTO",
      "targetCoolSetpoint": 74,
      "targetHeatSetpoint": 68,
      "maxTemp": 75,
      "minTemp": 65,
      "daysOfWeek": [
        1,
        2,
        3,
        4,
        5
      ],
      "scheduleType": "RECURRING"
    }
  ]
}

Authorizations

x-ws-api-key
string
header
required

WattShift API key

Headers

x-ws-api-key
string

WattShift API Key

Path Parameters

id
string
required

Response

200 - application/json
name
string
required

The human-readable name for the schedule

Minimum string length: 1
scheduleBlocks
object[]
required

0 or more blocks for this schedule to follow. If no blocks are added, the default temp will be followed

enabled
boolean
required

Whether this schedule should be enabled

tempUnits
enum<string>
required

The units for temperature.

Available options:
F,
C
weekNumbers
integer[]

The week numbers to apply this schedule. For example, [0,1,2,...,51] applies to all 52 weeks of the year. Leave empty to also apply to all weeks.

Required range: 0 < x < 52
defaultMode
enum<string>
default:AUTO

The default mode for the HVAC unit.

Available options:
OFF,
HEAT,
COOL,
AUTO
defaultTemp
number
Required range: -50 < x < 200
currentTemp
number

The current temperature

Required range: -50 < x < 200
targetTemp
number

The target temperature

Required range: -50 < x < 200
targetCoolSetpoint
number

The target cool setpoint

Required range: -50 < x < 200
targetHeatSetpoint
number

The target heat setpoint

Required range: -50 < x < 200
maxTemp
number

The max default temperature

Required range: -50 < x < 200
minTemp
number

The min default temperature

Required range: -50 < x < 200