A service account is a special kind of account used by an application instead of by a person. Applications use service accounts to make authorized API calls.
The only use case of a service account is to generate access tokens that can be later used by the Sethealth SDK in order to perform authorized requests, such as uploading data to the server.
On the dashboard, a service account is shown like the one above. As you can see, every service account starts with the prefix "sa" followed by a numeric id and in the end, the team it belongs to. To use a service account you must use the entire id (prefix and suffix included).
In order to create a service account, go to the dashboard and click the button that says "Create Service Account".
Once the modal appears, the only field needed is the service account's name, likely the application
name which is going to use it. Then fill the field in the modal shown below and press
Create button to confirm.
Then you will have created the service account. Nowadays sethealth has support for python and golang clients.
Once you have created the service account, the following modal will be shown:
In the modal,
SETHEALTH_KEY are enviroment variables you should be accesible from your server-side application.
Once the service account credentials are property configured in your server, you can install one of your server clients and generate access token on demand.
Once the modal is closed, the
SETHEALTH_SECRET will not be accesible again for security reasons.
Never hard-code the service account credentials (API key/secret) in a client-side application. This credentials are long-lived and should be kept secret in your backend.
test access token, generates a short-lived access token. It is analogous to calling the method
getToken() in the API.
This might be helpful when you need to test your application without a backend.
Remember that access tokens must also be kept secret and they are short-lived, you should never hard code an access token into your application, since they expire very offen. Instead, your backend should use the Golang/Python clients to generate them on-demand.
As mentioned in the sharing data guide, the access token is required by the SDK to upload data to the cloud.