Getting Started with Sahha
This page will help you get started with Sahha. You'll be up and running in a jiffy!
Step 1) Register Your Account
Tap "Get Started with Sahha" to quickly sign up for an account that your organization can use to access Sahha services.
Step 2) Access Your API Keys
You will need to access your API Keys in order to start connecting to the Sahha API.
You can find your Client ID and Client Secret inside the Dashboard by going to
Developer Tools > API Access
.
Step 3) Authenticate Your Account
You will need to authenticate your account to access the Sahha API.
Use your Client ID and Client Secret from the Dashboard to authenticate your account via the API.
// POST "/oauth/account/token"
{
"clientId": "MY_CLIENT_ID",
"clientSecret": "MY_CLIENT_SECRET"
}
You will receive an accountToken
that allows you to create new user profiles.
// 200 OK
{
"accountToken": "MY_ACCOUNT_TOKEN",
"expiresIn": "86400",
"tokenType": "Account"
}
Step 4) Create a User Profile
User profiles represent the users of your app or service. They are unique individuals that you would like to use the Sahha service for.
Use your accountToken
to create new user profiles.
// POST "/profile"
// AUTHORIZATION HEADER "Account MY_ACCOUNT_TOKEN"
// 200 OK
{
"profileId": "MY_PROFILE_ID"
}
Step 5) Authenticate a User Profile
You will need to authenticate your users in order to upload data and download an analysis for each individual.
Use your accountToken
and profileId
to authenticate a user profile via the API.
// POST "/oauth/profile/token"
// AUTHORIZATION HEADER "Account MY_ACCOUNT_TOKEN"
{
"profileId": "MY_PROFILE_ID"
}
You will receive a profileToken
that allows that specific user profile to connect to the Sahha API.
// 200 OK
{
"profileToken": "MY_PROFILE_TOKEN",
"expiresIn": "86400",
"tokenType": "Profile",
"refreshToken": "MY_REFRESH_TOKEN"
}
Authenticate a User Profile with the SDK
If you also install the Sahha SDK in your app, you will need to pass the
profileToken
to theauthenticate
method.
Step 6) Build with Sahha
It's time to start building with Sahha!
You can either:
A) Use the API
B) Use the SDK
Disclaimer
We recommend sending behavioral data using one of the available SDK's instead of directly via the API. Behavioral data that is uploaded via the API may differ in the structure and frequency typical of the device sensors. This could lead to reduced accuracy in your data analysis results.
Step 7) Try the Sahha Demo App
To see what you can build with Sahha, we recommend trying one of our demo apps.
Step 8) Join Sahha on Slack
Sahha hosts an open Slack community for developers. Please join us on Slack to get help from the Sahha team and fellow developers to better integrate Sahha into your project.
Updated 2 months ago