Thanks for the response.
I think I clouded the issue by referencing the whole Zoom thing.
Completely ignoring Zoom, here’s what I’m attempting, using the SDK for Node JS.
How do I re-authenticate my webhook endpoint in the ABSENCE of lifecycle events. That is, when my webhook starts running on my server, how do I authenticate it.
I’m trying to run a Smartthings webhook endpoint on my own server. This app must make requests to the Smartthings API that are NOT a result of a lifecycle event. This app may be restarted for any number of reasons (server maintenance, etc.). Except for installation, the app is unlikely to receive many lifecycle events from either the user (e.g. ‘update’) or from event subscriptions, etc.
Generalized flow control:
- Initialize smartapp
- get status of switch chosen in the UI
- subscribe to that switch
- if switch is ‘ON’ get status of other switches chosen in UI
Here’s what I’ve accomplished:
I’ve written the endpoint and it functions fine. It is, for now, using a local FileContextStore.
Here’s where I’m stuck:
If the application is “idle” for a long enough period and then gets restarted, any Smartthings API call returns a ‘401 not authorized’ error. This can be corrected by having the user generate an ‘update’ lifecycle event. Seemingly the authorization tokens in the FileContextStore are expiring and the ‘update’ lifecycle event refreshes them. The application must make API calls that ARE NOT in response to a lifecycle event each time it starts up.
I cannot however find a way to “re-authenticate” the endpoint without the use of a lifecycle event.
I’ve tried multiple things, like getting the context from the FileContextStore, etc., but continue to get ‘401’ until I generate a lifecycle event from the UI.