Data Source Items

With the identifier for a Data Source, you can access the data associated with the item.

Listing Items

The Listing API is a paging-based API, with the first page being the most recent.

GEThttps://api.fitnesssyncer.com/api/providers/sources/id/items/
Scopesource_data_activity_readsource_data_allergy_readsource_data_blood_pressure_readsource_data_blood_panel_readsource_data_cholesterol_readsource_data_condition_readsource_data_cycle_tracking_readsource_data_ecg_readsource_data_glucose_readsource_data_medication_readsource_data_nutrition_readsource_data_oxygen_readsource_data_sleep_readsource_data_temperature_readsource_data_weight_read

The data will be filtered based on the scopes provided; not all of the scopes listed are required.

Example request
curl -H "Authorization: Bearer AccessToken" "https://api.fitnesssyncer.com/api/providers/sources/id/items/"

Request Parameters

Query Parameter NameDescription
startDateWhich date should we start from? This would be in milliseconds since the epoch. Default is to not use the date.
endDateWhich date should we end at? This would be in milliseconds since the epoch. Default is to not use the date.
offsetHow many entries should we skip? Default is 0.
limitHow many entries would you like to return? Default and max is 100.
summaryWhen true, each entry carries only its itemId, date, and links rather than the whole item. The full item carries the same links. Default is false.

Response

The Response will be a JSON body with an items field containing a List Source Data.

If enabled and permission is granted by the participant, Researchers and Corporate Wellness can acquire a specific participant’s data listing.

Each entry carries a links object; see Downloading Item Files.

Getting a Specific Item

With the identifier for a Data Source, you can then access the data associated with the item. Items are generally static, so you may cache them in accordance to our terms of use.

GEThttps://api.fitnesssyncer.com/api/providers/sources/id/items/itemId
Scopesource_data_activity_readsource_data_allergy_readsource_data_blood_pressure_readsource_data_blood_panel_readsource_data_cholesterol_readsource_data_condition_readsource_data_cycle_tracking_readsource_data_ecg_readsource_data_glucose_readsource_data_medication_readsource_data_nutrition_readsource_data_oxygen_readsource_data_sleep_readsource_data_temperature_readsource_data_weight_read

The data will be filtered based on the scopes provided; not all of the scopes listed are required.

Response 200Sync Item Item
Example request
curl -H "Authorization: Bearer AccessToken" "https://api.fitnesssyncer.com/api/providers/sources/id/items/itemId"

Request Parameters

None

Response

The Response will be a JSON body with a SyncItem Item. See the Data Types section for a definition.

If enabled and permission is granted by the participant, Researchers and Corporate Wellness can acquire a specific participant’s activity item.

Downloading Item Files

Whether you read an item from Listing Items or from Getting a Specific Item, and whether or not you asked for the summary form, it carries the same links object of absolute URLs for downloading that item as a file.

Which keys are present depends on what the item can be rendered as, and the object is absent entirely when there is nothing to download. Treat every key as optional and check for it rather than assuming a fixed set.

Fetch a URL with the same Authorization Bearer token you used for the item itself. It requires the source_data_activity_read scope regardless of the item’s own type, so a token holding only, say, source_data_sleep_read will be refused with a 403 on a sleep item’s FIT link.

Creating new Items

This will allow you to insert new items into FitnessSyncer. You should upload data in reverse date order. It should be noted that inserting an item older than the most current item might not synchronize that item for destinations. This operation can only be done for items for which you have permission to do so.

PUThttps://api.fitnesssyncer.com/api/providers/sources/id/items/
Scopenotebook_activity_writenotebook_allergy_writenotebook_blood_pressure_writenotebook_blood_panel_writenotebook_cholesterol_writenotebook_condition_writenotebook_cycle_tracking_writenotebook_glucose_writenotebook_medication_writenotebook_nutrition_writenotebook_oxygen_writenotebook_sleep_writenotebook_temperature_writenotebook_weight_writenotebook_writeupdatable_providers

The appropriate scope must be granted for the TaskType selected for the operation to succeed.

Request bodyCommon
Response 200Id

Request Parameters

Body would be the JSON Serialization of the Item to be inserted. See the Data Types section for details.

Response

The Response will be a JSON body with an id field containing the new id. If the source has a filter associated with it which filters this out, the returned id will be “-FILTERED-”.

Updating Items

You may update any item that you have created. It should be noted that updating older items might not properly update the fields for already synchronized items. This operation can only be done for items for which you have permission to do so.

POSThttps://api.fitnesssyncer.com/api/providers/sources/id/items/itemId
Scopenotebook_activity_writenotebook_allergy_writenotebook_blood_pressure_writenotebook_blood_panel_writenotebook_cholesterol_writenotebook_condition_writenotebook_cycle_tracking_writenotebook_glucose_writenotebook_medication_writenotebook_nutrition_writenotebook_oxygen_writenotebook_sleep_writenotebook_temperature_writenotebook_weight_writenotebook_writeupdatable_providers

The appropriate scope must be granted for the TaskType selected for the operation to succeed.

Request bodyCommon
Response 200Id

Request Parameters

Body would be the JSON Serialization of the Item to be inserted. See the Data Types section for details.

Response

The Response will be a JSON body with an id field containing the new id. If the source has a filter associated with it which filters this out, the returned id will be “-FILTERED-”.

Uploading Fitness Files

If you have the data already within a file, you can upload that file into the system.

This API is just for uploading that file. To change any metadata, you will need to update that record accordingly.

Note that a single upload may result in multiple items depending on the file format.

POSThttps://api.fitnesssyncer.com/api/providers/sources/id/items/upload
Scopenotebook_activity_writenotebook_allergy_writenotebook_blood_pressure_writenotebook_blood_panel_writenotebook_cholesterol_writenotebook_condition_writenotebook_cycle_tracking_writenotebook_glucose_writenotebook_medication_writenotebook_nutrition_writenotebook_oxygen_writenotebook_sleep_writenotebook_temperature_writenotebook_weight_writenotebook_writeupdatable_providers

The appropriate scope must be granted for the TaskType selected for the operation to succeed.

Request bodyObject (multipart/form-data)
Fields
JSON ItemData TypeDescription
fileStringFile in one of the supported file formats.
Response 200Object
Fields
JSON ItemData TypeDescription
itemsArray of ObjectUploaded Item(s)
reviewObjectPresent when the document was taken as a laboratory or body composition report and is waiting for the person to check what was read out of it. Nothing has been stored yet, so `items` is empty: open this URL and the person confirms, corrects or discards what was read, and keeping it is what creates the item. It carries the answer whatever the answer is, so a document we would not read and one we could not make sense of arrive here too, each saying so in the person’s own language rather than as an error you have to word yourself.
Fields of items
JSON ItemData TypeDescription
idStringid of the newly uploaded item
urlStringURL for more information
Fields of review
JSON ItemData TypeDescription
urlStringWhere the person checks what was read, relative to the site as the item urls above are. Open it promptly and do not keep it: the reading it holds lives in a cache and expires, and it is not stored anywhere until the person keeps it. It is a page, so the person is signed in on the web to see it. Our own apps hand off to it with a one-time token instead, the way they do for the CSV column mapping, which is why it is a path rather than a whole URL.

Request Parameters

The Body is a multipart-form that contains an element named as file which encompasses a TCX, GPX, KML, KMZ, FIT, PWX, or PDF file. This must also include the standard Content-Disposition header.

By default, FitnessSyncer will attempt to de-dupe uploads. If you wish to circumvent this, please include the dedupe=false query string parameter.

If you are attempting to upload a file for a specific item, you may also include the id={id} query string parameter.

A laboratory or body composition report that no parser recognizes, such as a PDF from a laboratory or an imaging center, is stored as the item’s attachment and nothing is read out of it. To have its results read instead, include the labExtract=true query string parameter, which is the person’s explicit agreement that the text of that document may be sent to our language model provider. Sending it requires a Notebook write scope and answers 401 without one: uploading the file needs no scope and still does not, because reading it is the part that spends the person’s monthly allowance and sends their report.

Only send it when the person has agreed to it for the document in hand. Tell them what leaves, where it goes, and that nothing is stored until they keep it. Do not keep the answer as a setting and apply it to the next document.

The agreement is about the sending, so it changes nothing for a file we read ourselves. A FHIR, C-CDA, CSV or workout file is parsed here and never leaves, whatever you send, and a report whose own text already answers the question is read here too.

Response

The Response will be a JSON body with a list of items; each item will include an id and url for the item.

A document that was read instead carries a review object holding a url, and the list of items is empty, because nothing is stored until the person checks what was read. It is relative to the site, as the item URLs are, and it is a page, so the person is signed in on the web to see it. Open it promptly and do not keep it: the reading it holds lives in a cache and expires. It carries the answer whatever the answer is, so a document we would not read and one we could not make sense of arrive there too, each saying so in the person’s own language.

A spent monthly allowance for reading documents is a 429, which is worth offering again without labExtract because the file is stored either way.

Deleting Items

DELETEhttps://api.fitnesssyncer.com/api/providers/sources/id/items/itemId
Scopenotebook_activity_writenotebook_allergy_writenotebook_blood_pressure_writenotebook_blood_panel_writenotebook_cholesterol_writenotebook_condition_writenotebook_cycle_tracking_writenotebook_glucose_writenotebook_medication_writenotebook_nutrition_writenotebook_oxygen_writenotebook_sleep_writenotebook_temperature_writenotebook_weight_writenotebook_writeupdatable_providers

The appropriate scope must be granted for the TaskType selected for the operation to succeed.

Response 200Id
Example request
curl -X DELETE -H "Authorization: Bearer AccessToken" "https://api.fitnesssyncer.com/api/providers/sources/id/items/itemId"

Request Parameters

None

Response

The Response will be a JSON body with an id field containing the deleted item.