Skip to content

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

Returns

1
2
3
4
5
mutation createSmartDeviceToken($input: CreateSmartDeviceTokenInput!) {
    createSmartDeviceToken(input: $input) {
        state
    }
}
1
2
3
4
5
6
7
8
# Input variables
{
    "input": {
        "accountNumber": "",
        "deviceType": "",
        "deviceVendor": "",
    }
}

Example

1
2
3
4
5
mutation createSmartDeviceToken($input: CreateSmartDeviceTokenInput!) {
    createSmartDeviceToken(input: $input) {
        state
    }
}
1
2
3
4
5
6
7
8
# Input variables
{
    "input": {
        "accountNumber": "A-1234567",
        "deviceType": "THERMOSTATS",
        "deviceVendor": "ECOBEE",
    }
}
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())
1
2
3
4
5
 "data": {
        "createSmartDeviceToken"{
            "state": "9fe2c4e93f654fdbb24c02b55139716c"
        }
    }
Back to top