Integration in development keeps disconnecting


I am developing a cloud integration and have it successfully authenticating and adding test devices to my Smartthings app. The integration works fine, but at least daily it seems I will get a notification (see screenshot) saying:

Disconnected - Home
and related devices have disconnected from SmartThings. Tap here to reconnect.

Any idea why this keeps happening? It looks like a token request happens at around the same time, but I don’t see any indications that the request failed (and I am not sure if I can see SmartThings logs that show what it received in response).

SmartThings sends a request automatically every 24 hours to get the status of the devices, It seems that something happens in that process, in your server logs you must see the request when it happened.

You’re spot on! Turns out I didn’t have the refresh_token grant type supported. Case closed.

[version] => 1.1
[statusCode:protected] => 400
[statusText:protected] => Bad Request
[parameters:protected] => Array
[error] => unsupported_grant_type
[error_description] => Grant type “refresh_token” not supported

[httpHeaders:protected] => Array
        [Cache-Control] => no-store
1 Like