Create Smart Device Token¶
Creates or gets a SmartDeviceToken object matching the input and responds to the request with its token state as a hexadecimal string.
Authentication Required
Requires account user level access.
-
Arguments
input
: CreateSmartDeviceTokenInput
-
Returns
Example¶
import pprint
import requests
# API_URL = "https://api.oeus-kraken.energy/v1/graphql/" # prod
API_URL = "https://api.oeus-kraken.systems/v1/graphql/" # test
JWT_TOKEN = "PLACE_JWT_TOKEN_HERE"
HEADERS = {
"Authorization": f"JWT {JWT_TOKEN}"
}
MUTATION = “”"
mutation createSmartDeviceToken($input: CreateSmartDeviceTokenInput!) {
createSmartDeviceToken(input: $input) {
state
}
}
“”"
VARIABLES = {
"input": {
"accountNumber": "A-1234567",
"deviceType": "THERMOSTATS",
"deviceVendor": "ECOBEE",
}
}
session = requests.Session()
session.headers.update(HEADERS)
response = session.post(
url=API_URL,
json={“query”: MUTATION, “variables”: VARIABLES}
)
pprint.pprint(response.json())