Providers

Each source and certain destinations (such as Sync Destinations), will require some authentication, which differs per ProviderType.

You can learn which providers are available and their authentication support by Listing Providers.

To set the authentication for a source or destination, please review Provider Authentication.

Listing Providers

This method acquires the data providers that are presently available on FitnessSyncer. It should be noted that this method is highly cacheable, especially if you are using a fixed set of providers.

GEThttps://api.fitnesssyncer.com/api/providers/types/
Response 200List of Providers

Request Parameters

None

Response

The Response will be a JSON body with Provider List.

Provider Authentication

There are various ways to configure authentication for a provider. The provider list would have provided you with a value for authenticating.

NameDescription
UsernamePassword or UsernamePasswordKeyThis indicates that you must provide explicit credentials for this user.
IdentifierThis indicates that you must provide a single string identifying this user to the provider. Depending on the provider, that is a device serial number or an API key the user generates in the provider’s own settings.
AppRequiredThis indicates that one of our or a partner app is required to authenticate. If it is a supported app, an appurl will be also included in the body.
OAuthThis indicates that you must request an OAuth token flow to be initiated for your user to provide FitnessSyncer with the appropriate authentication.
UnsupportedThis should not generally be returned, but should it be returned, you should ignore such providers.

Once you have selected a provider and created a source for it, you need to add authentication for it as follows.

You should build your application such that if there are new values, your application degrades gracefully.

PUThttps://api.fitnesssyncer.com/api/providers/sources/id/authentication
Scopesource_write
Request bodyAuthentication
PUThttps://api.fitnesssyncer.com/api/providers/destinations/id/authentication
Scopedestination_write
Request bodyAuthentication

Where id is the id of the Source or Destination you are trying to authenticate.

Request Parameters

The request body will contain a JSON object as described here.

UsernamePassword

This will securely store the authentication on our servers and return a 200 response to you on success.

KeyDescription
typeAlways UsernamePassword
usernameThe username required for the user’s authentication
passwordThe password required for the user’s authentication

UsernamePasswordKey

This will securely store the authentication on our servers and return a 200 response to you on success.

KeyDescription
typeAlways UsernamePasswordKey
usernameThe username required for the user’s authentication
passwordThe password required for the user’s authentication
clientIdThe client id required for the user’s authentication
clientSecretThe client secret required for the user’s authentication

Identifier

This will securely store the identifier for the service on our servers and return a 200 response to you on success. An identifier may only be registered to one FitnessSyncer account at a time; registering one already claimed by another account returns a 409.

KeyDescription
typeAlways Identifier
identifierThe single string identifying this user to the provider — a device serial number, or an API key the user generates in the provider’s own settings

OAuth

This will start the redirects required to authenticate an OAuth-like scheme. This will return a 202 to you with a Location header to pass onto your user. Your user will end at the URL provided below on success or failure (except where beyond our control or extreme failures).

See the sequence diagram in Creating new Data Sources to see how this works visually.

If you are creating multiple sources or destinations using the same ProviderType for the same user, you only need to do this once. You can re-use the authentication with OAuthReuse or see Existing Provider Authentication for details.

KeyDescription
typeAlways OAuth
redirectThe URL you wish for FitnessSyncer to redirect the user for either success or failure modes. Leave it off and the user lands on their FitnessSyncer account page, where the source or destination they just authenticated appears.

OAuthReuse

This re-uses the authentication for another source or destination referenced by the id field. See Provider Authenticate for how to get the id field for this request.

This will store the re-use request and will return a 200 response to you on success.

KeyDescription
typeAlways OAuthReuse
idid of the item which you wish to re-use the authentication of

Response

If your request has been stored successfully, the response code will be a 200 without a body.

If your request has been initiated successfully, the response code will be a 202. Such a request will contain a Location header that you must send your user to. That location will be directed back to a FitnessSyncer service that will drive the completion of the request and redirect the user back to your site when the request is successful or has failed.

Existing Provider Authentication

For OAuth-based services, if you are using the same ProviderType for multiple sources and destinations for the same user, you need to use the same authentication for each source. This method will allow you to acquire the authorization summary of what exists already so that you can re-use that authentication.

Once you have the selected value, you can use the OAuthReuse authentication scheme.

GEThttps://api.fitnesssyncer.com/api/providers/authentication/
Scopesource_writedestination_write
Example request
curl -H "Authorization: Bearer AccessToken" "https://api.fitnesssyncer.com/api/providers/authentication/"

Request Parameters

None

Response

The Response will be a JSON body with a Providers Authentication.

Example JSON

{"providers": [{
    "keys": [{
        "name": "Fitbit Sleep Source",
        "id": "d8e1eb2e-bf26-4521-8c4b-7d85590e0588"
    }],
    "name": "Fitbit",
    "type": "FitBit"
}]}

Cloud Storage File Formats

The Cloud Storage providers (Amazon S3, DropBox, Google Drive, and OneDrive) store your data as individual files in your own cloud storage account, rather than in a third-party service’s own data model. Because there is no fixed schema being synchronized against, you choose the file format that gets written (or read) for each Source or Destination Task that uses one of these providers.

The file format, along with an optional storage path and filename template, is configured via a providerConfig.maps object on the Source Data or Sync Destination Task.

KeyDescription
fileFormatOne of TCX, GPX, KML, KMZ, FIT, PWX, CSV, or FitnessSyncerAPI. See the table below for which TaskTypes each format supports.
filenameFormatA template for the generated filename, for example {date}-{name}. Optional; a default is used if omitted.
pathThe directory within the provider’s storage to read from or write to. Optional; defaults to the root of the account.

Not every file format supports every TaskType. TCX, GPX, KML, KMZ, PWX, and CSV are GPS track formats and only support Activity. FIT additionally supports Weight and Blood Pressure. FitnessSyncerAPI — FitnessSyncer’s own JSON representation of an Item, the same shape used elsewhere in this API — is the only format that supports every TaskType, and is the recommended choice for any TaskType other than Activity.

File FormatSupported TaskTypes
TCX, GPX, KML, KMZ, PWX, CSVActivity
FITActivity, Weight, Blood Pressure
FitnessSyncerAPIAll TaskTypes

If you configure a fileFormat that does not support the TaskType of the Source or Destination Task, your request will be rejected with a 400 response describing the mismatch.

The Uploading Fitness Files endpoint also accepts a .fsapi file using this same JSON format, for any TaskType.

Types

List of Providers

JSON ItemData TypeDescription
providersArray of Provider

Provider

JSON ItemData TypeDescription
providerTypeStringThis is the value of the providerType to be passed in. This should not be displayed. Read-only.
nameStringThis is the description of the provider for display purposes. Read-only.
authenticationStringThis is the type of authentication which this provider requires. Must be one of: UsernamePassword, Identifier, AppRequired, OAuth, UsernamePasswordKey, Unsupported. See the Provider Authentication section in the documentation for information. Read-only.
betaBooleanIf this is true, this implies that this provider type is presently in public beta testing. Read-only.
notificationsBooleanTrue if this service currently does notifications-based synchronization. Read-only.
cloudStorageMapsProviderBooleanTrue if this is a Cloud Storage Map Provider.
cloudStorageCsvProviderBooleanTrue if this is a Cloud Storage CSV Provider.
reauthenticateAllBooleanTrue if this is a candidate for Reauthenticate All.
historicSyncBooleanTrue if this type supports Historic Sync.
compatibleAuthenticationArray of StringList of providers
faqStringURL to the FAQ
noticeStringIf applicable, this will include any important notices for this provider. These notices will generally be around deprecation and common issues.
noticeurlStringFor items with a notice, there may be an associated web page with additional information.
logoStringURL to the Logo
appurlStringIf this represents an app, this represents the URL for that app.
ActivityReadBooleanTrue if this provider can read activity data. Read-only.
ActivityWriteBooleanTrue if this provider can write activity data. Read-only.
AllergyReadBooleanTrue if this provider can read allergy data. Read-only.
AllergyWriteBooleanTrue if this provider can write allergy data. Read-only.
WeightReadBooleanTrue if this provider can read body composition data. Read-only.
WeightWriteBooleanTrue if this provider can write body composition data. Read-only.
BloodPressureReadBooleanTrue if this provider can read blood pressure data. Read-only.
BloodPressureWriteBooleanTrue if this provider can write blood pressure data. Read-only.
CholesterolReadBooleanTrue if this provider can read cholesterol data. Read-only.
CholesterolWriteBooleanTrue if this provider can write cholesterol data. Read-only.
ConditionReadBooleanTrue if this provider can read condition data. Read-only.
ConditionWriteBooleanTrue if this provider can write condition data. Read-only.
CycleTrackingReadBooleanTrue if this provider can read cycle tracking data. Read-only.
CycleTrackingWriteBooleanTrue if this provider can write cycle tracking data. Read-only.
ECGReadBooleanTrue if this provider can read ECG data. Read-only.
ECGWriteBooleanTrue if this provider can write ECG data. Read-only.
GlucoseReadBooleanTrue if this provider can read glucose data. Read-only.
GlucoseWriteBooleanTrue if this provider can write glucose data. Read-only.
MedicationReadBooleanTrue if this provider can read medication data. Read-only.
MedicationWriteBooleanTrue if this provider can write medication data. Read-only.
NutritionReadBooleanTrue if this provider can read nutrition data. Read-only.
NutritionWriteBooleanTrue if this provider can write nutrition data. Read-only.
OxygenReadBooleanTrue if this provider can read oxygen data. Read-only.
OxygenWriteBooleanTrue if this provider can write oxygen data. Read-only.
SleepReadBooleanTrue if this provider can read sleep data. Read-only.
SleepWriteBooleanTrue if this provider can write sleep data. Read-only.
TemperatureReadBooleanTrue if this provider can read temperature data. Read-only.
TemperatureWriteBooleanTrue if this provider can write temperature data. Read-only.