SmartThings API Browser+ ... Now Available to All

Anything you can get using a PAT could also be added to the API Browser+ if Todd feels it is appropriate.

PATs can only be created with a limited range of security scopes and that doesn’t get you everything. Unless they have added more scopes lately it won’t get you https://api.smartthings.com/hubDevices/{{deviceId}}/characteristics which is where you’ll find the bits of /installed-hubs that aren’t in /devices.

The SmartApps I was talking about are community created Webhook SmartApps. You are only offered a limited range of scopes when creating them in the Developer Workspaces but you can add in some extra ones via the API. You are limited to accessing the Location the app is installed in, whereas a PAT allows you broader access at the User level.

I haven’t messed about extracting the token from a Webhook SmartApp lately, but there is some low hanging fruit in the form of the CLI. Run a CLI command and then look in %LOCALAPPDATA%\@smartthings\cli\credentials.json (in Windows) and you can grab an accessToken valid for the next 24 hours that you can try using instead of a PAT. It certainly turns a request for the hub characteristics from a 403 to

{
    "driverMemoryLimitStatus": "Ok",
    "zwaveAvailability": "Available",
    "zigbeeAvailability": "Available",
    "failoverAvailability": "Unsupported",
    "matterAvailability": "Available",
    "backupEncryptionPublicKey": {
        "kty": "EC",
        "crv": "P-521",
        "use": "enc",
        "kid": "XXXX",
        "n": "XXXXXX",
        "generationDate": 1695404222
    },
    "remoteFactoryResetAvailability": "Available",
    "matterSoftwareComponentVersion": "1.3-0",
    "threadRequiresExternalHardware": false,
    "matterRendezvousHedgeSupported": true,
    "edgeDriversAvailability": "Available",
    "lanAvailability": "Available",
    "hubLocalApiAvailability": "Available",
    "hubReplaceAvailability": "Available",
    "zigbeeDeviceDiagnosticsAvailability": "Available",
    "batchedInventoriesAvailability": "Available",
    "localVirtualDeviceAvailability": "Available",
    "hedgeTlsCertificate": "-----BEGIN CERTIFICATE-----\nXXXX\n-----END CERTIFICATE-----\n",
    "primarySupportAvailability": "Unsupported",
    "secondarySupportAvailability": "Unsupported",
    "childDeviceAvailability": "Unsupported",
    "matterDeviceDiagnosticsAvailability": "Available",
    "zigbeeRequiresExternalHardware": false,
    "zwaveRequiresExternalHardware": false,
    "inventoriesSupportMatrix": {
        "inventories": [
            {
                "name": "BEHAVIOR",
                "version": 1
            },
            {
                "name": "DEVICE_MQTT",
                "version": 1
            },
            {
                "name": "CAPABILITY",
                "version": 1
            },
            {
                "name": "DEVICE_LAN",
                "version": 1
            },
            {
                "name": "DRIVER",
                "version": 1
            },
            {
                "name": "DEVICE_MATTER",
                "version": 1
            },
            {
                "name": "PERMISSION_POLICY",
                "version": 1
            },
            {
                "name": "DEVICE_HUB",
                "version": 1
            },
            {
                "name": "PROFILE",
                "version": 1
            },
            {
                "name": "DEVICE",
                "version": 1
            },
            {
                "name": "PERMISSION_PRINCIPAL",
                "version": 1
            },
            {
                "name": "DEVICE_ZWAVE",
                "version": 1
            },
            {
                "name": "HUB_GROUP",
                "version": 1
            },
            {
                "name": "DEVICE_ZIGBEE",
                "version": 1
            },
            {
                "name": "HUB_CONFIG",
                "version": 1
            }
        ]
    },
    "zigbeeManualFirmwareUpdateSupported": true,
    "driverCountLimitStatus": "Ok"
}
1 Like