How to capture the user who invoked an automation in a smart app?

I am trying to build something where I need the user id(or some other identifying information) who invoked a particular automation/smartapp. I need to capture this in the smartapp and send it to my server. For example, if A uses his mobile to turn on switch1, I want my server to receive that it was user A. I have been able to send device information, time and all but don’t know how to capture the user information. I am pretty new at this, so any help would be great.

Hey, @Dhrumil_Kavathia

As for now, the SmartThings API doesn’t support an API to collect user-specific data. However, I recommend you consider extending the functonality of your SmartApp by providing its own OAuth Workflow (you could implement AWS Cognito, OAuth0, etc) to keep track of the relation between the user and the installedAppId, which is unique between the installed instances of your SmartApp.

By the way, welcome to the community!!

2 Likes