Quick Start

Step-by-Step Integration Process

Obtain API Credentials

Sign in to the Spike Developer Console at console.spikeapi.com Under Applications, view your App ID and App Token. (Keep your App Token confidential)

Once you have these credentials, you can start using SpikeAPI.

Integration Initialization

Below part is relevant for the direct integrations with the providers excluding Apple Health and Health Connect.

For Apple Health and Health Connect part please go straight to the Mobile SDK integration

For a user to establish connections with data providers, authenticate the user using a simple function which generates a URL to the data provider page:

Swift


Required function parameters:

provider (string) name of the data provider. Complete list at Supported providers

Integration Flow

Document image


Users will be redirected to a data provider website and users will be asked to submit authentication details. Once the user authorizes access to their data, Spike returns the user back to the application using the postback URL. (You can edit it on the Spike Developer Console). Appended to the postback URL is the Spike user ID. Following is an example of the postback URL with the user ID highlighted:

https://my_test_app.com/callback?provider=fitbit&customer_user_id=00001c&user_id=fa1e3803-6068-4ea7-9788-eccce210d30c

Please save it and use it for all user specifc data requests.

The user_idin the initialization API request is synonymous with customer_user_idin the postback URL. They refer to the same identifier.

Mobile SDK Integration Initialization

In order to be able to retrieve data from Apple Health and Health Connect you will need to establish a connection and request relevant permissions from the user.

To set up the Spike SDK create SpikeConnectionV3 instance with your Spike application id, auth token and user id unique to each of your users:

JS


Once the connection is established you should ask user to grant you access to the relevant health data.

JS

  • for Android there are more methods that let you get permissions granted by user, check if Health Connect is installed or should be updated, etc. If you are OK with SpikeSDK handling these, you can use requestHealthPermissions only. On iOS requestHealthPermissions is the only method that has to be called. Keep in mind, that you should do it before trying to read data from Android Health Connect or Apple HealthKit.

Data retrieval

Once you have created a SDK connection or user authorized themselves directly through the provider page you are able to retrieve their data. In order to do that you will need to utilise our SDK. Please refer to the more detailed guide in our dedicated SDK guides:

Data Retention Policy

With our newest API version we are changing the approach how we are dealing with the user data. In order for our clients to retrieve their user data more easily we will be storing user data on our end. Through the Spike console you are able to change for how long you would like to for us to store your user data.

The option to not store the data remains available.

Please also note that Data Retention Policy directly correlates with the historical data. For example if you will set up your Data Retention Policy for 10 days, you will be able to retrieve user data for the past 10 days.